Repository navigation
Repair P9: the support oracle does not reject window reuse with top-8/16 sets at c = 1 - #97
Conversation
…6 sets On 18,274 post-rejection boundaries of the shared DFlash-16 trace, a greedy oracle that reuses the old window's top-16 candidate sets after the actual correction commits 5.08 tokens against fresh DFlash's 5.55 but skips the 2.33 ms draft: Delta = +0.99 tokens per boundary (95% CI +0.82, +1.13). Top-8: +0.22 (+0.03, +0.39). Top-4 and below and the cached unary control are rejected.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 80aa96a483
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| r_f, d, per = delta(rows, g2r, supported, ph, extra_us=0.0) | ||
| lo, hi = bootstrap(rows, per, args.bootstrap, seed=k) |
There was a problem hiding this comment.
Recompute r_F within each bootstrap replicate
The default metric estimates r_F from the same request data, but the bootstrap receives already-computed contributions using the full-sample r_F and only resamples their mean. This omits both the sampling variation in r_F and its covariance with reuse frequency and token gains, so the reported request-level 95% intervals are not intervals for the defined Delta; resample the request rows and recompute r_F and Delta in every replicate.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 13949b4: each request-level bootstrap resample re-estimates r_F on its own boundaries before computing Delta. Point estimates are unchanged; the intervals are regenerated in the JSON and README (top-16 +0.99 (+0.90, +1.07), top-8 +0.22 (+0.12, +0.32)).
| by_domain[dom] = { | ||
| 'boundaries': len(idx), | ||
| 'supported_rate': statistics.fmean(supported[i] for i in idx), | ||
| 'delta_oracle': statistics.fmean(per[i] for i in idx), |
There was a problem hiding this comment.
Recalculate the baseline rate for each domain
The per-domain values average per, whose contributions were calculated with the pooled all-domain r_F. Because the domains have different acceptance rates, these are not each domain's two-cycle Delta under the formula documented above, yet the README reports them as results “By domain.” Subset the rows and recompute r_F and Delta for each domain before recording these values.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 13949b4: the by-domain Deltas use each domain's own two-cycle r_F (recorded per domain as r_F_tokens_per_ms); README updated (top-16: chat +1.08, code +1.23, maths +1.02, MATH-500 +0.86).
| Input: the drafter workstream's per-cycle support table for the shared block-16 DFlash | ||
| trace (`support_screen.py --save-cycles`): per verify cycle the request id, prefix length, | ||
| the engine's accepted length L, the realized greedy continuation g (15 positions: the |
There was a problem hiding this comment.
Provide the documented cycles-table producer
A fresh checkout cannot generate the required cycles.pt: a repo-wide search shows that the referenced experiments/drafter/support_screen.py has no --save-cycles option and writes only summary.json and survival.csv, while the input itself is explicitly outside Git. Consequently the committed reproduction command cannot reproduce or independently check this evidence; add the producer/export path (or commit an independently verifiable input artifact).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed: the producer of cycles.pt (the drafter workstream's support_screen.py --save-cycles) is not yet on a pushed branch. I have asked the drafter workstream to push it and send the exact command and commit; the README will record them next to the file's SHA-256 before this PR is ready again.
|
Verdict: REQUEST CHANGES Reviewed head 80aa96a: four commits, rebased onto main 65a0a23. The oracle script was first committed at 03:31 (d218a58), before the results commit (08:29, b0539c2). What checks out
Blocking (Codex's three P2s, all valid)B1 ( B2 ( B3 ( |
r_F and Delta are now computed on the same boundaries: each request-level bootstrap resample re-estimates the two-cycle rate, and each domain uses its own. Point estimates are unchanged; the intervals narrow (top-16 +0.99 (+0.90, +1.07), top-8 +0.22 (+0.12, +0.32)) and the by-domain values change (top-16: chat +1.08, code +1.23, maths +1.02, MATH-500 +0.86).
|
Verdict: REQUEST CHANGES (only B3 remains) Re-reviewed 13949b4.
|
|
Verdict: REQUEST CHANGES (B3 wording only) Re-reviewed eef667e. The content of B3 is now right: the full SHA-256, the producer, the run time and the command all check against #104, which I approved at 33e1a0c and which matches the file. One thing remains. The README text cites "PR #104, branch |
|
Verdict: APPROVE Re-reviewed bcffdaf. B3 is fixed. #104 has merged, and the README now cites main's All three blockers are now fixed. The JSON still reproduces byte-identical, which I re-ran at this head, and the P9 verdict wording (not rejected at K = 8 and 16 as an upper bound, with A = 0) is unchanged. The branch is behind main but mergeable. Codex last ran on 80aa96a, and its three P2s were fixed and answered. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bcffdafb5a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| producer). It was written on 2026-10-01 at 08:27 UTC by `experiments/drafter/support_screen.py | ||
| --save-cycles` (on main since commit `1e66b99`; the run used `b631dc4`, an identical diff), run as | ||
| `scripts/gpu_lock.sh -s experiments/drafter/run_support_screen.sh` with the stock engine; |
There was a problem hiding this comment.
Add the cited cycles-table producer
The fresh evidence since the earlier thread is that this text now claims --save-cycles is available on main, but in the reviewed tree a repo-wide search finds that experiments/drafter/support_screen.py defines only --trace, --panel, --draft, and --out, and the cited experiments/drafter/run_support_screen.sh is also absent. Consequently a clean checkout still cannot produce the required out-of-tree cycles.pt or reproduce the committed JSON; include the producer/export implementation and runnable command in this commit rather than citing an unavailable commit.
Useful? React with 👍 / 👎.
| if rewalk is not None: | ||
| # The real refiner reuses exactly where the oracle at K = 16 could: the correction is | ||
| # supported, which is observable when the decision is made. | ||
| reuse16 = [r['U16'] >= r['J'] and r['m'] >= 1 and 'rewalk_accept' in r for r in rows] |
There was a problem hiding this comment.
Require top-16 data before scoring a rewalk
When --rewalk is combined with a valid --ks list that omits 16 (for example --ks 8 --rewalk selector.pt), boundaries() only adds the requested U{k} fields, but this unconditional r['U16'] lookup raises KeyError and the optional refiner experiment produces no output. Either always load U_16 when rewalk scoring is enabled or reject this option combination during argument validation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f378014: --rewalk adds 16 to --ks when it is missing, since the re-walk reuses exactly where the top-16 oracle could; tests/test_repair_p9.py runs --ks 4 --rewalk on a synthetic table and checks that a re-walk following the truth wherever it is supported reproduces the top-16 oracle's Delta.
A --ks list without 16 made --rewalk fail on U16; the script now adds 16 whenever --rewalk is given. Test with a synthetic table (skips without torch). The committed JSON regenerates byte for byte.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f37801454b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if rewalk is not None: | ||
| # The real refiner reuses exactly where the oracle at K = 16 could: the correction is | ||
| # supported, which is observable when the decision is made. | ||
| reuse16 = [r['U16'] >= r['J'] and r['m'] >= 1 and 'rewalk_accept' in r for r in rows] |
There was a problem hiding this comment.
Reject incomplete rewalk tables
When a --rewalk artifact omits any top-16-supported boundary, the 'rewalk_accept' in r condition silently treats that boundary as fresh DFlash, avoiding both the refiner's token loss and --rewalk-cost-us. Thus a partial artifact—such as one containing only successful or available walks—can inflate the matched-refiner Delta even though the stated policy reuses at every supported boundary. Require a walk for every eligible (rid, prefix_len) or model an explicit decision-time abstention rule rather than using missing data as fallback.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 3670dd8: with --rewalk, every boundary the top-16 oracle would reuse (U16 >= J and m >= 1) must have a walk. If any are missing, the script exits non-zero before writing output and names the count and the first missing (rid, prefix_len) keys. Each boundary record now carries prefix_len for this check. tests/test_repair_p9.py::test_partial_rewalk_fails_closed drops one walk from the table and checks for the exit and for no output file. Without --rewalk, p9_support_oracle.json still regenerates byte for byte.
…daries A boundary the top-16 oracle would reuse but the re-walk lacks used to be scored as fresh DFlash, which could inflate the refiner's Delta. The script now exits naming the missing (rid, prefix_len) keys; test with a partial table.
|
Verdict: APPROVE Re-reviewed 3670dd8 (cbc39e9, f378014 and 3670dd8).
Codex finished on f378014, and its one P2 is what 3670dd8 fixes. It has not run on 3670dd8. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Appendix F: add P9, the cached-window reuse oracle (#97)
Support oracle for Sam's proposal P9 (2026-10-01), correction-closed drafting: after a rejection, reuse once a program compiled from the first cycle's cached DFlash candidate sets, conditioned on the actual correction, instead of drafting the next block fresh. This is the pre-registered first test, run before anything is learned, at concurrency 1.
Rule and result
Two-cycle aggregate test,
Delta = E[G2_R - G2_F] - r_F E[A + T2_R - T2_F],r_F = E[G1 + G2_F] / E[T1 + T2_F]; reject this finite-window reuse at the tested configuration if the upper confidence bound ofDelta_oracleis <= 0.18,274 post-rejection cycle boundaries of the drafter workstream's shared DFlash-16 trace (80 requests). Where the corrected prefix lies in the old top-K sets, the greedy oracle proposes the true token wherever it is in the old set, so its second cycle commits
1 + min(m, U_K - J)tokens against fresh DFlash's1 + L'; a reused cycle costs a fresh cycle minus its 2.33 ms draft phase.The unchanged cached unary control (the old draft's tail after the correction) accepts 0.83 drafts and gives -1.93 (-2.34, -1.59): rejected. Valuing the saved time at DFlash's overall rate instead of the two-cycle rate gives +0.89 (K = 8) and +1.70 (K = 16). By domain at K = 16: chat +1.44, code +1.11, maths +0.82, MATH-500 +0.55. Confidence intervals: request-level bootstrap, 2,000 resamples.
Assumptions
evidence/repair/stage_a_timing.json, runfresh_b16); a reused cycle is charged exactly a fresh cycle without its draft phase.Files
experiments/repair/p9_support_oracle.py(also scores a selector's re-walk of the old slots with a per-reuse cost,--rewalk, for the matched-refiner control once the drafter's selector exists)evidence/repair/p9_support_oracle.json(reproduces byte for byte from the raw table)evidence/repair/README.md: P9 section with the command.Not yet: the draft share at c = 8 and 16 (queued), a priced fixed-shape program and the matched refiner (the drafter workstream's P6 selector re-walking the old slots).