Repository navigation
State safety: pinned-pool matrix results (plain and MTP) and tree/plain exact tests - #110
Conversation
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: c287be0570
ℹ️ 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".
| nice -n 19 python compare.py --runs "$HOME/vp-data/state" --pairs pairs_cross_regime.json \ | ||
| --allow-mixed-pins --out-json "$evidence/cross_regime.json" \ | ||
| --out-csv "$evidence/divergences_cross_regime.csv" > /dev/null |
There was a problem hiding this comment.
Record low-drift rows for the cross-regime comparison
For this token-identical comparison, compare.py only writes event rows when max_drift > LARGE_DRIFT_NATS (0.5), while the reported maximum is about 0.238. Consequently, divergences_cross_regime.csv contains only its header and cross_regime.json retains only aggregate statistics, so the README's key claim that specifically mt_bench-0064 begins differing at output index 2 cannot be regenerated or audited from the committed evidence. This invocation should preserve all nonzero-drift prompts, or use a cross-regime-specific output threshold/detail report.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 14e38db, regenerated from the existing runs with no new GPU work. compare.py records first_logprob_diff, the first output index whose top-k logprobs differ. A new --all-logprob-differences flag also writes every prompt whose logprobs differ without a token change (the default threshold is still drift above 0.5 nats). analyze_all.sh passes that flag for the cross-regime pair, so divergences_cross_regime.csv now has the row the README cites: mt_bench-0064, first_logprob_diff 2, max_drift 0.238 nats, tokens identical. divergences.csv and divergences_pinned.csv gain only the new column; I checked row by row that every other value is unchanged. There is a unit test for first_logprob_diff.
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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 Review on the exact head 14e38db. What I verified
Blocking
Suggestions (non-blocking)
|
The plain baseline and the MTP matrix (steps 1, 3 and 5 and the top-k 2 tree, at concurrency 1 and 32) ran with identical pinned pools. Every divergence between speculative and plain decoding, or between speculative configurations, is an exact tie, one ulp, or near (both margins at most two BF16 steps). None is large, and no run committed a token that was not its own top-1. Divergences per fragile position do not depend on the previous cycle's commit length (chi-square homogeneity p = 0.74, 0.72, 0.71, 0.27). The tree and plain truncation and stop tests are identical in tokens and logprobs. Code changes: - server_id no longer contains the host name. public_server_info replaces the host of ids recorded earlier, so committed evidence carries no machine address. - compare.py records first_logprob_diff, adds --all-logprob-differences (used for the deliberate cross-regime pair), and puts prompt and cached token sums in the run meta. - cycles.py reports rates by commit length with the homogeneity test. Pairs still queued are listed as missing; this regeneration used STATE_ALLOW_MISSING=1.
14e38db to
39072c5
Compare
|
@codex review |
|
Verdict: APPROVE (provisional: Codex's review of 39072c5 was still running when I posted this. I will re-check its threads on this head before merge.) Re-review on the exact head 39072c5. It is one commit on 5896eb2 that replaces c287be0 and 14e38db. The blocking item, the machine's hostname in committed evidence, is fixed.
Both of my suggestions are in.
Checks
Blocking: none. Note (outside this PR): |
analyze_all.sh exits non-zero if any evidence file contains the machine's host name, in its dashed or dotted form, computed at run time.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 39072c5491
ℹ️ 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".
| - **By rejection position.** Divergences per fragile position (one where the plain | ||
| reference's top-2 gap is at most 0.25 nats) do not depend on the previous cycle's | ||
| commit length, including full acceptance (`cycles_*_pinned.json`): |
There was a problem hiding this comment.
Avoid claiming independence from nonsignificant tests
For the four reported experiments, these p-values only fail to reject a common rate; they do not establish that divergence rates “do not depend” on commit length. Moreover, chi2_contingency treats the bucketed positions as independent observations even though many positions come from the same prompt and collection stops at that prompt's first divergence. The current p-values therefore cannot support the stated independence conclusion without a prompt-clustered analysis and an uncertainty/power bound; otherwise describe the rates as merely compatible with homogeneity.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, fixed in f5061a4. The README no longer says the rates "do not depend" on commit length. It now says that no length stands out and that the rates are compatible with one common rate (chi-square p = 0.74, 0.72, 0.71, 0.27). It adds that this is a failure to reject, not a proof of equal rates, and that the test treats positions as independent although they cluster by prompt and a prompt's positions stop at its first divergence. It also says that no prompt-clustered analysis or per-length excess-rate bound has been done. The PR description is reworded the same way.
| if len(used) >= 2: | ||
| from scipy.stats import chi2_contingency | ||
|
|
||
| chi2, p, dof, _ = chi2_contingency(used) | ||
| test.update(chi2=round(float(chi2), 3), dof=int(dof), p=round(float(p), 4)) |
There was a problem hiding this comment.
Handle exact runs before invoking the chi-square test
When a valid comparison has zero divergences at every commit length, used still contains two or more rows, but its entire divergence column is zero. SciPy's chi2_contingency then raises because the expected-frequency table contains zeros, so cycles.py and consequently analyze_all.sh fail on the exact-output result that this state-safety analysis is intended to handle. Skip the test or emit an explicit non-applicable result when either outcome column has no observations.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 5a56c0f. by_commit_length() now records homogeneity_chi2 as not applicable when either outcome column (divergent or non-divergent fragile positions) is empty across all commit lengths, instead of calling chi2_contingency with zero expected counts. A run with exact output therefore regenerates without error. A unit test covers the all-zero case.
|
@codex review |
With no divergence at any commit length (or every fragile position diverging), the contingency table has a zero column and SciPy's test cannot run. cycles.py now records the test as not applicable instead of failing, so analyze_all.sh handles an exact-output result.
|
@codex review |
|
Verdict: REQUEST CHANGES Re-review on the exact head 5a56c0f. It adds 6097d16 and 5a56c0f on top of 39072c5, which I approved provisionally. What I verified
Blocking
Suggestion (non-blocking). On another machine, a short or generic hostname (for example |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a56c0f71c
ℹ️ 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 '/' not in key: | ||
| continue # the prefill token has no previous cycle | ||
| length = key.split('/')[0] |
There was a problem hiding this comment.
Exclude the first verify cycle from length-one results
compare.py defines chunks[0] as the prefill-sampled token, but analyse() subsequently sets prev to that chunk's length (always 1), causing every prompt's first actual verify cycle to be recorded under the 1/* keys. Grouping those keys here therefore mixes cycles with no previous verify cycle into commit length 1, biasing both its reported rate and the chi-square result used for the rollback conclusion; the first verify cycle needs a distinct prefill bucket that this aggregation excludes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in de6f569. After chunk 0 (the prefill token), prev is now 'prefill' rather than '1', so each prompt's first verify cycle goes into 'prefill/' buckets instead of '1/*'. by_commit_length() skips non-numeric lengths and reports that cycle separately as first_cycle_after_prefill, outside the homogeneity test. I regenerated the files. The README table and p-values now come from them: p = 0.75, 0.72, 0.54, 0.38 for steps 1, 3, 5 and the tree, with the first cycle after prefill at 2/22, 3/32, 7/40 and 6/33. A two-chunk unit test checks the bucketing.
…endent A non-significant chi-square fails to reject a common rate. It does not show that the rates are equal, and the test treats positions as independent although they cluster by prompt and stop at a prompt's first divergence. The README now says the rates are compatible with one common rate, says that no length stands out, and names these limits. The host-name guard now lists the files it matched.
|
@codex review |
|
Verdict: REQUEST CHANGES Re-review on the exact head f5061a4 ("State the commit-length result as compatible with one rate, not independent"). What I verified
Blocking
Suggestions: none. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5061a4ec9
ℹ️ 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".
| r[0] += v['divergences'] | ||
| r[1] += v['fragile'] |
There was a problem hiding this comment.
Restrict the fragile-rate numerator to fragile divergences
When a rollback error causes a token divergence at a position whose reference top-2 gap exceeds FRAGILE_GAP—precisely a strong signal this analysis is meant to detect—divergences increases while fragile does not. Aggregating all divergences here therefore makes divergences_per_fragile invalid and constructs (d, f - d) with unrelated counts for the chi-square test; this inflates the reported rate and can produce a negative contingency cell when d > f, causing SciPy to fail. Track divergences at fragile positions separately for this table and report non-fragile divergences independently.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 51f4ac2. analyse() now counts divergences at fragile and non-fragile positions separately. divergences_per_fragile and the chi-square table (d, f - d) use only the fragile divergences, so d <= f always holds. Divergences at non-fragile positions are reported per commit length, for the first cycle after prefill, and in total (nonfragile_divergences). In every pinned MTP configuration that count is 0, so the rates and p-values (0.75, 0.72, 0.54, 0.38) are unchanged. The README table gains a non-fragile column, and a unit test covers a divergence at a non-fragile position.
cycles.py set the previous commit length to 1 after the prefill token, so every
prompt's first verify cycle was counted under commit length 1. That cycle now
has its own bucket ('prefill/<offset>'), reported as first_cycle_after_prefill
and left out of the homogeneity test. The README table and p-values are
regenerated from the corrected files (p = 0.75, 0.72, 0.54, 0.38). A two-chunk
unit test covers the bucketing.
|
@codex review |
The rate and the homogeneity test used every divergence as the numerator, including any at non-fragile positions, which mixed unrelated counts and could make a contingency cell negative. They now use divergences at fragile positions only. Divergences at non-fragile positions, the strong sign of a state error, are reported per commit length and in total. There are none in any configuration, so the rates and p-values are unchanged. The README table gains the column, and a unit test covers a non-fragile divergence.
|
Verdict: REQUEST CHANGES Re-review on the exact head de6f569 ("Count the first verify cycle after prefill apart from commit length one"). What I verified
Blocking
Suggestion (non-blocking). The first-cycle comparison is called "untested". A Fisher exact test of the first cycle against all later lengths gives p = 0.71, 0.75, 0.033 and 0.049 for steps 1, 3, 5 and the tree. These are uncorrected for four comparisons and confounded by the selection you describe: later cycles only count prompts that have not yet diverged. Reporting that, rather than "untested", would be more exact. Because the prefill-to-decode handoff is where a state error could also show, a short pending item (for example the same split at c32, or against a plain-decoding first step) would also help. |
|
@codex review |
|
Verdict: REQUEST CHANGES (one item left, the caveat's placement) Re-review on the exact head 51f4ac2 ("Rate only fragile divergences per fragile position; count the rest apart").
Blocking
Suggestion (non-blocking, unchanged). For the first cycle after prefill, report the Fisher exact results (p = 0.033 for steps 5 and 0.049 for the tree; uncorrected and selection-confounded) instead of "untested". |
… test exploratory The caveat (failure to reject; positions assumed independent; no clustered analysis) had slipped into the first-cycle bullet; it is back after the commit-length p-values. The first verify cycle after prefill has its own bullet, with a Fisher exact test against later cycles (p = 0.71, 0.75, 0.033, 0.049). The README labels it exploratory: chosen after seeing the data, uncorrected, and comparing groups that differ in more than state. It is a lead for a declared follow-up on fresh prompts, which is listed as pending. The p-values are written by cycles.py as fisher_vs_later_p_exploratory.
|
@codex review |
|
Verdict: APPROVE (provisional: Codex's review of fb1b4b9 was still running when I posted this. I will re-check its threads on this head before merge.) Re-review on the exact head fb1b4b9 ("Restore the caveat to the commit-length result; label the first-cycle test exploratory").
Blocking: none. Suggestion (non-blocking). |
|
Codex Review: Didn't find any major issues. You're on a roll. 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 (confirmed on fb1b4b9) Codex finished its review of fb1b4b9 at 12:28:03 with "Didn't find any major issues". |
Appendix D: the matrix with pinned pools; tree and plain H5 tests (#110)
Results from the pinned-pool matrix (#102) and the tree and plain exact tests. More results will follow as the queued runs land.
What's in it
run_meta_pinned.json(resolved_pools). Every pair has identical pools (pools.json). Files:noise_floor_pinned.json/.csv,divergences_pinned.csv,cycles_*_pinned.json.near(11 events, 5 prompts, both margins ≤ 2 BF16 steps). There are 0largeand 0 non-argmax commits.cross_regime.json, via--allow-mixed-pins): pinned vs unpinned plain c1 is 320/320 token-identical, and one prompt's logprobs differ (mt_bench-0064, from output index 2).targeted.json), with top-5 logprobs compared too.Missing pairs
noise_floor_pinned.jsonlists 26missing_pairs. They are the queued pinned runs: radix off, overlap off, deterministic, FP32 head, logprobs off, retraction, second MTP session, and the ReplaySSM and FlashInfer GDN paths. This regeneration usedSTATE_ALLOW_MISSING=1. Without it,analyze_all.shfails by design until those runs land.Code changes (squashed into 39072c5)
server_idno longer includes the host name.public_server_info()replaces the host part of ids recorded by earlier runs, incompare.py(run meta) andsummarize_targeted.py. No machine address reaches committed evidence, andsame_serverstays exact.compare.pyrecordsfirst_logprob_diff(the first output index whose top-k logprobs differ). It adds--all-logprob-differences, which the deliberate cross-regime pair uses so thatdivergences_cross_regime.csvlistsmt_bench-0064(first difference at output index 2, drift 0.24 nats). It also putsprompt_tokens,cached_tokensandrequests_with_cached_tokenssums in the run meta.cycles.pyreports the divergence rate per fragile position by commit length, with a chi-square homogeneity test: p = 0.75, 0.72, 0.54 and 0.38 for MTP steps 1, 3 and 5 and the tree. The test is reported as not applicable when an outcome is empty.Checks
analyze_all.shregenerates every file.