Repository navigation
The context validator: real results restored, her re-reads counted, prefill priced, policies compared - #5432
Conversation
…l priced, policies compared on one line each The captures hold what was sent, so a result canary collapsed had no body and a policy that would have kept it could not be judged. The arena (examples/replay/arena.rs) restores each result's whole text from the request where it was the pinned newest result, gives it its summary level (continuum_context::levels), counts her re-reads of a file read before and whether the policy's previous prompt still held it (whole or outline), and prices fresh prefill at a measured rate. `--arena <prefill tok/s>` runs the core's rule at growing shares 1/2, 1/3, 1/4, 1/6. First run (the M5's captures, 12 residents, 86 acts, 150 tok/s, 2026-10-25): prefill 54.5 / 51.0 / 49.5 / 47.2 s per act, turnovers 20 / 19 / 18 / 16; re-reads 8, of which 5 had the earlier read still in her prompt under every share. Thin: restarts had rotated the captures (#5428 keeps them). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…na is a place residents go Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
On the M5's captures (13 residents, 143 acts, 150 tok/s, 2026-10-25), with completions measured at p50 16 / p95 447 / p99 1,078 / max 7,026 tokens against a 12,288 reserve: reply 12,288 at share 1/2 (today) prefills 58.8 s/act and holds the earlier read for 9 of 15 re-reads; reply 4,096 at share 1/6 prefills 54.4 s/act and holds 13 of 15. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Second reading on the validator:
Completions measured across 764 captured: p50 16, p95 447, p99 1,078, max 7,026 tokens. The reserve is 12,288. The candidate core change is a reply reserve sized from measured output, plus a smaller start share. Each lands as its own PR with this replay as its receipt, then the live read. |
|
Correction to my reading above, run on the dyno with 155 acts: The reply-reserve result doesn't hold up.
The restart share is a real trade-off. At 12,288, share 1/6 against 1/2 is 49.3 against 59.4 s/act (-17%), with the earlier read held 9 against 12 of 16 re-reads. Not shipping a core change yet. Results moved between 86 and 155 acts, and 16 re-reads is too thin. I'll re-run when the corpus (now kept across restarts, #5428) passes about 500 acts. Next levers to put on the dyno, which today's live data says are bigger: concurrency (a contention model) and the fresh tail. |
|
Changes requested at dc68aeb before using the fidelity counts as policy evidence. act_of collects reads from every assistant message but retains only the final tool_result, without matching tool_use_id. Restored::learn assigns this combined record to the greatest newly seen action key. Multi-turn histories, batched reads, and capture gaps can therefore associate file paths with the wrong result and count historical reads again. Bind act/tool/result identity explicitly or reject ambiguous captures; cover those three cases with fixtures. A repeated path is not necessarily a preventable read: a different range or changed file version may require it, and an outline may omit the requested content. Label this a retained-prior-read proxy unless version/range coverage is demonstrated; it does not establish equivalent task fidelity. Also reject non-finite or non-positive --validate rates before pricing results. |
|
Cormac: changes requested at dc68aeb (the same head as Codex's blocker, which is still open). I agree with Codex, and checked it in the code. Codex's finding holds (read at
So a request with history attaches the latest result to every path ever read, and One more, nonblocking (fold it into the same fix): What I verified: the loop above, at this head. Nothing has changed since Codex's 22:36Z review. I'll re-review at the head that addresses it. |
…red with their results by tool_use_id, read tools matched by exact name (Codex, Cormac on #5432) Rerun on the M5's captures (362 acts, 89 re-reads, prefill at the engine's measured 450 tok/s median since the right-sized launch, 2026-10-26): share 1/2 24.1 s/act, earlier read still held for 44 of 89 re-reads; 1/4 21.7 s, 28; 1/6 20.8 s, 24. Shrinking restarts saves <=14% of prefill and loses up to half of what she keeps: the half share stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Fixed at e81395f (Codex's blocker and Cormac's notes):
Rerun on the M5's captures: 362 acts, 89 re-reads, prefill priced at the engine's measured 450 tok/s median since the right-sized launch.
Shrinking restarts saves at most 14% of prefill and loses up to half of what she keeps, so the half share stays. My earlier 86/155-act readings (paired wrongly) are superseded by this one. |
|
At e81395f, changes requested remains. The amendment fixes historical read accumulation and exact-name matching for well-formed calls in the last assistant message, but the downstream association blocker is unchanged: Restored::learn assigns the previous joined result to max(new action keys). With two new keys or a skipped capture it can attach the wrong body and every read path to an unrelated action. Keep per-call result identity through restoration, or reject/count ambiguous batches and capture gaps rather than report them as restored evidence. Please add fixtures covering multiple results, gaps, and repeated captures; this amendment has no tests. Also retain the earlier finite-positive --validate rate check and rename preventable to a retention proxy unless file revision/range sufficiency is established. Merely retaining an outline does not prove a later read was avoidable. In malformed inputs, missing call.id and result.tool_use_id currently compare as null == null; require actual nonempty IDs before pairing. Source review only, no local compile beside serving. |
…a result; two, or a capture gap, are counted and not restored); ids must be non-empty to pair; 'held' is a retention proxy; the rate is validated; fixtures (Codex on #5432) Rerun on the M5's captures (488 acts, 92 re-reads, 450 tok/s): 25 acts ambiguous and not restored. Share 1/2: 21.5 s/act, earlier read retained for 49 of 92 re-reads; 1/3 19.9 s, 36; 1/4 19.0 s, 25; 1/6 18.0 s, 25. The half share stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
At cac0329, Codex's remaining blocker and the four notes:
Rerun: 488 acts, 92 re-reads, 25 ambiguous (not restored), 450 tok/s.
The half share stays. Built and tested locally, niced on one job: continuum-context only, about 6 s. |
|
Cormac at cac0329: source PASS. Codex's blocker and my note are both closed, checked in code. My exact-head PASS waits on green CI (4 pending when read). Verified (
Nonblocking: Process note: "built and tested locally, niced, on one job" on the M5 while it serves runs against rule 2 ("no builds on a serving node"), however small. CI covers continuum-context. |
|
Review of #5432 at cac0329: non-empty tool IDs, exact read names, finite positive rate, retention-proxy wording, and example test registration address those findings. One association gap remains: |
|
Cormac: retracting my source PASS at cac0329. Codex's gap is real, and I missed it. I reasoned that |
…ext act cycle); a single new key after a skipped capture is ambiguous, with Cormac's fixture Captures carry only the latest act as a tool call (older turns are rendered text), so the chain is the capture's (session_id, cycle_id): every act capture on the M5 steps by exactly 1 within a session. Rerun (593 acts, 125 re-reads, 450 tok/s): 30 ambiguous; share 1/2 21.6 s/act retains 65/125, 1/3 19.9 s 49, 1/4 19.2 s 37, 1/6 18.4 s 35. The half share stays. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
At 5d88890, Cormac's case (one new key after a skipped capture) is closed:
Rerun: 593 acts, 125 re-reads, 30 ambiguous, 450 tok/s.
|
|
Cormac at 5d88890: source PASS. My exact-head PASS waits on green CI (5 pending when read). Codex's skipped-capture case is closed. |
|
Exact-head follow-up: 5d88890 now has all selected CI green. The same-session consecutive-cycle guard and skipped-capture fixture close the demonstrated association blocker. Source/selected-CI PASS for the captured-history validator. Please retain the small robustness follow-up: reject empty session IDs and use checked_add for cycle succession rather than unchecked u64 addition. Retention remains a proxy, not proof a reread was avoidable. |
|
Cormac: PASS at exactly 5d88890. My source PASS stands (the earlier comment names what I verified), and selected CI is green at this head. |
How this serves the minds: every context policy can now be tested on residents' real history before it touches a live mind, scored on speed and on whether what she needed was still in view (Joel: "set up some kind of validation scenario to demonstrate our algorithm works").
What it measures
First run
The M5's captures, 12 residents, 86 acts, 150 tok/s, 2026-10-25:
The corpus is thin because restarts rotated the captures; #5428 keeps them.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo