Skip to content

The context replay measures outlined results and a generational view (plan S1, card f746143e) - #5487

Merged
joelteply merged 2 commits into
canaryfrom
fable/replay-outline-results
Oct 26, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fable/replay-outline-results

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

This measures, offline, how to make a resident's acts faster by changing where a turnover's first changed byte lands. It runs on real captures of her own work and needs no live node (plan S1: median act under 60 s; card f746143e).

What it adds (core/continuum-context/examples/replay/)

  • --outline-results (outline.rs): an act's results enter whole while together they fit the view's measured per-act headroom. That headroom is View::appended_per_act, the growth reserve start_grants already keeps for one act; the rule adds no constant of its own. Past the headroom, the largest results enter at their levels::summarize outline, with a pointer line naming the tool/output <handle> (and code/read <path> with a line range) that pages them back. A result with no outline under a quarter of its size, or no handle, stays whole.
    • next-act: the result is whole on its own act, so her newest is never clipped, and outlined from the next act on.
    • strict: outlined even on its own act. This variant breaks the never-clip-the-newest rule; it is measured only to show the trade.
    • Paging proxy: a later act of hers, while the outline stands, quotes a line it left out (at least 40 characters, line number stripped).
  • --generational (sediment.rs): a sediment of handles frozen right after the head.
    • At a turnover, each growing source keeps young, newest first, what its reserved-start grant holds whole. Its older items settle into the sediment as handles, appended as one block. Her newest item of each source never settles.
    • Only a sediment past its share re-renders, and that is its own turnover. The share is what the start leaves the growing sources, divided by --share.
  • growable() is pulled out of start() and shared with the sediment. The tests cover the outline/handle rule, the paging count, settling only the oldest run, and the re-render.

Measured

Measured on canary 7b0232b + this commit, 2026-10-26 19:33Z: replay --purpose '' --append-tail 173 --outline-results --generational <capture>. The captures are from the M5 on 8e38ada. Tokens are at each resident's billed chars/token; seconds are at 173 tok/s prefill. The "today" row's turnovers are the core's rule replayed.

resident variant prefill tok s/request turnovers re-prefill tok/turnover sediment re-renders (handles dropped) outlined / paged back
Benchy (2f50b223, 223 req) (a) today 3,704,455 96 49 29,365
(b) append-tail 2,002,175 52 47 29,007
(c) + outline from next act 1,887,834 49 27 33,001 75 / 0
(d) + outline strict 1,093,424 28 24 27,839 74 / 0
+ generational 1,849,125 48 46 26,177 9 (386)
+ generational + outline next act 1,784,600 46 27 30,056 2 (211) 76 / 0
Aris (75ece751, 51 req) (a) today 734,680 83 14 28,444
(b) append-tail 632,749 72 15 31,856
(c) + outline from next act 564,382 64 10 35,341 15 / 1
(d) + outline strict 419,013 47 9 30,697 16 / 2
+ generational 557,648 63 13 30,178 2 (100)
+ generational + outline next act 551,739 63 10 34,093 1 (79) 15 / 1
e5f4141d (99 req) (a) today 910,342 53 18 27,909
(b) append-tail 754,369 44 18 28,834
(c) + outline from next act 692,888 40 13 30,161 16 / 2
(d) + outline strict 544,396 32 12 27,662 17 / 2
+ generational 709,966 41 18 27,452 1 (59)
+ generational + outline next act 685,474 40 13 28,615 0 (0) 16 / 2

Reading

  • Outlining from the next act cuts turnovers by 28-43%, but cuts prefill by only 6-11%. Most of what remains is each oversized result prefilled whole once, on its own act. The strict variant removes that cost (Benchy -45% vs append-tail, 52 to 28 s/request), but it is exactly what the plan forbids, since her newest result arrives clipped to an outline. The gap between (c) and (d) is the price of never clipping the newest end. Closing it needs her to ask for less per act (ranged reads), not a cut.
  • The generational view barely lowers re-prefill per turnover (Benchy 29.0k to 26.2k tokens). The handles it freezes were never the cost; the young generation re-rendered at its start grant is. It also drops handles at re-render (386 for Benchy), so a sediment as modelled loses coverage. As built, it is not the lever.
  • The paging proxy is low (0-2 per resident), but it only counts verbatim quotes of elided lines of 40+ characters, so treat it as a lower bound.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

… where a turnover's first changed byte lands (plan S1, card f746143e)

--outline-results: an act's results enter whole while they fit the view's
measured per-act headroom (View::appended_per_act); past it the largest enter at
their levels::summarize outline with a pointer line naming the tool/output
handle that pages them back. Whole on its own act, outline from the next act;
the strict variant (outline on its own act too) is measured beside it, with a
paging proxy (a later act quoting an elided line).

--generational: a sediment of handles frozen after the head; a turnover settles
each growing source's oldest items that its reserved-start grant cannot keep
whole, appended as one block, so it re-prefills from the young boundary; the
sediment re-renders only past its share.

Each run prints one TABLE line: prefill, s/request, turnovers, re-prefill per
turnover, sediment re-renders, outlined and paged back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at 6155b96: PASS (example-only measurement modes, +644/-32).

Verified:

  • Table arithmetic: five rows recomputed from prefill tokens / requests / 173 tok/s: Benchy (c) 49, (d) 28, + generational 48; Aris (c) 64; e5f4141d gen+outline 40. All match.
  • No new threshold: the outline cut point is the existing levels::LEVEL_RATIO (outline.rs:9), not a second constant. The per-act headroom is View::appended_per_act, the same reserve start_grants keeps.
  • Files stay small: replay.rs is 659 lines and append.rs 302; outline.rs and sediment.rs are new, each with one test module.

Notes (non-blocking):

  • QUOTE_CHARS = 40 (outline.rs:31) is the paging proxy's only new constant. You already label the proxy a lower bound; one line on why 40 (long enough to be a distinctive line, not a common token run) would make the number reviewable.
  • The reading holds, and it's the useful result here. The gap between (c) and (d) is the price of never clipping her newest. It closes only if she asks for less per act, not if the view cuts. That lines up with my enrico numbers: on the CPU tier, a ~10k-token whole-file read at ~20 tok/s prefill is about 8 minutes on its own act. So whatever moves her toward ranged reads, through the tool's own surface and never through a substrate cut, pays most on the slowest node.

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at 1b0af10: PASS carries over. The delta from 6155b96 is outline.rs +6/-1, a comment only. It says honestly that 40 is a chosen floor and not a measured separator (about 22% of lines recur across Benchy's 67 results at every length from 10 to 60 characters), and that the proxy is a lower bound. That answers my note.

@joelteply
joelteply merged commit 6dd7f8c into canary Oct 26, 2026
15 checks passed
@joelteply
joelteply deleted the fable/replay-outline-results branch October 26, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant