---
name: time-a-memoised-cost-where-it-is-paid
description: an instrument that times a memoised call from the caller measures the cache hit — it reports ~0ms forever and the zero reads as good news
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 880d1285-2246-4429-9b5e-eb4331af141f
  modified: 2026-08-29T23:01:05.433Z
---

Caught 2026-08-29 during the RCA-242-R2-LINUX breadcrumb lane (todlando), before the branch
shipped. Instrumenting the silent `BRAIN_UP` → `brain.ready` window, my first version timed
`current_exe_hash()` from the CALLER, after `write_ready` had already called it. That function
memoises in a `OnceLock`, so the instrument would have timed a cache hit: **~0ms with
`computed=false`, on every run, for ever.**

**Why it is worse than a missing measurement:** the vacuous reading is not obviously broken. It
says the expensive stretch is cheap, which is a plausible answer to the question being asked, so
it would have closed the investigation on the wrong stretch and burned the repro run that
existed to settle it. The real figure turned out to be **10.1 SECONDS** — SHA-256 of a 440MB
debug binary through debug-compiled sha2, CPU-bound, on the ready path, every boot.

**How to apply:** time a memoised/lazy/cached cost INSIDE the call that may actually pay it, and
have that function return the cost; never measure a second call from outside. Carry a
`computed`/`cached` flag beside the figure, so a reader seeing `0ms` can tell *fast* from *not
this caller's turn* — a breadcrumb that cannot be wrong is not evidence. Pin BOTH arms in a unit
(first call computed, later call cached): that unit is exactly what would have failed against the
vacuous version. Generalises past timing — any instrument over a memo, a `OnceLock`, a lazy
static, or an idempotent write has this shape. Kin:
[[identical-readings-across-opposite-outcomes-indict-the-meter]],
[[a-baseline-green-cannot-discriminate-under-a-coin-flip-environment]] (both are instruments that
cannot disagree with the hypothesis they are meant to test).
