Skip to content

replay --paged-reads: an unranged read answers with its first page; measure prefill and the extra pages she needed (S1) - #5488

Merged
joelteply merged 1 commit into
canaryfrom
fable/replay-paged-reads
Oct 26, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fable/replay-paged-reads

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

This serves the residents' speed (plan path step 1, line S1). It measures offline whether code/read with no range should answer with a first page plus [lines 1-N of M; page with start_line/end_line]. That isn't a clip of her newest result: she gets what the tool says it gives, and knows the rest is there.

Stacked on #5487 (fable/replay-outline-results). Merge that first; this diff is one commit (37ecdf6).

What it adds

--paged-reads (with --append-tail) adds two variants to the replay. The new file is examples/replay/paged.rs (278 lines, one test mod, 2 tests).

  • Page rule, with no new constant: an act's unranged reads share the view's measured per-act headroom (View::appended_per_act, the same quantity --outline-results uses). A page is the longest run of whole lines from line 1 that fits a read's share. A read that fits is sent whole. Before the first epoch has measured a headroom, every read is sent whole.
  • When she needs more pages (a lower bound):
    • A later act that quotes a line past the page charges one extra request that appends that page, once per page. Quotes use the outline proxy's ≥40-char lines, and edit old_strings count.
    • A ranged read past the page is a request she made anyway. It costs nothing extra, but it does mark the first page as not enough.
    • A later read of the same file closes the earlier read's account.
  • Conservative in one place: a turnover restores results whole from the action log, so a paged read is charged whole again at a start.

Measured

Replay of M5 prompt captures from 2026-10-26, as in #5487: replay --purpose "" --append-tail 173 --outline-results --paged-reads <caps>, at 173 tok/s prefill, on 37ecdf6.

resident variant prefill tok s/request turnovers extra requests paged reads: first page held all used lines / used later at all
Benchy 2f50b223 (223 req) (a) append-tail 2,002,175 52 47 – –
(b) + paged reads 1,520,273 39 34 0 38 of 44 / 6
(c) + paged reads + outline from next act 1,474,168 38 31 0 54 of 59 / 6
ref: (a) + outline from next act only 1,887,834 49 27 – –
Aris 75ece751 (a) 632,749 72 15 – –
(b) 545,623 62 (61 with extras) 12 1 6 of 8 / 5
(c) 538,648 61 (60) 11 1 6 of 8 / 5
e5f4141d (a) 754,369 44 18 – –
(b) 716,392 42 17 0 3 of 3 / 0
(c) 679,050 40 13 0 3 of 3 / 0

How to read the last column:

  • Benchy: every one of the 6 paged reads she showed any later use of went past the page. The evidence for all 6 is her own ranged reads (requests she made anyway), not quotes. So the 38 "held" are reads with no evidence of use at all, not proven-sufficient pages.
  • Aris: 3 of the 5 used reads were fully held by the first page. One quote past the page is charged as 1 extra request.
  • Quotes are a weak signal: quotes rarely match file lines in these captures, so "extra requests" is a floor.
  • Headroom (median): 10.4k chars for Benchy (b), 16.6k for Aris, 5.1k for e5f4141d.

Not measured

  • How her behaviour would change on seeing a page (she may page on purpose). Only a live read shows that; the owner of the live read is the S1 line.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at 37ecdf6: PASS (example-only; this review covers the one commit on top of #5487's 1b0af10, which I passed earlier).

Verified:

  • Rows recompute exactly (prefill tokens / requests / 173): Benchy (b) 39 and (c) 38 s/request, Aris (b) 62, e5f4141d (c) 40.
  • No new constant: paged.rs has no threshold outside its tests. A read's page is its share of View::appended_per_act, the same measured headroom --outline-results uses, and a read that fits is sent whole.
  • The stack is clean: git log origin/canary..pr/5488 is The context replay measures outlined results and a generational view (plan S1, card f746143e) #5487's commits plus 37ecdf6, and contains 1b0af10.
  • The "held" column is reported honestly: Benchy's 38 of 44 are reads with no evidence of later use, not proven-sufficient pages, and the body says so.

Note for the live trial (S1 line, not this PR): an unranged code/read answering with a page and a [lines 1-N of M; page with start_line/end_line] footer changes a Hands tool's contract, so the trial should check her act quality, not only prefill. On the CPU tier it matters most: enrico prefills at ~20 tok/s at long context, so a median Benchy-scale page (~10k chars, about 2.7k tokens) instead of a whole ~10k-token file is roughly 6 minutes less per read there, by arithmetic and not yet measured.

…e and names the rest; measure prefill, turnovers and the extra page requests her acts show she needed (plan S1)

The page is the longest run of whole lines that fits the view's measured per-act headroom
(shared equally among an act's unranged reads), the same quantity --outline-results decides
by; no constant of its own. The need for later pages is a lower bound: a later quote of a
line past the page charges one extra request appending that page; a ranged read past it is a
request she made anyway, so it marks the first page as insufficient without an extra charge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/replay-paged-reads branch from 37ecdf6 to de994ad Compare October 26, 2026 20:31
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at de994ad: source PASS carries over. git range-diff shows de994ad = 37ecdf6, identical, now a single commit on canary after #5487's squash merge. Exact-head PASS once CI is green.

@github-actions github-actions Bot added size: L and removed size: XL labels Oct 26, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at de994ad: PASS at this exact head. All 16 checks are done with no failures, and the commit is identical to the 37ecdf6 I reviewed (range-diff empty).

@joelteply
joelteply merged commit 3a925f8 into canary Oct 26, 2026
16 checks passed
@joelteply
joelteply deleted the fable/replay-paged-reads branch October 26, 2026 20:45
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