Skip to content

Appendix D: cache-level checks of the stock divergences (tap v4, #118) - #121

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

SamMausberg merged 4 commits into
mainfrom
paper/appendix-v4cache

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

Folds the cache-level checks merged in #118 into Appendix D and narrows the pending entries they settle. Every number is from the committed evidence/state_safety/ files (cachecheck_v4_*.json, history_v4_*.json, repeats_v4_h44_*.json, pools.json) or the merged README section "Cache-level checks (tap v4)".

What the appendix now says

  • Method (D.4, "Locating the first difference"). A later tap version also hashes the caches each forward reads: the attention KV at every cached position, and the GDN convolution window and recurrent state. The comparison skips a prefill with no cached prefix, because the engine clears a fresh slot inside the forward after the tap has hashed the previous owner's leftover state. The checks were run at batch 1 for four comparisons: plain vs MTP, the two history pairs, prefix cache on vs off, and one prompt's same-server repeats. For the concurrency pair the check stays pending. The cache-hashing tap matches untapped runs on 35 of 40 prompts, and the five it changes are the same five as before. The untapped server's pools still differ (159,324 vs 97,672 tokens), so the tap is still not blamed.

  • Plain vs MTP-3 (D.4 findings, Figure 5 caption). On 40 of the 167 prompts:

    • every cache entering every forward is identical up to layer 0's GDN recurrence at output index 1;
    • the first cache to differ is layer 0's recurrent state, which that kernel writes.

    So the decode and target-verify kernels produce different bits from identical inputs and state. The concurrency pair keeps "first differing module outputs only; caches pending".

  • History pairs at KV level (D.4). mt_bench-0056 and humaneval-0008 were each served alone and after their predecessor, on fresh servers whose pools are within 30 tokens of each other.

    • The first differing output is layer 3's attention at output index 2.
    • The caches entering decode step 1 are identical.
    • The K and V of all 8 attention layers entering step 2 differ only at cached positions 3-5 (6 shared tokens) and 3-21 (22 shared tokens). Positions 0-2 are equal.

    This confirms the repoint at cache level for these two prompts. The other four tap-changed prompts keep their pending cache check.

  • Second history route (new paragraph, D.4).

    • humaneval-0044, served five times on one server: with a flush between requests, 4 of 4 repeats are bitwise identical. Without a flush, the second request (a full 128-token prefill) differs from prompt position 1 at layer 0's GDN recurrence, with the same tokens. The third to fifth reuse a 64-token prefix, differ from position 64 and change tokens (tokens_equal is false in repeats_v4_h44_noflush.json).
    • Prefix cache on vs off, plain, 40 prompts, on two servers with different pools (159,324 vs 447,027 tokens; 199 vs 16 slots): the 34 prompts of at most 63 tokens are identical throughout. The 6 longer prompts differ from prompt position 1 at the recurrence, with log-probabilities differing from output index 0. Two of them change a token, each at an exact BF16 tie in one run.
    • The checkpoint-tracking cause is labelled as code reading, not verified. The paragraph also states the consequence: a prefix-cache-off control differs from the first output token for prompts over 64 tokens.
  • Pinned same-server repeats (D.4). The untested working explanation now names both routes: a different copy of a shared prefix, or a recurrent prefill that depends on what the cache holds. It stays labelled as not checked.

  • D.5 (first-cycle test).

    • Adds the declared void rule from State safety: implement the declared first-cycle analysis (before its data exists) #116: runs failing the provenance, completeness or configuration checks are void, so is an analysis with every prompt excluded, and a void result reports no statistic.
    • Adds one measured fact: for three steps at batch 1, the caches entering the first verify forward, recurrent state included, equal those entering plain decoding's first decode step on 40 prompts. Five steps and the tree were not checked.
  • Register.

    • New entry state-cache (E26) lists the six summaries and the README. Its producer is mechanism.py from the sessions of run_tap_v4.sh; the README records that the run used a copy of that script.
    • D11 state-mech narrows to: the concurrency pair's caches, the four tap-changed prompts the history test does not reproduce, whether the pools contributed after the first plain-vs-MTP difference, the MTP prefix-cache-off control, and the remaining pinned pairs.
    • D13 state-firstcycle names evidence/state_safety/first_cycle_fresh.json, the file first_cycle.py writes, and mentions the void outcome. Its marker stays pending, since the runs are still queued.

Not changed

The main text. contract.tex (Section 2.5) still says "Whether the caches entering those kernels agree is [pending D11]", which is now settled for the plain-vs-MTP recurrence. I tried narrowing it here, but the main text then ran four lines onto p11 (p10 has no slack), so the change needs a compensating cut. I've left it to the author and flagged it to main.

Checks

  • latexmk -pdf: 0 warnings, 79 pages (78 before), main text ends on p10 and References start on p11.
  • scripts/check_paper_references.py: clean (all register paths exist at origin/main).
  • I read every changed page in the rendered PDF (pp. 39-44, 70, 74-75).
  • The host-identity hook passes.

Fold in the cache-hashing tap's results from evidence/state_safety
(cachecheck_v4_*, history_v4_*, repeats_v4_h44_*):

- plain vs MTP with three steps (40 prompts): every cache entering every
  forward is identical up to layer 0's GDN recurrence at output index 1,
  and the first cache to differ is the recurrent state that kernel writes;
- the two history pairs: KV of all 8 attention layers entering decode
  step 2 differs only at the shared positions 3-5 and 3-21, confirming the
  repoint at cache level;
- a second history route through the recurrent prefill (humaneval-0044
  repeats with and without a flush; prefix cache on vs off differs from
  prompt position 1 for the 6 prompts longer than 64 tokens);
- the cache-hashing tap changes the same five prompts as the earlier one.

New register entry state-cache. D11 (state-mech) narrows to the
concurrency pair, the four tap-changed prompts the history test does not
reproduce, the pools after the first plain-vs-MTP difference, the MTP
prefix-cache-off history control and the remaining pinned pairs. D13
(state-firstcycle) now names first_cycle_fresh.json and the declared void
rule; D.5 notes that the state handed to the first verify forward was
already checked for three steps at batch 1.
@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-01T14:56:15.226977Z 90f5fd1 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: APPROVE (provisional: I still have to rebuild the PDF in place and run check_paper_references.py, which I'll do once bench's timed hold ends and the CPU is free. I will confirm or withdraw then.)

Review of the exact head 73b2960: two commits, the Appendix D and register changes (14355e5) and the rebuilt PDF (73b2960). Main text unchanged.

Every new number checked against the committed evidence (#118)

  • Tap neutrality. In both cachecheck_v4_*.json files, tap_check gives 35 of 40 bitwise equal. The mismatched IDs are the same five as in v3's tap_check.json. In pools.json, the v4 tapped plain server has 159,324 tokens.
  • Plain vs MTP-3, 40 prompts.
    • First difference at layer 0 gdn_core, output index 1, DECODE vs TARGET_VERIFY, in 40 of 40.
    • origin: module in 40, and first_cache_difference: ssm layer 0 in 40.
    • The D.5 sentence follows: the caches entering the first verify forward are identical, recurrent state included.
  • History pairs.
    • Pools differ by 30 tokens (159,313 vs 159,343) and 12 tokens (159,347 vs 159,359), with 199 slots each.
    • Layer 3 attention at output index 2, with origin cache.
    • kv_k from position 3: 3 positions for mt_bench-0056 (3-5) and 19 for humaneval-0008 (3-21).
    • caches_differing is 16, i.e. 8 layers × K and V.
  • humaneval-0044 repeats.
    • With a flush, r1-r4 are bitwise equal.
    • Without a flush, r1 differs from position 1 with 128 tokens and keeps its tokens; r2-r4 differ from position 64, prefill 64 tokens and change tokens.
  • Prefix cache on vs off.
    • Pools are 159,324 vs 447,027 tokens and 199 vs 16 slots.
    • The 34 prompts of up to 63 tokens have origin none. The 6 prompts of 67-353 tokens differ at gdn_core, prompt position 1, EXTEND vs EXTEND, with the first logprob difference at 0.
    • Two of them change a token, classed rounding_flip and accumulator_ambiguous. By mechanism.py's definitions both mean a BF16 tie in one run, so "each at an exact BF16 tie in one run" is right.
  • The four other tap-changed prompts. Keeping the KV-copy route as "likely" is consistent with tap_signature.json: there the first differences are at layer 3's attention at output index 2 in decode. The prefill route would show at a prompt position.
  • Register.
    • E26's six files, mechanism.py, run_tap_v4.sh and tap_runs.py exist on main.
    • D11 now drops mt_bench-0056 (confirmed) and keeps the other four.
    • D13 now names first_cycle_fresh.json. It is a \devitem, which the reference check does not require to exist.
  • Committed PDF. It has 79 pages, with References starting on p11 and the new text rendered.
  • Codex finished on 73b2960 with no findings (summary plus a thumbs-up).
  • Checks. Both commits are by Samuel Mausberg, with no AI lines. The hostname check is clean over the diff, the PR text and the PDF text.

Main text. contract.tex says "Whether the caches entering those kernels agree is [pending D11]". That is still true as a whole, because the concurrency pair's caches remain under D11. So leaving the main text alone does not create a contradiction. Narrowing it is a later edit for the author.

Suggestions (non-blocking)

  1. The other 127 plain-vs-MTP prompts. Only 40 of the 167 were cache-checked. The text says so, but D11 no longer lists the remaining 127. Adding them to D11 keeps the pending list complete.
  2. Pool numbers by tap version. In "Findings", "The two tapped servers had different pools (159,322 against 166,522 ...)" now follows the sentence about the v4 rerun, but those are the v3 servers' pools. The v4 pair had 159,324 against 166,481 tokens and 199 against 97 slots. Naming the version, or giving both, would avoid misattribution.
  3. Generalizing from six prompts. "A prefix-cache-off control differs from the prefix-cache-on run from the first output token for prompts longer than 64 tokens" rests on 6 of 6 tested prompts. "Did so for all 6 such prompts tested" keeps it within the evidence.
  4. An observation, not a request. All five tap-changed prompts are longer than 64 tokens (67, 68, 216, 225, 353). In this 40-prompt set the only other prompt over 64 tokens is alpaca_eval-0180. That may help narrow "what decides which copy a decode step reads", for example through a longer prefill shifting the timing of the repoint relative to the queued decode step. This is speculation and needs no text now.

…ix-off claim to the 6 prompts tested

Reviewer suggestions on #121: give the cache-hashing rerun's pools
(159,324 vs 166,481 tokens) beside the first analysis's; say that all 6
prompts over 64 tokens tested differed from the first output token rather
than stating it for every such prompt; list the 127 plain-vs-MTP prompts
not rerun with the cache-hashing tap under D11.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional, on 90f5fd1: Codex's last review is of 73b2960. I've requested a review of this head and will confirm or withdraw once it finishes.)

Re-review on 90f5fd1: 4ff5bc0 (source) plus the rebuilt PDF.

  • The source changes are my suggestions 1-3, and they are accurate.
    • D11 now lists the 127 plain-vs-MTP prompts not rerun with the cache-hashing tap.
    • The "Findings" sentence names the 167-prompt analysis's pools (159,322 vs 166,522 tokens, 199 vs 97 slots) and gives the rerun's beside them: 159,324 vs 166,481 and 199 vs 97, matching pools.json.
    • The radix-off sentence is now scoped to "as all 6 such prompts tested did".
  • Rebuild in place. I ran latexmk -g on one core with no exclusive hold running. It finished with 0 warnings, wrote 79 pages, and its text is identical to the committed paper.pdf (pdftotext -layout, diff empty). References start on p11. The committed PDF is restored and the tree is clean.
  • scripts/check_paper_references.py passes, with all register paths present at origin/main.
  • Checks. Both new commits are by Samuel Mausberg, with no AI lines. The hostname check is clean over the diff and the PDF text.

@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: 90f5fd167c

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