Repository navigation
Exact witnesses for the P4 and P5 state-structure analyses - #20
Conversation
The P4 (minimal recurrent state) and P5 (sharing across requests) analyses rest on small counterexamples that were run outside this repository. tests/test_state_structure.py reproduces nine of them in exact rational arithmetic, or with NumPy float32 where the point is rounding: a query-invisible state difference that becomes visible after one gated-delta step (-3/25), coordinate-key writes reaching any matrix, the transition determinant (contraction, not erasure), non-commuting transitions, SiLU raising a rank-one matrix to rank two, one step taking identical states to batch rank four, RMSNorm defeating the output projection's null space, a one-ulp FP32 lazy-decay discrepancy, and a BF16-rounded rank-one product with exact rank 28. Results and the command are in evidence/state_structure/.
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. |
|
Verdict: REQUEST CHANGES Reviewed at What I ran and checked
Blocking
Suggestions (non-blocking)
|
The one-ulp lazy-decay discrepancy depends on IEEE binary32 round to nearest, ties to even without FMA contraction; the test comment and the README now say so. The BF16 witness asserts the exact rank 28, the RMSNorm witness notes it has no epsilon or weight, and the JSON records the repository commit.
|
Verdict: APPROVE Re-reviewed at The optional items are done too:
At this commit, 9 tests pass and the hooks, including mypy, pass on the changed files. |
…witnesses PR #20 is merged, so the state-structure witnesses are cited as committed evidence. The Amdahl example for state write avoidance no longer quotes the unmerged 42% time share; it gives the formula, a byte-derived share labelled as such, and leaves the measured share pending. The sampling section states the adopted contract: fixed-noise verification with the stock seeded sampler's keyed noise, which keeps point-mass acceptance equal to stock and seeded outputs token-identical to non-speculative decoding. Top-p falls back, and the partition-bracket guards are marked as analysis rather than built.
The P4 (minimal recurrent state) and P5 (sharing computation across requests) analyses in
~/vp-coord/PROPOSALS.mdrest on small counterexamples that were run in a sandbox outside this repository. Before the paper cites them, this PR reproduces them as exact tests.What changed
tests/test_state_structure.pyhas nine test methods. Each checks one witness in exact rational arithmetic (Fraction), or with NumPy float32 where the point is rounding. The Gated DeltaNet step isS' = S alpha (I - beta k k^T) + beta v k^T.alpha = beta = 1/2,k = (3/5, 4/5),q = e1and a state difference alonge2:q . ds = 0, butq^T A ds = -3/25.det A = alpha^d (1 - beta ||k||^2), which is243/1000for the chosen values.SiLU(log 2 [[1, 2], [2, 4]])has determinant-64/1275 log^2 2, so rank one becomes rank two.W_o = [1, 0]cannot distinguish project to1and1/5after RMSNorm.fl(fl(a1 x) a2)andfl(fl(a1 a2) x)differ by one ulp fora1 = a2 = 0.9,x = 1.3.evidence/state_structure/holds the JSON report, the log and a README with the command and what each witness shows.Scope
These witnesses show that particular shortcuts are not valid in general. They are not measurements of Qwen3.5-4B states. The GPU experiment for P4 (bit-exact live replay at batch 128) belongs to the moonshot workstream, and the P5 ceiling belongs to profile.
Validation
python tests/test_state_structure.py: 9 of 9 pass in under 0.1 s.python -m pytest tests/test_state_structure.py: 9 passed.pre-commit run --fileson the changed files passes. The hooks cover ruff, mypy and codespell;evidence/is excluded from the hooks.