Repository navigation
State safety: H5 truncation and stop tests, radix history dependence - #59
Conversation
analyze_all.sh regenerates the noise floor, rejection-position drift and the targeted summary from the raw runs (it reproduces the committed evidence byte for byte). mechanism.py --repeat-of compares the tapped repeats of one prompt inside a run.
…r figure analyze_all.sh derives evidence/state_safety/first_difference_by_module.csv (pair, module, layer, kind, count) from the mechanism summaries, which now keep every module rather than the top 20.
Every c32 run used --max-running-requests 16, so decode batches had at most 16 rows; the pair labels and the README now say concurrency rather than batch size.
The cache hashing crashed on a layer's SSM state (524,288 elements per slot); rows longer than the coefficient vector are now hashed in chunks.
…ence Truncation and stop tokens at every index inside a verify cycle are bitwise exact for MTP steps 3 and 5 (157/157, 240/240; 160/160, 240/240). A stock reproduction shows that with the radix cache on a request's output depends on which earlier request computed its shared prefix (2 of 12 prompts from output index 2, plain and MTP; 0 of 12 with the radix cache off), through the req_to_token rewrite in cache_unfinished_req. Fresh-server repeats: bitwise at batch 1, 24/320 ties at concurrency 32.
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: e49177dc26
ℹ️ 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".
| runs="$HOME/vp-data/state/runs" | ||
| export OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 | ||
| # shellcheck source=/dev/null | ||
| source "$HOME/verified-progress/scripts/sglang_env.sh" |
There was a problem hiding this comment.
Source the environment from the actual checkout
When this script is run from the documented checkout at /workspace/verified-progress, it exits immediately because $HOME/verified-progress/scripts/sglang_env.sh does not exist. Since here already identifies the script's location, derive the repository root from it and source that checkout's scripts/sglang_env.sh; otherwise the new evidence-regeneration command only works when the repository happens to be cloned under that hard-coded home-directory name.
AGENTS.md reference: AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 395ee94. The script derives the repository root from its own location (repo="$(cd "$here/../.." && pwd)") and sources $repo/scripts/sglang_env.sh, so it works from any checkout.
|
Verdict: REQUEST CHANGES Reviewed head e49177d against main (merge base 9932235). The radix finding is stated well, and the relabelling and the module CSV are correct. Three items block: the H5 configurations, patch 0002's gate, and one Codex comment. Checked and correct
BlockingB1. The H5 claims do not name their configurations (integrator check 2; README "Results so far" and the PR body).
Fix: state all of that next to each count, for example "MTP steps 3, top-1, radix cache on, concurrency 1: 157/157". The radix setting matters here, because the warm/cold extension result depends on it. B2. Patch 0002 has no gate of its own (integrator check 5;
B3. Codex P2:
Suggestions (not blocking)
|
…lyze_all Address review of PR #59: patch 0002 now applies only with SGLANG_STATE_VERIFY_FIXED_SPLIT=1 under deterministic inference (engine README lists every variable); each H5 count states its configuration (MTP steps, top-k 1, radix on, concurrency 1, 40 prompts); the radix code path cites file and line; analyze_all.sh sources the env script from its own repository root.
|
Verdict: APPROVE Re-reviewed head 395ee94 (f37ccdb and 395ee94 on e49177d). All three blocking items and both suggestions are fixed.
|
Figure 5 is now drawn from first_difference_by_module.csv instead of typed counts; the counts are unchanged. Appendix D.4 adds the fresh-server repeats: batch 1 is bitwise reproducible, and at concurrency 32 24 of 320 outputs diverge at ties, 0.35 per 1,000. The tap-changed prompts are now explained by history dependence through the prefix cache, with the deterministic stock reproduction: logprobs change for 2 of 12 prompts with the cache on and none with it off. KV-level confirmation stays pending. Appendix D.5 reports the completed H5 tests. Truncation (157/157, 240/240) and stop tokens at every index of an MTP verify cycle (160/160, 240/240) reproduce the untruncated output bitwise, and warm against cold continuations match except at ties. A new register entry "targeted" covers them; state-targeted narrows to the remaining tests; and the H5 status row is updated.
Appendix D: integrate the state-safety results (#59)
This follows #37 with the first H5 state-test results, a stock reproduction of a radix-cache history dependence, and the fixes and tools requested in review. More results will be pushed to this PR as queued GPU holds complete; anything not yet measured is marked pending in
evidence/state_safety/README.md.H5: truncation and stop tokens inside a verify cycle
max_new_tokensending after every possible number of tokens of the final verify cycle: MTP steps 3 gives 157/157 truncated runs bitwise equal to the untruncated prefix; steps 5 gives 240/240.Radix-cache insertion makes output depend on history
After a prefill,
cache_unfinished_reqrewrites the running request'sreq_to_tokenrow with the radix tree's indices. For tokens the tree already held, the request then attends over another request's copy of their KV. That copy is valid but not bitwise equal, because it was computed in a prefill of another shape.A deterministic stock reproduction (
targeted.py history) serves each of 12 prompts alone and after the earlier prompt sharing the longest prefix:This explains the five prompts in #37 where the tap changed the output: the tap's timing decides whether the switch lands before decode step 2. It is a choice between valid copies, not state corruption, so I have not changed the engine. The KV-level confirmation is queued.
Noise floor additions
Tools and review follow-ups
0001-state-tap.patchis regenerated.mechanism.pygains--repeat-of, for repeats of one prompt within a run, and--start-output-index.analyze_all.shregenerates the light evidence; it reproduces the committed files byte for byte. It also writesfirst_difference_by_module.csvfor the paper figure.Validation
pytest tests/test_state_safety_*.py: 10 passed.mainare pre-existing; the new files are mypy-clean.Pending, queued
humaneval-0044test.