Skip to content

State: plain-decoding switches, second MTP session, aborts, repeats, chunked prefill and the concurrency-pair cache check - #175

Merged
SamMausberg merged 10 commits into
mainfrom
state/plain-switches-targeted
Oct 2, 2026
Merged

SamMausberg merged 10 commits into
mainfrom
state/plain-switches-targeted

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

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

Runs When (UTC) Commit, engine Valid
Plain decoding with radix off, overlap off, deterministic inference, FP32 head; c1 and c32 on one server each, pinned pools 10-01 20:55-21:20 a493cbf (runner files equal to main's), clean pin bd66ce343e yes: pools resolved to the pin in every run, 320/320 records
Second MTP steps 3 session, c1 and c32, pinned 10-02 00:22-00:26 same yes
Aborts with GDN slot reuse (3 configurations), repeats (plain, MTP steps 3) 10-01 20:29-20:39 same yes; same-server comparisons, so pools need not be pinned (cap 4 or 16 as declared in run_targeted.sh)
Chunked prefill (default, 256, 200), MTP steps 3 10-02 00:18-00:21 same yes (see the open item below)
Cache-level check, plain c1 vs c32, tap v4, pinned cap 16 10-01 23:14-23:37 be00c17 clean, tap engine 9341fb82 yes: both servers resolved to the pins, tap-neutral on 40/40

KV 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)

  • Plain-decoding switches. Radix off and overlap off change plain decoding as often as MTP against the stock configuration (c1: 96 vs 98 and 166 vs 161 of 320), so neither effect is specific to speculation. Both change the prefill of prompts longer than 64 tokens in plain decoding exactly as in MTP (192/193 vs 0/127 at output index 0). The later parting of overlap off and radix off at output index 1 happens in plain decoding too (176 prompts at its first decode step), so it is not the synchronous speculative path.
  • Radix-off noise floor: plain c1 vs c32 at cap 8 without the radix cache, 33/320 diverge (0.50 per 1,000), 258 bitwise identical. Speculation against plain decoding without the radix cache: 177 and 178 of 320 (3.95 and 3.90 per 1,000), as with it (171, 181).
  • Deterministic inference makes plain decoding batch-invariant on the full set (c1 vs c32 bitwise identical, 320/320) but not MTP (168/320), and deterministic MTP departs from deterministic plain decoding in 175/168 of 320, first at output index 1 in 315.
  • FP32 head: plain c1 vs c32 24/320 (0.36 per 1,000, margins at most 0.17 nats); MTP vs plain 136/138 of 320. The FP32 head removes ties, not divergences, in plain decoding as in MTP.
  • Pools at batch 1, radix off: the pinned plain radix-off c1 run is bitwise identical to bench's unpinned one (320/320), completing the MTP check from State safety: pinned MTP switch pairs, checkpoint reuse and the MTP radix-off history control #147.
  • Second MTP session: bitwise identical to the first at c1 and at c32 (320/320 each).
  • Divergence given perturbation: the radix-off floor's share diverging in onset bucket 0-31 is 28/50 (0.56), like the other floors and every speculative pair (0.51-0.57); no excess of speculation over any of the three floors is detected, with wide floor intervals.
  • Aborts on a small GDN pool: deterministic plain decoding keeps 40/40 probes token-identical under concurrent aborts; MTP steps 3 28/40 with radix off and 28/40 with radix on, the rest at exact ties or one step, which the batch shape (and, radix on, the request history) alone can give for MTP. The test compares tokens only. It does not record slot assignments or synchronize its lanes, so it is not a verified test of slot reuse.
  • Repeats: 44 prompts x 5 at batch 1 with a flushed cache: 176/176 repeat pairs bitwise identical for plain decoding and for MTP steps 3.
  • Concurrency-pair cache check: in all 40 prompts every cache entering every forward is identical up to the first differing module output (gated norm 30, layer-3 attention 5, layer-0 mlp.down_proj in 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.
  • Chunked prefill: generation from the end of the prompt differs only at ties or one step (20 and 21 of 40 diverge, margins at most 0.25 nats). A few prompt positions drift far more than anything seen in decoding (maximum 3.53 nats with chunk 256 and 5.22 with chunk 200; 94 and 90 of 33,853 positions above 1 nat, 13 and 1 of them in the first chunk, before any boundary). An alignment check (added in this PR, exploratory) finds no shifted match for any of the 40 largest drifts in either run, and the first positions after a boundary do not stand out from later offsets. The sensitivity itself is not explained and is not read as a state error.

Review fixes

  • Codex, abort interpretation (P2): the radix-on arm also has a different request history, now named as a third possible cause; conclusion narrowed (3cc687c).
  • Codex, boundary drift (P2): compare_prefill.py put 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.json regenerated (3cc687c), only those buckets changed.
  • Codex, slot reuse (P2): the abort lanes are unsynchronized and slot assignments are not recorded, so slot reuse is not established. Claims scoped in both READMEs (567ba9d); no rerun.
  • Codex, producing token (P2): position i's distribution is computed by token i - 1, so the drift buckets now use the producing token's chunk and offset (b37ddcb, tests); targeted.json regenerated (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.
  • Reviewer: the alignment check is labelled exploratory, added after the drifts were seen, in both READMEs (90f9e08).
  • Merged main at 9a6e849 (State: the declared first-cycle test is inconclusive (960 fresh prompts) #174) into the branch (d83541e); the shared pending paragraph keeps State: the declared first-cycle test is inconclusive (960 fresh prompts) #174's first-cycle sentence and this branch's shorter queue list.
  • Alignment check (f10be36, ae4a4c1): compare_prefill.py reports, 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. Regenerated targeted.json changes only by the new keys (checked).

Files

Regenerated by STATE_ALLOW_MISSING=1 experiments/state_safety/analyze_all.sh at fc47cf6: 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_pairs 30 -> 12 (logprobs off, retraction, FlashInfer GDN decode and ReplaySSM, still queued) and the new cross-bench plain pair. cachecheck_v4_plain_c1_vs_c32.json is the summary run_tap_v4_batch.sh wrote in its hold, copied unchanged. first_cycle_fresh.json, which analyze_all.sh also writes, is in #174, not here. The only code change is compare_prefill.py (review fixes below), after which targeted.json was regenerated with summarize_targeted.py (the line analyze_all.sh runs).

Checks

pytest tests/test_state_safety_compare_prefill.py tests/test_state_safety_compare.py (16 passed) and pre-commit run --files on every changed file in main's CPU window; host-identity check on the evidence. self_review.md gone 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.

…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.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 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-02T04:39:45.362876Z dcd0821 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: 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".

Comment thread evidence/state_safety/README.md Outdated
Comment on lines +878 to +880
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.

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 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 👍 / 👎.

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.

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.

Comment thread evidence/state_safety/README.md Outdated
Comment on lines +903 to +904
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.

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 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 👍 / 👎.

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.

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.
@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: 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".

Comment thread evidence/state_safety/README.md Outdated
Comment on lines +863 to +867
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,

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 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 👍 / 👎.

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.

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.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 567ba9d8fb

ℹ️ 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: REQUEST CHANGES at 567ba9d

One blocking item, a single phrase in the README. Everything else holds; details below.

Blocking

  1. evidence/state_safety/README.md:1011: the chunked-prefill alignment check is presented as a plain result ("The check for an alignment artefact finds none (alignment_check)"). The PR body says it was added after the drifts were seen and is exploratory (f10be36, ae4a4c1), but neither README says so, and the README is the committed record. Label it there, for example: "An exploratory check, added after these drifts were seen, finds no alignment artefact (alignment_check)". A README-only delta that does this gets an approval from me without a rerun.

Checked at 567ba9d

Regenerated evidence against main. I compared leaf by leaf, keyed by pair or comparison name, from a worktree at 567ba9d in a CPU window.

  • noise_floor_pinned.json and perturbation_pinned.json: outside missing_pairs, 0 changed and 0 missing leaves. missing_pairs drops from 30 to 12, with nothing added.
  • pools.json: all 42 of main's comparisons are present and unchanged, and 19 are added.
  • run_meta_pinned.json and targeted.json: 0 changed, 0 missing.
  • cross_bench.json: only its missing_pairs entry leaves.
  • So "every value already on main reproduces unchanged" holds.

Body numbers against the files.

  • Switches (noise_floor_pinned.csv): radix off at c1, 96 plain against 98 MTP; overlap off, 166 against 161.
  • Radix-off floor: 33/320, 0.498 per 1,000. Speculation against plain without radix: 177 and 178 (3.948, 3.898).
  • Deterministic mode: plain c1 against c32 0/320; MTP 168; deterministic plain against MTP 175/168.
  • FP32 head: 24/320 (0.359 per 1,000, every one near, margins at most 0.166); MTP against plain 136/138.
  • Second MTP session: 0/320 at c1 and c32.
  • Targeted tests (targeted.json):
    • aborts 28, 28 and 40 of 40;
    • repeats 176/176 for plain and MTP, tokens and logprobs bitwise;
    • chunked prefill: maxima 3.532 and 5.222 nats; 13 + 81 = 94 and 1 + 89 = 90 of 33,853 positions above 1 nat; first-chunk maxima 1.596 and 1.656; 0 shifted matches among the 40 largest drifts.
  • Cache check (cachecheck_v4_plain_c1_vs_c32.json): 40 prompts; first differences at gated norms in 30, layers.3.attn in 5 and layers.0.mlp.down_proj in 5; origin module in all 40.

Wording and scope.

Codex. All three comments were fixed or scoped, with replies. Codex found no major issues on 567ba9d. pytest tests/test_state_safety_compare_prefill.py tests/test_state_safety_compare.py: 16 passed. Host identity is clean in the commit log and the body. All 7 commits are Sam's, with no co-author lines.

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.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 90f9e08

567ba9d..90f9e08 is README-only: one commit, two files. evidence/state_safety/README.md:1011 now reads "An exploratory check, added after these drifts were seen, finds no alignment artefact (alignment_check)", and the prefill entry in experiments/state_safety/README.md says the same. No number, evidence file or code changed, so everything I checked at 567ba9d stands (issuecomment-5945328951). Codex found no major issues on 567ba9d, and the delta adds no hostname.

@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: 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".

Comment on lines +63 to +65
if i >= chunk:
by_offset.setdefault(_bucket(i % chunk), []).append(dr)
by_chunk.setdefault('chunk 0' if i < chunk else 'chunk 1+', []).append(dr)

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 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 👍 / 👎.

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.

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.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: dcd08217bb

ℹ️ 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 at dcd0821

90f9e08..dcd0821 fixes Codex 4162785671, the producing-token bucketing, which has a reply.

  • Code (compare_prefill.drift_buckets): prompt position i is now attributed to the chunk and offset of token i - 1, whose forward produced its top-k list: chunk (i - 1) // C, offset (i - 1) % C. A position i == C therefore counts in chunk 0. The docstrings and both READMEs say so, and the tests were updated, with one added for the boundary position.
  • Regenerated targeted.json: every hunk of the diff falls inside prompt_drift_by_offset_after_boundary or prompt_drift_by_chunk of the two compare_prefill__* entries. Nothing else moved: not the alignment check, not the generation comparison, not any other test.
  • README numbers against the new file:
    • chunk 256: offsets 0-3 have means of 0.0906, 0.0716, 0.0841 and 0.0927, so "0.072 to 0.093" holds. Chunk 0 has 10,240 positions with 13 above 1 nat; chunks 1+ have 23,613 with 81; together 33,853 positions and 94 above 1 nat. The maximum is 3.53.
    • chunk 200: offsets 0-3 have means of 0.0793, 0.0954, 0.0623 and 0.0715, so "0.062 to 0.095" holds. Chunk 0 has 8,000 positions with 1 above 1 nat; chunks 1+ have 25,853 with 89; together 33,853 and 90.
    • The exploratory label on the alignment check is kept.

Codex found no major issues on dcd0821. Everything I checked at 567ba9d and 90f9e08 stands.

@SamMausberg
SamMausberg merged commit 13dada4 into main Oct 2, 2026
SamMausberg added a commit that referenced this pull request Oct 2, 2026
State #175: the concurrency pair's cache check, plain-decoding switches and targeted tests (App D, notes)
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