Skip to content

Appendix F: exact fold-every-commit verification for DFlash; P10 rejected by its gate (#133) - #158

Merged
SamMausberg merged 4 commits into
mainfrom
paper/appendix-fold
Oct 1, 2026
Merged

SamMausberg merged 4 commits into
mainfrom
paper/appendix-fold

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

This PR folds #133 (the drafter's fold-every-commit GDN verify) into Appendix F, the levers table and the register. It is source-only. The sources are the three buffered-verify sections of evidence/drafter/README.md and the files in buffered_verify/, phase_timing/ and fold_timing/.

Appendix F.8, "Verifying the recurrent state"

P10 is rejected without building. Its gate required SGLang's exact GDN fold to take at least 9.09% of the speculative cycle at concurrency 8 and 16. It takes 4.9% and 6.6%, so removing it outright would make the cycle at most 1.05x and 1.07x faster.

The new paragraph, "Exact verification without per-position snapshots", covers the following.

What changes. SGLang's fold-every-commit protocol stops writing the 805 MB of per-position states that each request needs per cycle at block 16. Engine patches enable it for DFlash and turn it on for GDN pools under MTP.

Kernel parity. The fold's verify output and committed state are bitwise equal to the stock verify's in all 9 cases. The circular replay differs in 19-20% of BF16 words.

Served equality with matched pools. Equality means the same tokens and the same top-5 logprobs.

  • MTP with three steps: all 80 sequences at concurrency 1.
  • DFlash at block 16: the 8 requests rerun at concurrency 1 with the radix cache on.
  • Both: all 80 sequences in fixed-composition batches of 4 (DFlash) and 8 (MTP) with the radix cache off.

No bitwise claim is made for closed-loop clients above concurrency 1, because stock itself does not reproduce there. The differences in the first, unmatched-pool check followed the fold server's own pools, not the fold.

Held batches. The cycle is 8.6% shorter at batch 8 and 11.9% shorter at batch 16. The verify loses 1.10 and 2.16 ms of state writes; the commit gains 0.22 and 0.38 ms.

Served A/B. One session, order stock, fold, fold, stock, on both tuned DFlash arms:

Concurrency Fold against stock
8 +5.8 to +6.1%
16 +8.2 to +9.4%
32 +11.8 to +12.0%
1 -3.2% on block 16 (the best configuration at c = 1), -1.4% on block 8

Tokens per cycle are unchanged. The likely cause of the c = 1 slowdown is the value-tile choice, which comes from code reading and is labelled untested.

Status table, levers table, register

  • Status table: a new P10 row (rejected by its gate). The P11 row now says P10 has since been rejected.
  • Levers table: a new row, "Fold-every-commit verification for DFlash", class exact. It is kept to one line so that Table 21 still fits its float page.
  • Register: a new evitem drafter-fold, covering the parity, exactness, localize, phase and fold-timing files, the README and the engine patches, with their scripts. The p10-split devitem is removed.

Checks

  • Local build on cores 48-55 under the untimed-exclusive rule: 0 warnings, 82 pages, main text ending on p10, References on p11. The first build overflowed Table 21 by 7.7 pt, so I shortened the new row.
  • scripts/check_paper_references.py: clean.
  • Self-review: every equality claim names its configuration and n. The one-session serving result is labelled as such. The c = 1 cause is labelled untested.
  • The host-identity hook passes.

Note on merge order. #157 also edits Table 21, in the backbone row. Whichever of #157 and this PR merges second needs a rebase and a check that the table still fits.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@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-01T19:51:16.271615Z 30a762c 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.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (35916ca; 2 blocking, both about how the served bitwise sentence describes its conditions. Every number checks out. My build of this head is queued in the CPU window.)

Blocking

  1. "with a closed-loop client above concurrency 1 stock does not reproduce itself bitwise" claims more than was measured. The evidence is MTP at c = 8: the stock rerun matched on 10 of 80 sequences (evidence/drafter/README.md, first-check table). DFlash's stock rerun at c = 8 matched on 80 of 80, at a running limit of 5. Name the measurement, for example "stock MTP at c = 8 reproduced itself on only 10 of 80 sequences, so no bitwise claim is made for closed-loop clients above concurrency 1", as the README does in its parenthesis.
  2. "In served greedy decoding with matched pools" also covers MTP at c = 1, whose pools were not matched. That result is the first check's: stock had 362,723 KV tokens and fold 416,669, with the same 8 mamba slots and running limit 8. Equality held anyway, so the result is not weakened, but the stated condition is wrong. Scope "matched pools" to the DFlash rerun and the fixed-composition batches, or give MTP c = 1 its own condition ("same running limit").

Checked against evidence/drafter/README.md (#133)

  • P10's gate. The fold phase is 4.9% and 6.6% of the cycle at batch 8 and 16 against the 9.09% gate. 1/(1 - 0.049) = 1.05 and 1/(1 - 0.066) = 1.07.
  • Fold protocol. It avoids 805 MB of per-position state per request per cycle at block 16. The kernel check is bitwise in all nine cases, and the circular replay differs in 19-20% of BF16 words.
  • Served exactness. DFlash block 16: the 8 rerun requests at c = 1 with the radix cache on, at matched pools p1 and p2. Fixed-composition waves: DFlash in waves of 4 (132,371 tokens) and MTP in waves of 8 (139,092 tokens), radix off. The first check's differences followed that fold server's own pools.
  • Held batches. 10.83 to 9.90 ms (-8.6%) and 15.37 to 13.54 ms (-11.9%). The verify phase loses 1.10 and 2.16 ms, and the commit gains 0.22 and 0.38 ms.
  • Served A/B. One session, ordered stock, fold, fold, stock: 5.8-6.1% at c = 8, 8.2-9.4% at 16 and 11.8-12.0% at 32; -3.2% at c = 1 on block 16 (848 against 876) and -1.4% on block 8. The tile-of-32 cause is labelled as code reading, untested, and the two tilings were bitwise equal in the kernel check.
  • Tables and register. The P10 and P11 rows and the removed p10-split match the evidence. Every file and script the drafter-fold evitem cites exists on main.
  • No hostname and no AI attribution.

Optional

  • The levers row's "+6--12%" rounds 5.8 up. "+5.8--12.0%" is exact, if it fits the line.

@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: 35916ca048

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

P7b: certified block-parallel GDN verification beats strict replay & Captured-trace arms: reference, strict replay, certified fast, unchecked fast (Appendix~\ref{app:verify-state}) & SGLang's chunked kernel is not a usable fast path (synthetic inputs, one request)~\ev{fast-verify}; the certified path \pend{p7b}\\
P9: reusing a cached DFlash window once after a rejection beats fresh drafting & Support oracle on the post-rejection boundaries, then the cost-charged two-cycle test with a real program and a matched refiner (Appendix~\ref{app:p9}) & For P9's program, conditioned on the whole corrected prefix, over offline-recomputed candidate sets, with a padded block-16 verify and reuse at every possible boundary at $c=1$, the oracle bound does not reject reuse with top-8 and top-16 sets ($\Delta=+0.22$ and $+0.99$ tokens per boundary; an upper bound, not a speed-up) and rejects it with top-1, top-2 and top-4~\ev{repair-p9}; the bounds with a free reused verify and with an oracle gate reject none of the tested sets; real program \pend{repair-p9-program}\\
P11: restartable prefix-demand verification removes verify work & None run (Appendix~\ref{app:verify-state}) & Dropped by its author in favour of P10: verify kernels keep the recurrent state in registers, so a shorter suffix does not remove per-token full-state reads (reasoning); P10's first test \pend{p10-split}\\
P10: replaying the accepted tail inside the next verify kernel pays & Share of the speculative cycle in SGLang's exact GDN fold at concurrency 8 and 16; built only if at least 9.09\% (Appendix~\ref{app:verify-state}) & Rejected without building: 4.9\% and 6.6\%, so removing the fold outright would make the cycle at most $1.05\times$ and $1.07\times$ faster~\ev{drafter-fold}\\

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 Close P10 in the project tracker

Now that this row declares P10 rejected, TASKS.md:112 still marks P10 as active and says the phase-timing hold is queued. This leaves the repository's work tracker contradicting the paper and can cause the already-completed gate or rejected implementation to be scheduled again; update that task to record the rejection and its evidence.

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 5696ac5: TASKS.md now marks P10 done, rejected by its gate (fold phase 4.9% / 6.6% of the cycle at c = 8 / 16 against 9.09%, at most 1.05x / 1.07x), with the PR and evidence/drafter/README.md.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Update to my verdict on 35916ca (still REQUEST CHANGES): Codex r4159663482 is valid. Add it to my two items.

  1. TASKS.md still marks P10 active, with the phase-timing hold described as queued (line 112 on main). The paper now records P10 as rejected without building. Mark it done, with the result (4.9% and 6.6% against the 9.09% gate, so at most 1.05x and 1.07x), PR Drafter: exact snapshot-free GDN verify (fold-every-commit) for DFlash and MTP, with its exactness and timing jobs #133 and evidence/drafter/README.md, as the P5 and P13 entries do. P11's entry ("in favour of P10") can stay as it is, since the paper's P11 row now says that P10 was rejected.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

5696ac5: the served bitwise sentence now gives MTP at concurrency 1 its own condition (same running limit and recurrent slots, KV pools 362,723 stock and 416,669 fold) and scopes "all pools matched" to the DFlash rerun and the waves; the closed-loop sentence names the measurement (stock MTP matched a stock rerun on 10 of 80 at concurrency 8). TASKS.md marks P10 done. Build: 0 warnings, References on p11, checker clean.

@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: 5696ac5cff

ℹ️ 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 TASKS.md
- `todo` P7: certified block-parallel GDN verification against strict replay on a captured trace (reference, strict, certified fast, unchecked fast, reduced precision) (moonshot; first rejection tests in PR #60, `evidence/moonshot/README.md` section 2e: SGLang's chunked kernel is not a usable fast path, synthetic inputs at one request)
- `done` P7: five-contract framing of every exactness claim in the paper, counterexamples reproduced as tests (paper; PR #26, #30; `evidence/contracts/`)
- `active` P10: anchor-fused exact replay of the accepted GDN tail inside the next verify; first the per-phase split with SGLang's exact GDN fold at c = 8 and 16, build only if the fold phase is at least 9.09% of the cycle (drafter; phase-timing hold queued)
- `done` P10: anchor-fused exact replay of the accepted GDN tail inside the next verify, rejected without building by its pre-registered gate: SGLang's exact GDN fold phase is 4.9% / 6.6% of the cycle at c = 8 / 16 against the 9.09% gate, so removing it outright would make the cycle at most 1.05x / 1.07x faster (drafter; PR #133; `evidence/drafter/README.md`)

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 Close the duplicate snapshot-free verification task

Although this row now closes P10 and attributes the completed fold work to PR #133, TASKS.md:122 still marks “Snapshot-free GDN verify for DFlash and MTP” as active with “no PR yet.” That entry describes the exact fold implementation, bitwise checks, and timing evidence this commit reports, so leaving it active keeps the tracker contradictory and may cause completed work to be scheduled again.

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 cf48226 (now rebased; head 30a762c): TASKS.md marks the snapshot-free GDN verify task done with PR #133 and evidence/drafter/README.md, and records that the fold is bitwise equal to stock verification and the circular replay is not.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (5696ac5; 1 blocking: Codex r4159738366, a one-line tracker fix)

All three of my items are fixed:

  1. The closed-loop sentence names the measurement: stock MTP at c = 8 matched a rerun on 10 of 80.
  2. MTP at c = 1 has its own condition: the same running limit and slots, with KV pools of 362,723 and 416,669. "All pools matched" now covers only the DFlash rerun and the waves.
  3. TASKS.md closes P10 with its numbers, PR Drafter: exact snapshot-free GDN verify (fold-every-commit) for DFlash and MTP, with its exactness and timing jobs #133 and the evidence file.

Keeping "+6--12%" is fine.

Blocking

…cted by its gate (#133)

From evidence/drafter/README.md (buffered GDN verify sections) and
buffered_verify/, phase_timing/, fold_timing/ (#133):
- kernel parity: the fold's verify output and committed state are bitwise
  equal to the stock verify's in all nine cases; circular replay differs
  in 19-20% of BF16 words;
- served, matched pools: bitwise equal to stock verification for MTP s3
  on all 80 sequences at c = 1, DFlash b16 on the 8 requests rerun at c = 1
  (radix on), and both on all 80 in fixed-composition batches of 4 and 8
  (radix off); no bitwise claim for closed-loop c > 1;
- held batches: cycle 8.6% shorter at batch 8, 11.9% at 16;
- served A/B, one session on both tuned DFlash arms: +5.8-6.1% at c = 8,
  +8.2-9.4% at 16, +11.8-12.0% at 32; -3.2% at c = 1 on block 16 and
  -1.4% on block 8 (likely value-tile cause, untested);
- P10 rejected without building: the fold is 4.9% and 6.6% of the cycle
  at c = 8 and 16, below its 9.09% gate.
New paragraph in App F.8, P10 status row (P11's row updated), a levers
table row, evitem drafter-fold; the p10-split devitem goes.
MTP at concurrency 1 had the same running limit and recurrent slots but
different KV pools, so it is no longer covered by "matched pools"; the
closed-loop non-reproduction is stated as the MTP concurrency-8 measurement.
TASKS.md now records P10 as rejected by its gate.
Widen the Status column to 4.6 cm and shorten the backbone and fold cells,
so the table fits its float page again.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

Rebased on main after #155 and #157 merged (head 30a762c). The register conflict is resolved: P-A to P-C, then P10 and P11. TASKS.md closes the snapshot-free verify task. The levers table, which #157's backbone row had pushed 17.7 pt past its float page, fits again: Status column widened to 4.6 cm, backbone and fold cells shortened. Build: 0 warnings, References on p11, checker clean.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 30a762c7a9

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

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (30a762c)

  • My three items and Codex's two are fixed.
  • The rebase onto f60608f is right. It orders the status rows P9, P-A to P-C, P10, P11, P13, and removes p10-split. The levers table is refitted by widening the Status column to 4.6 cm and shortening two cells ("Best isolated kernel up to M=16"; "one session"), with no number changed.
  • Build. My build of 30a762c with latexmk -g has 0 LaTeX warnings, 0 overfull boxes and 84 pages, with References on page 11. check_paper_references.py reports no differences.
  • Checks. Pre-commit from main is clean, and Codex found no issues on this head.

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