Research and Debug Journal

[1] JSON Re-Serialization Silently Broke Prompt-Cache Prefix Matching

Prompt-cache hit rates collapsed on any request that passed through one code path, with no error and no log line. Parsing the request into a generic map, appending a message, and re-serializing produced byte-for-byte different output from byte-for-byte identical meaning — and a prefix cache only cares about bytes.

[5] A Partial Unique Index Broke ON CONFLICT Arbiter Inference

Every insert failed with ‘no unique or exclusion constraint matching the ON CONFLICT specification’ — against a column that demonstrably had a unique index on it. ON CONFLICT does arbiter inference, and a partial index only qualifies if the statement’s own predicate implies the index’s.

[8] An Unblinded LLM Judge Biased a Benchmark’s Accuracy Comparison

A benchmark’s judge prompt labelled one answer as coming from the treated arm and printed the exact compression ratio applied to it. A judge primed to expect degradation will find it — and small differences between configurations turned out to be smaller than the judge’s own noise floor.

[12] An asyncio.Lock Bound to the Wrong Event Loop Caused Production Hangs

A repository client’s internal lock worked fine in isolated tests and deadlocked or raised confusingly under a real application’s request lifecycle. It had been created once, at object construction, capturing whatever event loop happened to be running at that moment — not the one that would later serve requests.

[16] A Method Name Collision Broke Requests on the Async Path Only

An async client call raised TypeError about unexpected arguments, only on the async path. A subclass had defined a method with the exact same name as a base-class transport method but a completely different signature, and a type: ignore comment was sitting right on top of it.