Skip to content

P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds - #109

Merged
SamMausberg merged 10 commits into
mainfrom
repair/p9-padded-scope
Oct 1, 2026
Merged

SamMausberg merged 10 commits into
mainfrom
repair/p9-padded-scope

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

This narrows the scope of the P9 support oracle in evidence/repair/README.md and adds two bounds to p9_support_oracle.py. All computation is on the CPU from the saved cycles table, with no GPU work. Every field already in p9_support_oracle.json is unchanged; the JSON only gains new keys. It follows Codex's two P1s on #108 (discussion_r4154812200 and r4154852822) and the P2 on this PR (r4154878753).

The PR has four commits:

  1. Padded verify; two roundings (e068acc).

    • components() charges every reused cycle a fresh block-16 cycle minus the draft phase, which includes the full 4.73 ms verify. After a correction at J, only m = 15 - J positions remain, and a narrower verify that costs less raises Delta at every K. So the upper-bound reading and the rejections of top-1, top-2 and top-4 hold only for a padded verify. The README states Delta = Delta_padded + r_F p_K (4.73 ms - V_R) and the break-even V_R per K, and notes that a sweep over verify widths 2 to 16 is queued.
    • Rounding now matches the JSON: top-2 Delta -0.6648 becomes -0.66 (was -0.67), and the top-16 lower limit 0.8946 becomes +0.89 (was +0.90).
  2. Always-reuse scope (d2c1e2f). The oracle reuses at every boundary with U_K >= J and m >= 1. A gated program can fall back to fresh DFlash, so the always-reuse oracle does not bound it. The table note, a new assumption (5) and the verdict now scope every verdict to always-reuse policies, a padded block-16 verify and the offline-recomputed candidate sets.

  3. Omniscient-gate oracle (ae226fe). For each supported boundary, it takes the better of oracle reuse and fresh drafting, knowing fresh DFlash's next accepted length. This makes it at least 0 and at least the always-reuse Delta by construction, so it rejects nothing. It bounds P9's program with any gate over the same candidate sets with a padded verify. It uses the same seeds as the always-reuse bootstrap, so the intervals are paired.

    K gate reuses at Delta (95% CI) gain from gating the oracle reuse arm
    1 0.7% +0.01 (+0.01, +0.01) +0.05
    2 24.9% +0.45 (+0.42, +0.49) +1.12
    4 41.6% +0.91 (+0.85, +0.98) +1.33
    8 53.9% +1.44 (+1.35, +1.53) +1.21
    16 62.9% +2.05 (+1.93, +2.18) +1.06

    Tests check that the gated Delta and both ends of its interval are at least the always-reuse ones and at least 0, and that the gate picks the better arm at each boundary.

  4. Free-verify bound with intervals (3d6064d). The zero-cost verify case is the lower bound on a variable-width verify's cost. It was previously quoted only as point estimates, and K = 1 was +0.0099. The script now bootstraps it with the same resamples (free_verify_always_reuse):

    K Delta (95% CI)
    1 +0.01 (+0.00, +0.02)
    2 +0.89 (+0.81, +0.98)
    4 +1.88 (+1.75, +2.05)
    8 +2.89 (+2.71, +3.10)
    16 +3.86 (+3.64, +4.11)

    No K is rejected. The test checks the identity Delta_free = Delta_padded + r_F p_K V(16) and that both interval ends dominate the padded ones.

  5. Tested K only (472b964). Only K = 1, 2, 4, 8 and 16 were tested, and Delta is not monotone in K. The README therefore names top-1, top-2 and top-4 and the tested K instead of giving ranges (Codex on Appendix F: add P9, the cached-window reuse oracle (#97) #108).

  6. Program class, gate features and a gate over free verify (7288c46), from the review and Codex on Appendix F: add P9, the cached-window reuse oracle (#97) #108/P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109.

    • The oracle bounds P9's program, which conditions on the whole corrected prefix through the frozen sets. A program whose support starts at the correction is a different class and is not covered; with recomputed sets, such a program could also reuse where the recomputation drops an accepted token. The README states this in the reuse paragraph, the table note, assumption (4) and the verdict, matching F.7 on main.

    • The supported suffix length U_K - J needs the greedy tokens after the correction, so it is an oracle target, not a gate feature. The gate features named are J, m and the old sets' probabilities at the remaining positions.

    • The verdict's gated bound now says "with a padded verify".

    • The free-verify bound says the other phases stay at their block-16 values: 0.23 ms for accept, commit and append, plus 0.16 ms outside the timed phases.

    • The gating column (1.06 to 1.33 tokens) is described correctly (see commit 9).

    • New omniscient_gate_free_verify applies the gate to the free-verify scoring, which bounds gated programs at any verify width:

      K Delta (95% CI)
      1 +0.04 (+0.03, +0.05)
      2 +1.47 (+1.35, +1.61)
      4 +2.54 (+2.35, +2.76)
      8 +3.47 (+3.24, +3.73)
      16 +4.35 (+4.09, +4.64)

      A test checks that it dominates both the gate and the free verify alone, at both interval ends.

  7. Wording (latest commit). The gate-over-free-verify bound now names P9's program with any gate, at any verify width, matching the sentences around it. This is wording only, in the README and the docstring.

  8. Free-verify scope (cf99c10, Codex on P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109). A narrower reused cycle can also cut non-verify overhead: fresh_b8 keeps 383.81 µs after draft and verify, against 395.11 µs for fresh_b16. The free-verify and gate-over-free-verify bounds therefore now cover only implementations whose non-verify phases cost at least their block-16 values. This is stated in the README, the docstring and a scope string on both JSON entries.

  9. Gating gain (28da072, Codex on P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109). Gated minus always-reuse oracle is only the gain from gating the oracle's reuse arm. A real program's reuse arm x_i <= o_i can gain max(0, x_i) - x_i from gating, which can exceed that figure. The absolute gated-oracle bound stays. The column, the docstring and the JSON key (gain_from_gating_oracle_reuse, renamed from gain_over_always_reuse) now say only that.

  10. Baseline run (latest commit, Codex on P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109). --baseline-run could select any run, whose non-verify remainder the free-verify bounds would then keep under a block-16 label. The cycles table is a block-16 trace, so the script now refuses a baseline that is not fresh DFlash at block 16. The scope string names the run and its remainder (fresh_b16: 395.11 µs). A test checks that fresh_b8 and force_b16 baselines exit without writing output.

No number changed in commits 7 to 10.

Checks.

  • tests/test_repair_p9.py: 6 passed.
  • pre-commit is clean on the changed code. codespell is clean on the README, which the hooks skip.
  • The JSON regenerates byte for byte from the command in the README; the run takes about 70 s on one core. Every field already on main is unchanged.

The oracle charges a reused cycle the full block-16 verify. A program that verifies only the
m + 1 remaining positions could pay less, so the upper-bound reading and the top-1 to top-4
rejections hold for a padded verify only. The README now says so, gives Delta as a function
of the reused verify time, its value at a free verify (a lower bound on that cost, derived
from the table) and the break-even verify times. Two table entries now round as the JSON does:
top-2 Delta -0.66 (was -0.67) and the top-16 lower limit +0.89 (was +0.90).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T12:12:01.919563Z 57b017a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e068accaf2

ℹ️ 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".

Comment thread evidence/repair/README.md Outdated
Comment on lines +229 to +231
With the variable-width verify cost at its lower bound of zero (V_R = 0, every other phase still
charged; derived from the table, point estimates, no intervals), Delta would be +0.01 (K = 1),
+0.89 (2), +1.88 (4), +2.89 (8) and +3.86 (16): upper bounds for any verify width, and no K would

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recompute intervals before applying the rejection rule

The preregistered rule rejects based on the upper confidence bound, but the zero-cost results are explicitly only point estimates with no intervals. In particular, the K=1 estimate is just +0.0099 before rounding, and a positive point estimate alone does not establish that its bootstrapped upper bound exceeds zero. Recompute the request-level bootstrap under the variable verify cost before claiming that no K would be rejected, or limit this sentence to the point estimates.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3d6064d. The zero-cost verify case is now scored with the same request-level bootstrap and resamples as the table (free_verify_always_reuse in the JSON): K = 1 +0.01 (+0.00, +0.02), 2 +0.89 (+0.81, +0.98), 4 +1.88 (+1.75, +2.05), 8 +2.89 (+2.71, +3.10), 16 +3.86 (+3.64, +4.11). Every upper end is above 0, so "no K would be rejected" now follows from the rule. The break-even verify times are still labelled as point estimates. A test checks Delta_free = Delta_padded + r_F p_K V(16) and that both interval ends dominate the padded ones. This PR also adds the always-reuse scope (d2c1e2f) and the omniscient-gate bound for gated programs (ae226fe).

…ffline sets

The oracle reuses at every supported boundary. A gated program that falls back to fresh
DFlash where reuse is unfavourable is not bounded by it, so the top-1 to top-4 rejections
cover always-reuse policies only (Codex on #108). The table note, assumption (5) and the
verdict now name the policy class, the padded block-16 verify and the offline-recomputed
candidate sets.
Per supported boundary the gate takes the better of oracle reuse and fresh DFlash, knowing
fresh DFlash's next accepted length. Its Delta is >= 0 and >= the always-reuse Delta by
construction, so it rejects nothing; it bounds gated programs over the same candidate sets
with a padded verify, and its excess is the most a perfect gate could add. Same seeds as the
always-reuse bootstrap, so the intervals are paired; every existing field of the JSON is
unchanged. Top-16: +2.05 (+1.93, +2.18), about one token per boundary above always-reuse.
Tests: the gated Delta and both interval ends dominate always-reuse and are >= 0; the gate
picks the better arm per boundary.
…stimates

The zero-cost verify case (the lower bound of a variable-width verify's cost) was given as
point estimates, so 'no K would be rejected' was not established at K = 1 (+0.0099). The
script now scores it with the same request-level bootstrap and resamples
(free_verify_always_reuse): every K's upper end is above 0, top-1 +0.01 (+0.00, +0.02).
Other JSON fields are unchanged. Test: the free-verify Delta equals the padded Delta plus
r_F p_K V(16), and both interval ends dominate the padded ones.
@SamMausberg SamMausberg changed the title P9 evidence: scope the support oracle to a padded verify; fix two roundings P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds Oct 1, 2026
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3d6064d56c

ℹ️ 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".

Only K = 1, 2, 4, 8 and 16 were tested and Delta is not monotone in K, so 'top-1 to top-4'
and 'every K from 2 to 16' claimed untested sizes (Codex on #108). The README now names
top-1, top-2 and top-4 and the tested K.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 472b96423c

ℹ️ 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".

Comment thread evidence/repair/README.md Outdated

A perfect gate would add about one token per post-rejection boundary at each tested K from 2 to 16
(2, 4, 8 and 16). A real gate decides before the second cycle and does not see fresh DFlash's
outcome, so a gate is worth building only if features known at decision time (the correction

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the oracle-only suffix from observable gate features

When a gate decides before the second cycle, the supported suffix length is not known: U_K is computed from the realized greedy continuation, and only the already-revealed prefix through the correction can establish U_K >= J; the future quantity U_K - J used for the suffix remains oracle information. Listing it among features known at decision time therefore proposes an unavailable input for the real gate; remove it or describe it as an oracle target that observable confidence features might predict.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7288c46. The supported suffix length U_K - J is no longer listed as a gate feature. The README now says it needs the greedy tokens after the correction, so it is an oracle target that observable features might predict. The features named are those known at decision time: the correction position J, the remaining horizon m and the old sets' probabilities at the remaining positions.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Review on the exact head 472b964.

What I verified

  • The JSON reproduces. The README command regenerates evidence/repair/p9_support_oracle.json byte-identical. The run took 84 s on one core, with the SGLang venv for torch. The input cycles.pt has SHA-256 a587d952….
  • Nothing in main's JSON changed. Every field in main's p9_support_oracle.json is identical here. The run only adds omniscient_gate_oracle and free_verify_always_reuse under each K.
  • Every new number in the README and PR body matches the JSON:
    • the gate table (reuse rates, Delta, intervals and gains);
    • the free-verify Deltas and intervals;
    • the two rounding fixes (-0.6648 to -0.66, and 0.8946 to +0.89);
    • the break-even V_R of 0.888, 2.711 and 3.873 ms, which I recomputed as 4.734 + Delta/(r_F p_K).
  • The timing claim holds. stage_a_timing.json has exactly one verify narrower than 16 at c = 1: fresh_b8, 4,164 us, in the same timing1 session as fresh_b16.
  • The gate is a valid bound. r_F comes from the fresh arm and does not depend on the gate. So for any subset of supported boundaries where a gated program reuses, its Delta is at most the sum of max(0, dg - r_F dt) over all boundaries, divided by n.
  • The intervals are paired. bootstrap draws the same resamples for the same seed. Each replicate's gated Delta is at least its always-reuse Delta, so the quantiles dominate too. The tests check both.
  • The free-verify identity holds. extra_us = -verify shifts dt by -V only on reused boundaries. That gives Delta_free = Delta_padded + r_F p_K V, which the test checks.
  • Tests and hooks pass. tests/test_repair_p9.py: 5 passed. Pre-commit passes on the four changed files, and codespell is clean on the README.
  • Attribution is clean. All five commits are authored and committed by Samuel Mausberg, and there are no AI lines in the commits or the PR body. Nothing cites ~/vp-coord or an unmerged PR.

Blocking

  1. Codex P2 on 472b964: the supported suffix length is not known at decision time (P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109 (comment)). It has no reply or fix yet, and it is right.
    • U_K - J depends on the greedy tokens after the correction, which a gate deciding before the second cycle has not seen. Only U_K >= J and m are observable.
    • In the sentence at README line 261, replace "the supported suffix length" with something that is observable, such as the remaining window m or the old candidate sets' probabilities at the remaining positions. Or name it as an oracle target that observable features might predict.
  2. The README does not carry Appendix F: add P9, the cached-window reuse oracle (#97) #108's program-class scoping.
    • Since Appendix F: add P9, the cached-window reuse oracle (#97) #108 merged (5896eb2), Appendix F.7 says the verdicts hold only for P9's program, which conditions on the whole corrected prefix through the old block's frozen candidate sets. It also says a program whose support starts at the correction (suffix-only conditioning) is a different class and is not covered.
    • The README is the evidence that sentence cites (\ev{repair-p9}). It still says the oracle "bounds from above every real program over the same candidate sets that verifies a padded block and reuses at every supported boundary", and assumption (4) says the same. A suffix-only program can reuse where U_K < J, so that claim is wider than the paper's.
    • This is Codex's P1 on Appendix F: add P9, the cached-window reuse oracle (#97) #108 (Appendix F: add P9, the cached-window reuse oracle (#97) #108 (comment)), which was answered by scoping in the paper but not here.
    • Please name the class in the paragraph after the table, in assumption (4) and in the verdict. Also note that with recomputed sets, a suffix-only program could reuse where the recomputation drops an accepted token.
  3. The verdict line drops the padded-verify scope from the gated bound.
    • "For gated programs the omniscient-gate oracle gives an upper bound of +2.05 (+1.93, +2.18) at top-16". The gate oracle charges the full block-16 verify, so it does not bound a gated program with a narrower verify.
    • The gate paragraph already says "with a padded verify". The verdict line, which is the one the paper will quote, needs the same words.

Suggestions (non-blocking)

  • The free-verify case keeps the other fresh_b16 phases at their block-16 medians: accept 23 us, commit 110 us and append 100 us, plus 162 us of cycle not in any phase. If any of these shrink with verify width, the bound is not strictly "at any verify width". No K is rejected under it, so no verdict depends on this. Writing "with the other phases at their block-16 values" would make the claim exact.
  • Neither oracle bounds a program that is both gated and variable-width. Running the gate on comp_free would add one key and cover that case. Otherwise, say so in the scope note.
  • "A perfect gate would add about one token per post-rejection boundary": the gains are 1.06 to 1.33 tokens, so "1.1 to 1.3 tokens" is more exact.

…over free verify

Review of #109 and Codex on #108/#109:
- The oracle bounds P9's program, which conditions on the whole corrected prefix through
  the frozen sets; a program whose support starts at the correction is a different class
  and is not covered (README paragraph, table note, assumption (4), verdict, docstring).
- The supported suffix length U_K - J needs the greedy tokens after the correction, so it is
  an oracle target, not a gate feature; the features named are J, m and the old sets'
  probabilities at the remaining positions.
- The verdict's gated bound says 'with a padded verify'; the free-verify bound states that
  the other phases stay at their block-16 values; a perfect gate adds 1.06 to 1.33 tokens.
- New omniscient_gate_free_verify: the gate over free-verify scoring bounds gated programs at
  any verify width (top-16 +4.35 (+4.09, +4.64)). Test: it dominates both the gate and the
  free verify alone, end by end. Other JSON fields unchanged.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

1 similar comment
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex's review of 7288c46 was still running when I posted this. I will re-check its threads on this head before merge.)

Re-review on the exact head 7288c46.

My three blocking items are fixed.

  1. Gate features (Codex P2, P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109 (comment); it has a reply).
    • The features listed are now J, m and the old sets' probabilities at the remaining positions, all known at decision time.
    • U_K - J is described as an oracle target, because it needs the greedy tokens after the correction.
  2. Program class. The README now matches F.7 on main in four places: the reuse paragraph, the table note, assumption (4) and the verdict. The script docstring says the same.
    • It names P9's program as the one that conditions on the whole corrected prefix through the old block's frozen sets.
    • It says suffix-only conditioning is a different class that is not covered.
    • The wording "every real program over the same candidate sets" is gone.
  3. Verdict line. The gated bound now reads "with a padded verify".

Checks

  • The JSON regenerates byte-identical from the README command (one core).
  • Nothing existing changed. Every field on main, and every field at 472b964, is unchanged. The run adds only omniscient_gate_free_verify.
  • New numbers match the JSON:
    • The gate over free verify gives +0.04 (+0.03, +0.05), +1.47 (+1.35, +1.61), +2.54 (+2.35, +2.76), +3.47 (+3.24, +3.73) and +4.35 (+4.09, +4.64).
    • Gate gains run from 1.06 to 1.33.
    • The other phases total 0.23 ms (22.9 + 109.6 + 99.7 us), and 0.16 ms of the cycle (162.9 us) falls outside the timed phases.
  • The new test is right. It checks that the gate over free verify dominates both the gate alone and free verify alone, at both interval ends. Paired resamples make this hold for every replicate.
  • Tests and hooks: tests/test_repair_p9.py gives 5 passed. Pre-commit passes on the four files, and codespell is clean on the README.
  • Attribution: the commit is by Samuel Mausberg, and neither it nor the PR body has an AI line.
  • Merge state: GitHub reports MERGEABLE. The branch is behind main, but the files do not overlap.

Blocking: none.

Suggestion (non-blocking). The sentence that introduces omniscient_gate_free_verify, in the README and the docstring, says it "bounds gated programs at any verify width". The sentences around it say "P9's program with any gate", so "P9's program with any gate, at any verify width" would match them. Context already implies the class, so this is not blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7288c460d2

ℹ️ 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 = estimate(comp, everything)
lo, hi = bootstrap(rows, comp, args.bootstrap, seed=k)
# Variable-width verify at its cost lower bound: the reused cycle's verify is free.
comp_free = components(rows, g2r, supported, ph, extra_us=-ph['verify'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove every width-dependent cost from the upper bound

When a narrower reused cycle also reduces non-verify overhead, subtracting only ph['verify'] does not produce the claimed upper bound for every verify width. The committed timing data already exhibits this case: fresh_b16 retains 395.11 µs after draft and verify, whereas fresh_b8 retains only 383.81 µs (stage_a_timing.json), so a free-verify width-8 cycle can be faster than comp_free assumes and exceed both reported “upper bounds.” Set the entire reused-cycle cost to its zero lower bound, or restrict the JSON/docstring claims to implementations whose other phases cost at least the block-16 values.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in cf99c10 by restricting the claim, as you suggested. The free-verify and gate-over-free-verify bounds now cover only implementations whose non-verify phases cost at least their block-16 values. The README cites the measured counterexample (fresh_b8 keeps 383.81 µs after draft and verify against 395.11 µs for fresh_b16) and says these are not bounds for every implementation. The docstring says the same, and both JSON entries carry a scope string. No number changed.

Wording only, as in the sentences around it: the bound covers P9's program with any gate,
at any verify width. No code path or number changes.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d16a1840e3

ℹ️ 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".

Comment thread evidence/repair/README.md Outdated
Comment on lines +251 to +253
always-reuse Delta by construction, so it rejects nothing. It bounds from above P9's program with
any gate over the same candidate sets with a padded verify, and its excess over always-reuse is the
most a perfect gate could add (same resamples as the table, so the intervals are paired):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the gate gain to the oracle policy

This difference only compares the gated oracle with the always-reuse oracle; it is not the most a perfect gate could add for a real selector. If a real reuse contribution is x_i and its oracle upper bound is o_i, then x_i <= o_i, but the gate's improvement over always reusing is max(0, x_i) - x_i, which can exceed max(0, o_i) - o_i whenever the selector fails on a boundary where oracle reuse is favorable. Thus the later 1.06–1.33 claim can understate the value of gating a realizable program; retain the absolute gated-oracle upper bound, but describe this column only as the gain from gating the oracle reuse arm.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 28da072. The absolute gated-oracle Delta stays as the upper bound for P9's program with any gate and a padded verify. The column is now "gain from gating the oracle reuse arm". The README says that a real program's reuse arm is no better than the oracle's, so gating it can gain more, and that the column does not bound that gain. "Most a perfect gate could add" is gone from the README and the docstring, and the JSON key is renamed to gain_from_gating_oracle_reuse. The gate-feature sentence now says a real gate pays off only if decision-time features predict where its own reuse arm loses to fresh drafting. No number changed.

…osts

Codex on #109: a narrower reused cycle can also cut non-verify overhead (fresh_b8 keeps
383.81 us after draft and verify, fresh_b16 395.11 us), so subtracting only the verify phase
does not bound every implementation. The free-verify and gate-over-free-verify bounds are
now stated for implementations whose non-verify phases cost at least their block-16 values,
in the README, the docstring and a 'scope' string on both JSON entries. No number changes.
…racle's reuse arm

Codex on #109: gated minus always-reuse oracle is not the most a gate could add to a real
program. A real reuse arm x_i <= o_i can gain max(0, x_i) - x_i from gating, which can exceed
the oracle's figure. The absolute gated-oracle bound stays; the 1.06-1.33 column is now only
'the gain from gating the oracle reuse arm' in the README, the docstring and the JSON key
(gain_from_gating_oracle_reuse, renamed from gain_over_always_reuse). No number changes.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28da072b1b

ℹ️ 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".

Comment on lines +283 to +284
# Variable-width verify at its cost lower bound: the reused cycle's verify is free.
comp_free = components(rows, g2r, supported, ph, extra_us=-ph['verify'])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Tie the free-verify scope to the selected baseline

When the supported --baseline-run option selects anything other than fresh_b16, this calculation subtracts that run's verify phase and retains that run's non-verify costs, yet the emitted scope and documentation still describe block-16 costs. For example, --baseline-run fresh_b8 computes from the 0.384 ms width-8 remainder while labeling the result as using the 0.395 ms block-16 remainder; a run with a larger remainder could even invalidate the stated upper bound for implementations whose costs merely meet the block-16 minimum. Either restrict the option to fresh_b16 for these bounds or derive the scope from the selected run.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 57b017a. The oracle's cycles table is a block-16 trace (H = 15), so phases() now refuses a --baseline-run that is not fresh DFlash at block 16, and exits before writing output. The free-verify scope string is now built from the selected run: it names the run and its remainder beyond draft and verify (fresh_b16: 395.11 µs). The docstring says the baseline must be a fresh block-16 run. A new test checks that fresh_b8 and force_b16 baselines exit without output. Only the scope string changes in the JSON.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Re-review on the exact head 28da072 (d16a184, cf99c10 and 28da072 on top of 7288c46). My provisional approval of 7288c46 is withdrawn: Codex's P2 on that head (r4155061029) needed the change in cf99c10, and there is a new Codex P2 on this head.

What I verified

  • The two earlier Codex P2s are fixed, and both have replies.
    • r4155061029: the free-verify bounds are now limited to implementations whose non-verify phases cost at least their block-16 values. The counterexample is right: from stage_a_timing.json, the cycle minus draft and verify is 383.81 us for fresh_b8 and 395.11 us for fresh_b16.
    • r4155078266: the gate column is now "the gain from gating the oracle's reuse arm". The README says it does not bound what gating adds to a real program, and "the most a perfect gate could add" is gone.
  • The JSON regenerates byte-identical from the README command.
    • Against 7288c46, no value changed. The run only renames gain_over_always_reuse to gain_from_gating_oracle_reuse and adds a scope string to each of the two free-verify entries, which is 10 keys.
    • Against main, no existing field changed.
  • Tests and hooks: tests/test_repair_p9.py gives 5 passed. Pre-commit passes on the four files, and codespell is clean on the README.
  • Attribution: the commits are by Samuel Mausberg, with no AI lines.

Blocking

  1. Codex P2 on 28da072: tie the free-verify scope to the selected baseline (P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109 (comment)). It has no reply or fix yet.
    • --baseline-run accepts any run in the timing file, and comp_free keeps that run's non-verify remainder. The new FREE_VERIFY_SCOPE string and the docstring still say "block-16 values".
    • With --baseline-run fresh_b8, the JSON would label a 383.81 us remainder as the block-16 one.
    • The committed JSON uses the default, fresh_b16, so the committed evidence is right; the problem is the script's labelling for any other run.
    • Either restrict these bounds, or the option, to fresh_b16, or build the scope string from the selected run's name and remainder.
    • The rest of the oracle also assumes a block-16 trace (H = 15). Restricting --baseline-run to block-16 runs may be the simpler fix.

Suggestions: none.

…-verify scope

Codex on #109: --baseline-run could select any run, whose non-verify remainder the
free-verify bounds would then keep while the scope still said block 16. The cycles table is
a block-16 trace (H = 15), so the script now refuses a baseline that is not fresh DFlash at
block 16, and the scope string names the run and its remainder beyond draft and verify
(fresh_b16: 395.11 us). Test: fresh_b8 and force_b16 baselines exit without output. Only the
scope string changes in the JSON.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex's review of 57b017a was still running when I posted this. I will re-check its threads on this head before merge.)

Re-review on the exact head 57b017a ("P9 oracle: require a fresh block-16 baseline run; name it in the free-verify scope").

  • Codex P2 on 28da072 (P9 evidence: scope the support oracle (padded verify, always-reuse); gated and free-verify bounds #109 (comment)) is fixed and has a reply.
    • phases() now refuses a --baseline-run whose mode is not fresh or whose block is not 16, and exits before any output is written.
    • The scope string is built from the selected run: "... block-16 values in fresh_b16 (395.11 us per cycle beyond draft and verify) ...".
    • The new test checks that the fresh_b8 and force_b16 baselines exit without writing output.
    • stage_a_timing.json carries mode and block on every row, so the check works on the real file.
  • The JSON regenerates byte-identical. Against 28da072, the only change is the free_verify_always_reuse/scope string in each K; no value changed and no key was added or removed.
  • Tests and hooks: tests/test_repair_p9.py gives 6 passed. Pre-commit passes on the four files.
  • Attribution: the commit is by Samuel Mausberg, with no AI lines.
  • Everything I checked on 28da072 and 7288c46 still holds: the numbers against the JSON, the program-class scope, the gate wording and the free-verify condition.

Blocking: none. Suggestions: none.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 57b017a234

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant