Repository navigation
State: plain-decoding switches, second MTP session, aborts, repeats, chunked prefill and the concurrency-pair cache check - #175
Conversation
…check results Evidence regenerated by STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.sh at fc47cf6 (no code change): the pinned plain-decoding runs with the radix cache off, the overlap scheduler off, deterministic inference and the FP32 head, a second MTP steps 3 session, the abort, repeat and chunked-prefill targeted tests, and the plain radix-off cross-check against bench's run. Every value already committed reproduces; missing_pairs drops from 30 to 12. The concurrency-pair cache check (run_tap_v4_batch.sh at be00c17) adds its summary unchanged. No state error: every divergence is a tie, one BF16 step or near (at most 0.375 nats), and no run committed a token that was not its own top-1. The chunked-prefill comparison's largest prompt-position drifts (up to 5.22 nats) are reported and left uninterpreted pending an alignment check.
|
@codex review |
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: 01a3c83100
ℹ️ 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".
| differences of this kind are what the batch shape alone gives. So for MTP the test | ||
| finds no large divergence and no non-argmax token, but it cannot separate a near-tie | ||
| effect of the aborts from the batch shape. It compares tokens, not logprobs. |
There was a problem hiding this comment.
Account for radix history in the abort interpretation
For the radix-on MTP arm, batch shape is not the only uncontrolled variable: run_abort serves all references consecutively after one flush (targeted.py:364-367), then flushes and interleaves probes with different victim requests (targeted.py:373-393). Given the radix-history dependence documented above, a reference and its probe can therefore differ because of prior-request history even when abort cleanup is correct. The result cannot be narrowed to abort effects versus batch shape alone; either reproduce equivalent histories or disclose this third confound.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Fixed in 3cc687c: the abort bullet now names the request history as a third possible cause for the radix-on arm (references served one after another after one flush, each probe after other probes and aborted requests), notes that the radix-off arms keep no radix tree, and narrows the MTP conclusion accordingly: no large divergence and no non-argmax token, but no separation of an abort effect from batch shape or, with the radix cache on, from history.
| for chunk 200. The first four positions | ||
| after a boundary have mean drift 0.05 to 0.08 nats, like the rest of their chunk. |
There was a problem hiding this comment.
Recompute boundary drift without first-chunk positions
compare_prefill.py:51-56 puts every prompt position into an offset bucket using i % chunk without excluding i < chunk, so offsets 1-3 include the initial positions of all 40 prompts—not only positions after a chunk boundary. Those first-chunk samples comprise 40/152 observations for chunk 256 and 40/186 for chunk 200, meaning the reported means do not support the stated boundary-local conclusion. Filter offset statistics to i >= chunk or report first-chunk positions separately before concluding that handoff positions drift no more than the rest.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, that was a bug in compare_prefill.py's bucketing. Fixed in 644cd38: offset buckets now hold only positions in chunks 1 and later (renamed prompt_drift_by_offset_after_boundary; the first chunk stays under prompt_drift_by_chunk), with a test. targeted.json regenerated in 3cc687c (only those buckets changed, checked). The README now gives the boundary-only means per offset (0.072-0.091 nats for chunk 256, 0.062-0.095 for chunk 200) and, in ae4a4c1, compares them with offsets 4 and later (0.077-0.082 and 0.077-0.080) as an observation, not a test. ae4a4c1 also adds an alignment check for the largest drifts (none matches a shifted position).
compare_prefill.py put every prompt position into an offset bucket by i % chunk, so offsets 1-3 also held the first positions of every prompt, which follow no boundary. The offset buckets now hold only positions in chunks 1 and later (prompt_drift_by_offset_after_boundary); the first chunk is reported under prompt_drift_by_chunk as before. A non-positive --chunk is refused. New test on synthetic prompts. Raised by Codex on #175.
… the abort confounds summarize_targeted.py at the previous commit. Only the chunked-prefill offset buckets change (checked: every other value is identical). The README gives the boundary-only means, and for the radix-on abort arm names the request history as a third possible cause besides the aborts and the batch shape (Codex on #175).
compare_prefill.py now reports, for the 40 largest prompt-position drifts, whether the chunked run's top-k list matches the unchunked run's list at another position within 16 (at least 4 shared tokens, every shared logprob within 0.1 nats), which an off-by-s artefact in the returned input logprobs would produce, and how many tokens the two lists share at the same position. The drift statistics also count positions above 1 nat. Exploratory, added after the large drifts were seen; tests on synthetic lists.
…prefill result summarize_targeted.py at the previous commit; the chunked-prefill comparisons gain alignment_check and over_1_nat, and every other value is unchanged (checked). None of the 40 largest drifts in either chunked run matches the unchunked list at another position, and drifts above 1 nat occur in the first chunk too, where no state passes between chunks. The README reports this and leaves the sensitivity itself unexplained.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ae4a4c147f
ℹ️ 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".
| overlap scheduler). Each of 4 lanes starts a thinking-mode request with up to 1,024 | ||
| tokens, aborts it mid-stream (after a seeded random target of 1 to 60 tokens; 3 to 62 | ||
| were streamed), and then serves the next of 40 probe prompts (the first 40 | ||
| non-thinking prompts, 160 tokens), which takes the freed slot while the other lanes | ||
| keep running. Each probe is compared, in tokens, |
There was a problem hiding this comment.
Synchronize the abort lanes before claiming slot reuse
The test does not establish that these probes actually reuse an aborted request's slot. In run_abort (targeted.py:373-395), the four lanes have no barrier before their first abort or between iterations; a fast lane can abort before every victim has been admitted, and near the end other lanes can exit before the final probe starts. A pool capacity of four therefore does not prove that the pool was full at probe admission, so a probe may receive a previously unused slot. Consequently, the 40/40 deterministic result cannot support the stated conclusion that abort cleanup and slot reuse left no trace without synchronizing the lanes or recording the actual slot assignments.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed: the test does not establish slot reuse. Rather than change and rerun it, 567ba9d scopes the claim in both READMEs. The lanes are not synchronized and the test records neither the GDN slot a probe took nor the pool's occupancy at its admission, so it does not show that a probe reused a just-aborted request's slot. Deterministic plain decoding's 40/40 is now read only as: the concurrent aborts, and whatever slots the probes ran on, left no trace in their outputs. It is explicitly not a verified slot-reuse test. The bullet is renamed "Aborts on a small GDN pool", and experiments/state_safety/README.md calls the reuse the design's intent, not a measured condition.
The pending paragraph of evidence/state_safety/README.md keeps #174's first-cycle sentence and this branch's shorter list of queued runs. Two overlong lines in the first-cycle section and the chunked-prefill wording are rewrapped; no number changes.
The abort lanes are not synchronized and the test records neither the GDN slot a probe took nor the pool's occupancy at its admission, so it does not show that a probe reused a just-aborted request's slot. The README now says so, and reads deterministic plain decoding's 40/40 as: the concurrent aborts, and whatever slots the probes ran on, left no trace in their outputs. Raised by Codex on #175.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
|
Verdict: REQUEST CHANGES at 567ba9d One blocking item, a single phrase in the README. Everything else holds; details below. Blocking
Checked at 567ba9dRegenerated evidence against main. I compared leaf by leaf, keyed by pair or comparison name, from a worktree at 567ba9d in a CPU window.
Body numbers against the files.
Wording and scope.
Codex. All three comments were fixed or scoped, with replies. Codex found no major issues on 567ba9d. |
It was added after the large prompt-position drifts were seen; both READMEs now say so. No number changes. Raised by the reviewer on #175.
|
@codex review |
|
Verdict: APPROVE at 90f9e08 567ba9d..90f9e08 is README-only: one commit, two files. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90f9e0853e
ℹ️ 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 i >= chunk: | ||
| by_offset.setdefault(_bucket(i % chunk), []).append(dr) | ||
| by_chunk.setdefault('chunk 0' if i < chunk else 'chunk 1+', []).append(dr) |
There was a problem hiding this comment.
Shift boundary buckets to the producing token
When analyzing boundary-local drift, input_top_logprobs[i] is the distribution predicting input token i (as documented in experiments/moonshot/logit_probe.py:136-138), so it was produced while processing token i - 1. Bucketing on i % chunk therefore labels i == chunk as offset 0 after the boundary even though that distribution came from the final token of the preceding chunk; the first distribution affected by processing a token after the handoff is at i == chunk + 1. This shifts every reported boundary offset and misclassifies one observation per boundary between chunk 0 and chunk 1+, so the README's claims about the first positions after a boundary are based on the wrong positions; bucket using i - 1 (and treat post-boundary entries accordingly).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. Fixed in b37ddcb: compare_prefill.py now assigns each prompt position to the chunk and offset of the token whose forward produced its distribution ((i - 1) // C and (i - 1) % C; position 0 has none), so position i == C belongs to chunk 0. Tests updated, plus one for the position at a boundary (17 passed). targeted.json regenerated in dcd0821: only the drift buckets change; the alignment check, the generation comparison and the total of positions above 1 nat are identical (checked). The stated counts do not change (13 and 1 positions above 1 nat produced in the first chunk; 94 and 90 in all). One range moves: the chunk-256 per-offset means at offsets 0-3 are now 0.072-0.093 (was 0.072-0.091). Both READMEs now say how positions are assigned, and the exploratory label stays.
The top-k list at prompt position i is the distribution for token i, computed in the forward of token i - 1, so position i == chunk was labelled offset 0 after the boundary although its distribution came from the last token of the preceding chunk. Positions are now assigned to the chunk and offset of the producing token ((i - 1) // C, (i - 1) % C; position 0 has none). Tests updated, plus one for the position at a boundary. Raised by Codex on #175.
…ADME counts summarize_targeted.py at the previous commit. Only the chunked-prefill drift buckets change (checked: alignment check, generation and every other entry are identical, and the total of positions above 1 nat is unchanged). Both READMEs state how positions are assigned to chunks, and the evidence README's before/after means, percentiles, first-chunk counts and per-offset means are filled from the regenerated file.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 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". |
|
Verdict: APPROVE at dcd0821 90f9e08..dcd0821 fixes Codex 4162785671, the producing-token bucketing, which has a reply.
Codex found no major issues on dcd0821. Everything I checked at 567ba9d and 90f9e08 stands. |
State #175: the concurrency pair's cache check, plain-decoding switches and targeted tests (App D, notes)
Results of the state runs that finished between 2026-10-01 20:29 and 2026-10-02 00:26 UTC, other than the first-cycle test (#174): the plain-decoding configuration switches, a second MTP steps 3 session, the aborts, run-to-run repeats and chunked-prefill targeted tests, and the cache-level check for the concurrency pair. No state error was found. Every token divergence is at an exact BF16 tie, within one BF16 step, or
near(margins at most 0.375 nats), and no run committed a token that was not its own top-1.What ran, and whether it is valid
a493cbf(runner files equal to main's), clean pinbd66ce343erun_targeted.sh)be00c17clean, tap engine9341fb82KV provenance: the matrix runs have the radix cache on (except the radix-off configurations), flushed before every pass and with the prompts in the same order, so c1 passes have identical request histories; c32 passes interleave by timing. The targeted tests flush before every request. The cache-check sessions both serve all 320 prompts in the same order.
Results (all in
evidence/state_safety/README.md)mlp.down_projin a batched prefill 5). The 5 attention cases have identical entering KV, so FlashInfer decode attention itself differs with the batch;mt_bench-0056, the sixth v3 attention case, now first differs at a gated norm at index 29, with identical request histories in both sessions.Review fixes
compare_prefill.pyput the first chunk's positions into offset buckets 1-3. Fixed (644cd38, with a test): offset buckets hold only positions after a boundary (prompt_drift_by_offset_after_boundary);targeted.jsonregenerated (3cc687c), only those buckets changed.targeted.jsonregenerated (dcd0821), only the buckets change; stated counts unchanged, the chunk-256 offset 0-3 range moves from 0.072-0.091 to 0.072-0.093.compare_prefill.pyreports, for the 40 largest drifts, whether the chunked top-5 list matches the unchunked list at another position within 16 (at least 4 shared tokens, all within 0.1 nats), and counts positions above 1 nat. Added after the drifts were seen, so it is exploratory; tests on synthetic lists. Regeneratedtargeted.jsonchanges only by the new keys (checked).Files
Regenerated by
STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.shatfc47cf6:noise_floor_pinned.{json,csv},divergences_pinned.csv,run_meta_pinned.json,perturbation_pinned.json,pools.json,cross_bench.json,targeted.json. Every value already on main reproduces unchanged; the changes are new pairs and rows,missing_pairs30 -> 12 (logprobs off, retraction, FlashInfer GDN decode and ReplaySSM, still queued) and the new cross-bench plain pair.cachecheck_v4_plain_c1_vs_c32.jsonis the summaryrun_tap_v4_batch.shwrote in its hold, copied unchanged.first_cycle_fresh.json, whichanalyze_all.shalso writes, is in #174, not here. The only code change iscompare_prefill.py(review fixes below), after whichtargeted.jsonwas regenerated withsummarize_targeted.py(the lineanalyze_all.shruns).Checks
pytest tests/test_state_safety_compare_prefill.py tests/test_state_safety_compare.py(16 passed) andpre-commit run --fileson every changed file in main's CPU window; host-identity check on the evidence.self_review.mdgone through: numbers recomputed from the committed files.Still queued (FIFO, from
~/vp-wt/state): the logprobs-off and retraction runs, and the FlashInfer GDN decode and ReplaySSM paths; they will come in a follow-up PR.