Skip to content

Moonshot P4b: the served A/B rejects P4's 1.10x claim (1.0042x, 95% interval 1.0026-1.0058) - #191

Merged
SamMausberg merged 4 commits into
mainfrom
moonshot/p4b-result
Oct 2, 2026
Merged

SamMausberg merged 4 commits into
mainfrom
moonshot/p4b-result

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

P4's served test has run, and it rejects the throughput claim. This PR commits the evidence and records the result in evidence/moonshot/README.md 2c, with the command behind every new file in section 4.

Result

Run 20261002T084035Z (2026-10-02 08:40-09:11 UTC, run_p4b.sh from a clean checkout of main at 14c6dd1, engine c29a91692b) compared dense decoding with exact replay at ring length 4 in four A B B A A B B A pairs. The primary metric is the server's decode rate in windows at exactly 128 running requests (declared in 2c).

exact / dense, mean of four log ratios 95% t interval
server decode rate at 128 running (primary) 1.0042 1.0026-1.0058
client throughput y 1.0014 1.0011-1.0017

The interval's upper end is below 1.10, so under the declared rule the claim is rejected. The validator's verdict reads: "throughput rejected; output probe found no difference (this does not establish end-to-end exactness; bit-exactness is shown at kernel level)". All four pairs favour exact replay, by 0.31 to 0.55%.

The output probe at concurrency 1 (48 prompts, 256 greedy tokens) found exact replay identical to dense decoding in every token and top-20 log-probability, as was the dense control. SGLang's ReplaySSM kept the dense server's greedy tokens in 22 of 48 sequences, FP16 state in 20 and BF16 state in 17, and all three changed the top-20 log-probabilities (gen_kl_mean above 0 in each), so the probe does detect state rounding of this kind.

Validity

The run is valid under every declared rule:

  • The kernel steps were reused as declared (the engine was still at c29a91692b). The checks at value tiles 32 and 16 are bit-identical.
  • The run's own admission preflight showed 128 running requests in both arms.
  • validate_p4_ab.py passed every check:
    • declared order, every arm exit 0;
    • 256/256 requests completed per arm, with AIPerf exit 0, the declared prompts by text hash and no output-length mismatch;
    • pools 129 / 655,360 / 132 in all eight arms;
    • the exact-replay dispatch line only in exact-replay logs;
    • environment, FP32 state and provenance as declared;
    • 24 windows at exactly 128 in every arm (minimum 8); two further windows at 128 per arm are dropped (one recorded for a prefill or a previous line below 128, plus the phase's first window, whose previous line falls before the phase).
  • Two checks outside the validator:
    • The servers' arguments differ only in the lever's three flags.
    • Foreign CPU averaged 0.19-0.26 cores per arm, below the 2-core flag.
  • Rerunning the validator at this branch's head writes a byte-identical p4_ab_verdict.json.

Measured against derived

The derived expectation before the run was about 1.08x at a 418-token context, less at 2,048.

  • Recomputed for this run, the kernel bench's saving at batch 128 would make the step 0.69 ms shorter: 24 GDN layers x 28.6 us against the measured 10.77 ms dense step. That is about 1.07x (derived), still below the threshold.
  • The measured saving is 0.045 ms per step, about 6.5% of that.

The README gives a hypothesis for the gap, from reading the code; it is not measured. With --enable-linear-replayssm, SGLang's stock ring-cursor bookkeeping runs before every decode-graph replay. It uses a boolean-mask selection and torch.unique on GPU tensors, and both force a host-device sync, which would idle the GPU under the overlap scheduler. A trace of both arms would test this. None has been run, and the verdict does not depend on it.

Files

  • evidence/moonshot/p4_ab_verdict.json: the validator's output, a byte-identical copy.
  • p4_ab_arms.csv: per-arm client numbers and foreign CPU (summarise.py sweeps).
  • p4_output_probe.csv: the probe per configuration (summarise.py quality).
  • gdn_exact_replay_check_L4_bv32.json, _L4_bv16.json and gdn_exact_replay_bench_bv16.json: the reused kernel steps from run 20261001T082738Z at the same engine.
  • README updates:
    • evidence/moonshot/README.md: 2c (outcome, served result), section 3 row 4 and section 4 commands;
    • experiments/moonshot/README.md: the evidence column;
    • the moonshot row of evidence/README.md.

Raw outputs stay in ~/vp-data/moonshot/ (p4_ab_20261002T084035Z, quality_exact_20261002T084035Z, p4_admission_20261002T084035Z, log p4b_129.log).

Checks

  • pre-commit run --files <changed files>: passed.
  • scripts/check_host_identity.sh on the changed files: passed.
  • No code changed, so no tests were run.

…026-1.0058)

Run 20261002T084035Z of run_p4b.sh (main 14c6dd1, engine c29a91692b) passed every
declared validity check: 128 running in both arms of its admission preflight, 24 decode
windows at exactly 128 in every arm, pools 129 / 655,360 / 132, the dispatch line only in
exact-replay logs, foreign CPU 0.19-0.26 cores. Server decode rate at 128 running: exact
replay / dense = 1.0042 (1.0026-1.0058) over four A B B A pairs, so the throughput claim is
rejected under the declared rule; client y 1.0014. The output probe at concurrency 1 found
no difference (48/48 sequences; the dense control also 48/48).

Commits the validator's verdict, per-arm and probe tables, and the reused tile-32/16 kernel
checks and tile-16 bench, with the command behind each in README section 4. README 2c
records the result, the derived 1.07x this context would allow from the kernel bench, and a
code-reading hypothesis (host syncs in SGLang's ReplaySSM cursor bookkeeping) for why about
6.5% of the kernel saving reached the server.
@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-02T09:43:36.708507Z cf43f14 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e6ad7c70cd

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

I reviewed e6ad7c7 in a fresh worktree against the declaration in 2c (07:12 UTC on 2026-10-01, the amendments of 08:19/08:22, 10:05, 10:11/10:16, 10:55 and 14:29, and the 21:20 preflight) and against the raw run. Everything holds except one wording point.

What I checked:

  • I reran the validator at this head on the raw run. Its verdict.json is byte-identical to the committed p4_ab_verdict.json and to the raw copy. summarise.py sweeps and summarise.py quality reproduce p4_ab_arms.csv and p4_output_probe.csv byte for byte. check_admission.py prints a peak of 128 in both arms. The server-argument snippet prints exactly what the README says. validate_p4_ab.py, check_admission.py, summarise.py, run_p4b.sh, output_probe.py, quality_arms.py and logit_probe.py are all unchanged since 14c6dd1. Since 14c6dd1, the declaration has gained only the preflight record.
  • I recomputed the primary metric independently from the server logs and the AIPerf profiling span, using my own parser rather than the validator's. A window counts when its line shows 128 running, the previous decode line shows 128, no prefill line lies between them, and both lines fall inside the profiling span. The harmonic means match to 0.1 tok/s in all eight arms, with 24 windows in each. The pair ratios are 1.0038, 1.0042, 1.0031 and 1.0055. With t(3) = 3.182 on the four log ratios, the server ratio is 1.0042 (1.0026-1.0058) and the client ratio 1.0014 (1.0011-1.0017). The upper end is below 1.10, so the declared rule gives "rejected", and the verdict string follows the declared "throughput <...>; " form.
  • Arm directory times give A B B A A B B A, from 08:55 to 09:09. The pools are 129 / 655,360 / 132 in all eight arms. The dispatch line appears in the four exact A/B logs and the exact probe log, and in no other log. Foreign CPU was 0.19-0.26. The reuse record names the four kernel steps at engine c29a91692b. The three kernel JSONs are byte-identical to ~/vp-data/moonshot/exact_replay/*_20261001T082738Z.json, and gdn_exact_replay_check.py is unchanged since e67feb1.
  • Probe: both generate and score ran at concurrency 1, 48 sequences of 256 tokens each. Exact replay and plain+no_radix#2 are identical to the reference in every token and top-20 entry, in both modes.
  • Derived numbers: 128/11,882.1 = 10.773 ms and 128/11,931.7 = 10.728 ms, so the saving is 0.0448 ms. 24 x 28.6 us = 0.686 ms, which gives 1.068x. 0.0448/0.686 = 6.5%. The bench gives 268 MB per direction at batch 128 (0.537 GB read plus write). Tile 16 is 145.2 against 162.1 us, and tile 32 is 132.9 against 161.5 us.
  • The code-reading paragraph is labelled "code reading, not measured". _replay_metadata lines 781-844 at c29a91692b match its description: the boolean mask is at 823-824 and torch.unique at 836. The file is identical at bd66ce343e, so this is stock code. The paragraph says a trace has not been run.
  • Codex found no major issues at e6ad7c7. check_host_identity.sh passes, and the commit has no attribution lines.

Blocking:

  1. evidence/moonshot/README.md:429-431, and the PR body ("22 of 48 sequences identical"). The sentence just before says exact replay "matched the dense server in all 48 sequences, in every token and top-20 log-probability". Then "SGLang's ReplaySSM matched in 22 of 48 sequences, FP16 state in 20 and BF16 state in 17" reads as the same criterion. It is not. The 22/20/17 are greedy-token matches (gen_seq_identical). In tokens and top-20 log-probabilities together, none of the 48 sequences matched in any of the three controls: I counted 0/48 from the raw generate.json files, and the first difference is at sequence 0, position 1 for ReplaySSM and position 0 for FP16. Fix: say these are greedy-token matches, and that their top-20 log-probabilities differed. The committed gen_kl_mean > 0 in p4_output_probe.csv supports that. If you want to write "in none of the 48", commit the count first (for example, a column in summarise.py quality) and give its command. Make the same correction in the PR body.

Optional:
2. README.md:405. The validator's "excluded" count covers only windows whose previous line is also inside the profiling span. Each arm also has a window whose line at 128 falls inside the span but whose previous line precedes the span start. It contains the first wave's prefills and sits about 3.2-3.9 s into the phase. So two windows at 128 were dropped per arm, not one. The metric is unaffected. A clause such as "and the first window of the phase, whose previous line precedes it" would make the count complete without touching the validator.
3. README.md:410. p4_ab_arms.csv has server_decode_tok_s and server_full_batch_tps columns: the mean of bench's per-point p50 logged rate (11,837-11,915) and its weighted full-batch rate. Neither is the primary metric, which differs from them (11,863-11,940 in the verdict JSON). One clause saying so would stop a reader from computing a ratio from the wrong column.
4. p4_output_probe.csv has score_* columns that the README does not explain. Score mode was also identical for exact replay and the control. score_argmax_agree 0.99428 is the teacher-forced argmax against the reference's decoded token, a prefill-versus-decode difference that appears in every arm. One sentence would keep it from looking like a disagreement.

…in dropped windows and diagnostic columns

Reviewer 1 (#191): the ReplaySSM, FP16 and BF16 counts (22, 20, 17 of 48)
are greedy-token matches; all three changed the top-20 log-probabilities.
Also: each arm drops two windows at 128 (one recorded, plus the phase's
first window), the arms CSV's server_* columns are bench diagnostics, and
the score_* columns come from teacher-forced score mode.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Reviewer 1's item 1 is fixed in 223d330: the README and PR body now call the ReplaySSM, FP16 and BF16 counts (22, 20 and 17 of 48) greedy-token matches, and say all three changed the top-20 log-probabilities (gen_kl_mean above 0 in each). The optional items are in the same commit. Each arm drops two windows at 128, one recorded and one the phase's first window. The arms CSV's server_* columns are labelled as bench diagnostics, and one sentence explains the score_* columns. Verdict and data are unchanged.

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 223d330

This is a delta review of e6ad7c7..223d330. The change is README-only (evidence/moonshot/README.md), and the PR body is updated to match.

  1. Blocking item 1 is fixed. The ReplaySSM, FP16 and BF16 counts (22, 20 and 17 of 48) are now called greedy-token matches. The README and body now say all three changed the top-20 log-probabilities, which the committed gen_kl_mean supports: 0.000191, 0.000225 and 0.000242.
  2. Optional 2 is done. Two windows at 128 are dropped per arm, and the reasons given match my recount from the raw logs: one window falls inside the phase and has a prefill since the previous line, and the phase's first window has its previous line before the phase start, at 3.2-3.9 s.
  3. Optional 3 is done. The server_* columns are labelled as bench's p50 and weighted diagnostics, matching summarise.py lines 173-194.
  4. Optional 4 is done. The score_* sentence matches logit_probe.py: a teacher-forced re-score of the reference sequences, with argmax compared against the reference's decoded token. score_argmax_agree is 0.99428 or 0.99379 in every arm, so 0.994 holds. One nit, which does not block: there is one dense control (plain+no_radix#2), so "the dense controls included" could read "the dense control included".

check_host_identity.sh passes, the commit has no attribution lines, and the pre-commit hooks have nothing to check on a README. Codex has not yet run on 223d330. My approval does not wait for it, but the merge should.

@SamMausberg

SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner Author

Reviewer 1's nit is fixed in 01e7872: "the dense control included" (there is only one).

@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: 01e7872051

ℹ️ 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 +167 to +168
**Outcome.** The served test rejects P4's throughput claim. Its run, 20261002T084035Z, passed
every declared validity check. Over four dense/exact pairs at exactly 128 running requests,

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 Update the global P4 status to match the served result

This now declares that P4b produced a valid run and rejected the claim, but the repository overview still says the served A/B has no valid run and that both attempts were void (README.md:113-118), while the status tracker repeatedly says P4b is queued (TASKS.md:19, TASKS.md:47, TASKS.md:124, and TASKS.md:149). Once this commit is merged, readers and maintainers will receive mutually contradictory results and may continue scheduling an experiment that has already completed; update those project-wide status entries as part of this result commit.

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.

Fixed in cf43f14. README.md's P4 entry now gives the P4b result (decode rate 1.0042x dense, 95% interval 1.0026-1.0058, at 128 running; claim rejected; probe found no difference; three earlier attempts void). TASKS.md's H7 row, the moonshot row, the throughput item, the P4 item (now done) and the FIFO line all say P4b ran.

Codex on #191: README.md's overview said the served A/B had no valid run,
and TASKS.md said P4b was queued. Both now state the result: decode rate
1.0042x dense (95% interval 1.0026-1.0058) at 128 running, which rejects
the 1.10x claim, with no output difference in the probe.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at cf43f14

Delta review of 223d330..cf43f14.

  1. 01e7872 changes "the dense controls included" to "the dense control included", which fixes my nit.
  2. I checked cf43f14 (the project-wide P4 status, answering Codex P2) against evidence/moonshot/README.md 2c:
    • README.md: 1.0042x (1.0026-1.0058), four pairs at exactly 128 running and "no difference" all match the verdict JSON. "About 6.5%" matches 2c's derived comparison (0.045 of 0.69 ms). "Three earlier attempts were void" matches 2c: run 20261001T082738Z, attempt 20261001T104311Z and preflight 20261001T115146Z.
    • TASKS.md: the H7 row, the moonshot row, the FIFO lane, the M1 line and the P4 line (now done) all state the result correctly. "Three served attempts were void (peak 127 running)" holds for all three. No mention of P4b as queued or pending remains in the tree's Markdown.
    • The moonshot row lists Moonshot P4b: the served A/B rejects P4's 1.10x claim (1.0042x, 95% interval 1.0026-1.0058) #191 as merged. That becomes true on merge.
  3. The diff contains no host identity, and the commits have no attribution lines. Codex is re-requested; the merge should wait until it is clean.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: cf43f1412a

ℹ️ 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
SamMausberg merged commit 24ac469 into main Oct 2, 2026
SamMausberg added a commit that referenced this pull request Oct 2, 2026
Research notes: P4's served test rejects the 1.10x claim (fold #191)
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