Skip to content

Repair Stage B: the anchored residual evaluator fails at the operator level - #58

Merged
SamMausberg merged 3 commits into
mainfrom
repair/stage-b
Oct 1, 2026
Merged

SamMausberg merged 3 commits into
mainfrom
repair/stage-b

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

P3 Stage B: the decision-level test of target-anchored residual decoding on real DFlash blocks, following Sam's critique (two cascading replays against the original anchor, certificate ratios, hazards, free-running repair audited exactly, and the economic gate against DFlash). The code is from #56 (experiments/repair/residual_eval.py, summarize_residual.py, p3_gate.py); this PR adds the measured result and its README section.

Result: claim (1) fails first, and (2) and (3) fail with it

Setup: the Hugging Face Qwen3.5-4B target (BF16, pinned revision; its argmax agrees with the engine's verify argmax on 99.1% of positions) run block by block from an exact prefix cache. Every linear operator, including the tied head, is repaired as z-bar + (W U) U^T (x - x-bar) against the anchor pass over the DFlash draft, with fixed principal-component bases per operator input fitted on 120 development blocks; nonlinearities, the causal convolution, the GDN recurrence from the exact state and attention over the exact prefix run exactly. 80 held-out real DFlash-16 blocks with a rejection, split from the development blocks by request.

rank 0 16 128 512
operator-local error, median over inputs (range by class) 1.0 0.76-0.90 0.64-0.81 0.51-0.73
replay 1: repaired argmax = exact argmax 35% 33% 37% 44%
replay 2 24% 24% 28% 35%
accepted drafts after 0 / 4 repair sweeps 4.33 / 4.33 4.33 / 4.39 4.33 / 4.33 4.33 / 4.44
  • (1) The fixed bases do not contain the changes a token correction causes: even on the development blocks rank 128 captures a median 51-64% of the change energy.
  • (2) At the corrected position itself the repaired decision is right 11-14% of the time; the certificate ratio R_i = 2 ||z~ - z||_inf / m_i is below 1 at 4.7% of positions at every rank (median 13-16). Positions before the first change agree exactly in every block (harness check).
  • (3) Exact Jacobi from the same anchor accepts 2.98 (the DFlash draft), 4.33, 5.35, 6.38, 7.34 and 8.30 drafts after 0-5 exact passes: about one token per exact sweep, which also bounds any faithful cheap evaluator.
  • Economic gate against DFlash-16 (repair cost a bytes-only lower bound, audit = measured V(16) + commit from Stage A): the anchored evaluator reaches at most 0.28 of DFlash's committed tokens per unit cost; exact Jacobi with nearly free sweeps reaches 0.27, 0.47, 0.66, 0.85 and 1.03 after 0-4 sweeps.

With Stage A (#56: the two-pass design's ceiling is 4.78x end to end against a 5x target), P3 is refuted on both stages and its Phase 2 prototype is not worth building.

Files

  • evidence/repair/residual_eval_b16.json, residual_eval_b16.agree_by_distance.csv, p3_gate_b16.json
  • evidence/repair/README.md: the Stage B section with the commands.

Raw output (per-block records and the development diagnostics) stays in ~/vp-data/repair/residual/b16.

…tor level

On 80 held-out DFlash blocks (block 16), fixed PCA bases leave a median
51-90% of the operator-weighted change uncaptured at ranks 16-512, the
repaired argmax matches the exact one at 35-44% of changed positions, and
four repair sweeps add at most 0.1 accepted tokens while each exact Jacobi
sweep adds about one. The evaluator reaches at most 0.28 of DFlash's tokens
per unit cost.
@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-01T03:20:55.687208Z e7a7dff PR opened
ℹ️ 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

Reviewed head e7a7dff, one commit on main at 9932235, evidence files only. Everything reproduces exactly from the raw output, and the verdict follows from it. One sentence about the pre-registered controls is missing.

Checked and correct

  • Reproduction. On ~/vp-data/repair/residual/b16, summarize_residual.py reproduces residual_eval_b16.json and residual_eval_b16.agree_by_distance.csv exactly. p3_gate.py, with the README's arguments (--read-tbps 3.827, the merged stage_a_oracle.json), reproduces p3_gate_b16.json exactly.
  • Numbers. Every figure in the README and the PR body matches the JSON.
    • Operator-local error: 1.0 at rank 0; 0.76-0.90, 0.64-0.81 and 0.51-0.73 at ranks 16, 128 and 512.
    • Development energy at rank 128: 0.507-0.639.
    • Replay agreement: 35/33/37/44% on replay 1 and 24/24/28/35% on replay 2 at ranks 0/16/128/512.
    • At the corrected position: 11.3-13.8%. R < 1 at 4.67%; R medians 12.8-16.3.
    • Free-running acceptance: 4.325, and at most 4.4375 after four sweeps.
    • Exact Jacobi: 2.975, 4.325, 5.35, 6.375, 7.3375 and 8.3.
    • Gate: anchored evaluator at most 0.276 (rank 16, one sweep). Exact-Jacobi ceiling 0.27, 0.47, 0.66, 0.85 and 1.03. The rigorous bound does not reject (407 us per extra token against 972).
    • Engine/HF argmax agreement on the development blocks: 99.11%.
  • Split. The development and held-out blocks are split by request: even-indexed requests give 120 development blocks, odd-indexed give 80 held-out. The bases are fitted on the development blocks only.
  • Gate inputs. The gate uses the corrected max_extra = B - 1 - a0 from Repair oracles: Stage A refutes P3's two-pass design; recycling does not help DFlash #56 and the measured audit V(16) + commit = 4.90 ms.
  • Hygiene. There are no AI co-author lines and no paths outside the repository. Raw output stays in ~/vp-data with its command.

Blocking

B1. Say which pre-registered Stage B controls were run (evidence/repair/README.md, the Stage B section).

  • P3's Stage B pre-registration (Sam, 2026-09-30) lists three controls: "full-target Jacobi from the same initialization, a comparable standalone compact drafter, and the initializer without repair". Its key novelty ablation is whether the anchored evaluator beats an ordinary compact drafter with the same storage and compute.
  • This run includes exact Jacobi and the no-repair initializer (rank 0, anchor outputs reused). It does not include the compact drafter.
  • The verdict does not need the drafter: the evaluator gains at most 0.11 drafts over the no-repair initializer in four sweeps, while exact Jacobi gains about one per sweep. But the README should say that the drafter control and the novelty ablation were not run, and why they are not needed.

Suggestions (not blocking)

  • Statistics that do not move with rank. Two statistics do not change with rank:

    • The share of positions with R_i < 1 is 4.67% at every rank from 0 to 512, against 2.80-2.91% on replay 2.
    • At the corrected position itself (distance 0), agreement is 11.25% (9 of 80) at every rank from 0 to 256.

    That suggests these positions are ones where the repaired output does not depend on the basis at all, for example positions whose exact change at the head input is zero, or where the anchor's argmax already equals the exact one. Please say what they are, so that "R_i < 1 at 4.7%" is not read as certificates that the repair earns.

  • Free sweeps for exact Jacobi. The exact-Jacobi ceiling reaches 1.03 of DFlash only with sweeps that cost only their bytes. One sentence on what that means would help: even a perfectly faithful cheap evaluator would only match DFlash at block 16, not reach 5x.

Codex's review of e7a7dff is still running; I'll check its comments before approving.

@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: e7a7dffaa3

ℹ️ 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 +94 to +96
- (1) Operator accuracy: on held-out exact changes the median relative error
||W (I - U U^T) dx|| / ||W dx|| over operator inputs is 0.76-0.90 at rank 16, 0.64-0.81 at
rank 128 and 0.51-0.73 at rank 512 (by operator class); on the development blocks themselves

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 Include every projection in the operator-error metric

For the multi-projection groups named here, the measurement that populated this range evaluates only ctl.groups[key][0].weight; it therefore covers q/qkv but omits the other attention/GDN projections, and covers gate_proj but omits up_proj. Because this is a W-weighted residual, projections sharing the same input and basis can have different relative errors, so these ranges do not establish the operator-accuracy claim for every repaired operator. Record errors for each module or explicitly scope the conclusion to the sampled projections.

Useful? React with 👍 / 👎.

Comment thread evidence/repair/README.md
Comment on lines +105 to +107
drafts after 0 sweeps and 4.33-4.44 after 4 sweeps at every rank, while exact Jacobi from the
same anchor accepts 2.98 (y0), 4.33, 5.35, 6.38, 7.34 and 8.30 after 0-5 exact passes: about one
token per exact sweep, which also bounds any faithful cheap evaluator.

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 Stop treating exact Jacobi progress as an upper bound

Exact Jacobi is one candidate-generation trajectory, not an optimization over audited candidates, so its accepted length cannot bound an approximate evaluator: if an approximation chooses a different token, that error can coincidentally produce a longer correct prefix when audited. The new JSON likewise labels these rows exact_jacobi_ceiling, but the measurements only show the progress of exact Jacobi itself; use them as a reference rather than support for rejecting every faithful cheap evaluator.

Useful? React with 👍 / 👎.

- README: quote the pre-registered Stage B criteria, say the compact-drafter
  control and novelty ablation were not run and why (0.11 drafts gained over
  no repair), say which positions have R_i < 1 (the same 43 high-margin
  positions at every rank), and that the exact-Jacobi line charges sweeps only
  their bytes.
- Stage A: the ceiling's audit includes the per-position state writes; an
  audit 2.33 ms cheaper (5.2% of V(256)) would reach the target, so P3's Stage A
  verdict holds for SGLang's current verifier only (stage_a.py reports
  audit_saving_needed_for_target_us). Stage B refutes P3 independently.
- serve_probe.py: use bench.hostload, which replaced bench.server's sampler.
- runs/decomposition.sh: time the Triton GDN verify kernel and give the DFlash
  baseline the same verifier.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Re-reviewed head c8e91f5 (one commit on e7a7dff). B1 and both suggestions are addressed, and the new Stage A qualification is correct. Codex's two P2 comments on e7a7dff arrived after my first review; one is unaddressed and the other needs one word changed.

Earlier items

  • B1 (fixed). The README quotes the pre-registered Stage B criteria and says the compact-drafter control and the novelty ablation were not run, and why.
  • Suggestions (taken). The README now says that the R_i < 1 positions are the same 43 of 962 at every rank, including rank 0 (large exact margins, median 12 logits), and that the repair does not earn those certificates. It gives distance-0 agreement as 9/80 at ranks 0-256 and 11/80 at rank 512. The exact-Jacobi line now names its byte-only sweep cost.

Stage A qualification (new in this commit, checked)

  • The numbers. I recomputed them from stage_a_oracle.csv.
    • Ceiling denominator at B = 256: 2,197.5 (weights at 3.827 TB/s) + 263.9 (anchor cache) + 44,824 + 144.2 = 47,430 us, which gives 5.24x in decode.
    • The target's budget is 248,721 / 5.5146 = 45,102 us, so audit_saving_needed_for_target_us = 2,328, or 5.2% of V(256).
    • Removing the 4,295 us byte bound gives 5.77x in decode, which is 5.20x end to end.
    • Rerunning stage_a.py reproduces the CSV and JSON exactly; only the new column was added.
  • My error on Repair oracles: Stage A refutes P3's two-pass design; recycling does not help DFlash #56. The README now says P3 is "refuted for this verifier". That is right, and it corrects something I missed when I approved Repair oracles: Stage A refutes P3's two-pass design; recycling does not help DFlash #56. My B1 there showed that the verdict does not depend on how the anchor pass's state writes split. I did not consider an audit pass without per-position state writes on top of the weight-floor anchor. In that case the ceiling clears 5x if the writes cost more than 5.2% of V(256), well under their 9.6% byte bound. Stating that the no-state verify decides it, that DFlash would get the same verifier, and that Stage B refutes P3 independently of the verifier is the right resolution.
  • Code changes. The serve_probe.py switch to bench.hostload follows main's sampler change. decomposition.sh adds the Triton verify kernel and a DFlash-16 baseline with it. Pre-commit passes.

Blocking

C1. Codex P2: the operator-error ranges cover only the first projection of each group (evidence/repair/README.md:110; experiments/repair/residual_eval.py:515).

  • The code uses w = ctl.groups[key][0].weight. For GDN layers the 'mix' group is [in_proj_qkv, in_proj_z, in_proj_a, in_proj_b]; for attention layers it is [q_proj, k_proj, v_proj]; and 'mlp' is [gate_proj, up_proj].
  • So the 0.76-0.90 / 0.64-0.81 / 0.51-0.73 ranges cover in_proj_qkv or q_proj, gate_proj, out_proj/o_proj, down_proj and the head. They do not cover z, a, b, k, v or up.
  • The text says "every linear operator ... is repaired" and that the error is "by operator class". A W-weighted residual can differ between projections that share a basis.
  • Fix: scope the sentence to the projections measured. Alternatively, record all modules: the raw replays are in ~/vp-data, but this needs a rerun of the operator-local step.

C2. Codex P2: "perfect" should be "faithful" (README, the exact-Jacobi gate line).

  • "Even a perfect cheap evaluator would at best match DFlash" is true for a faithful evaluator, one that reproduces the exact Jacobi map.
  • As Sam's critique notes, a non-faithful map can jump ahead, so exact-Jacobi progress does not bound it. Line 126 already says "faithful".
  • Fix: use "faithful" in the gate line too. In p3_gate_b16.json, describe the exact_jacobi_ceiling rows as the faithful-evaluator reference, in the README or the kind field. The measured anchored evaluator stays at 0.28 regardless.

… Jacobi as the faithful-evaluator reference
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Re-reviewed head 29f0d4f (one commit on c8e91f5). Both remaining Codex items are fixed.

  • C1 (fixed). The operator-error sentence now names the projections it scores: in_proj_qkv or q_proj, out_proj or o_proj, gate_proj, down_proj and the head. It also says that z, a, b, k, v and up share those inputs and bases but are not scored themselves. No number changed.
  • C2 (fixed). The gate line now says "faithful cheap evaluator" and defines it. It adds that a non-faithful map could jump ahead, which would be better drafting rather than repair, and that this evaluator does not. p3_gate.py labels the rows exact_jacobi_faithful_reference. Rerunning it reproduces the regenerated p3_gate_b16.json exactly (label and comment only).
  • Earlier rounds. B1 and the suggestions are fixed. I reproduced the Stage A qualification ("refuted for this verifier", 2.33 ms / 5.2% of V(256), 5.20x) from stage_a.py, and residual_eval_b16.json and its CSV reproduce byte for byte from the raw output.
  • Merging. A test merge into current main (feba087) is clean. After it, pre-commit run mypy --all-files passes: this PR's serve_probe.py change fixes the 2 mypy errors that main has had since Tune the plain, MTP and DFlash baselines and define the tuned arms #57 removed bench.server.foreign_cpu.
  • Codex. All four comments are addressed.

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