Skip to content

Moonshot P4: check sent prompts by content (bench ids break on repeated texts) - #98

Merged
SamMausberg merged 2 commits into
mainfrom
moonshot/p4-prompt-check
Oct 1, 2026
Merged

SamMausberg merged 2 commits into
mainfrom
moonshot/p4-prompt-check

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #96 (merged), now based on main. It fixes the validator check that failed the P4b
run of 08:27-09:03 UTC (~/vp-data/moonshot/p4_ab_20261001T082738Z). It was made after the
run, before its verdict was computed or looked at.

What failed and why

validate_p4_ab.py stopped at "prompts not as expected", and all eight arms carry
prompts_as_expected: false. That flag is bench's id comparison:
sorted(sent ids) == sorted(expected ids). The sent ids come from prompt_index, which maps a
text hash to the last id with that text. long2048.jsonl holds only 91 distinct texts among its
512 prompts, each repeated about 6 times: make_long_prompts.py cycles the source split, and its
cursor returns to the same offsets. So the recorded ids differ from the declared ones even when
the declared texts are sent.

From the run's artifacts, the profiling phase of the raw AIPerf stream (payload message
content) holds exactly the texts of long2048.jsonl[:256], with equal counts, in every arm.
The warm-up phase holds only warm-up-pool texts. The radix cache is off in both arms, so the
repeats have no caching effect.

Change

  • check_sent_prompts replaces the id check. It verifies the declared file by its SHA-256,
    then requires the multiset of SHA-256 hashes of the profiling-phase prompt texts to equal
    that of the file's first 256 prompts, counts included. Nothing else changes.
  • Tests: repeated texts sent in another order pass; a foreign prompt and a wrong count of a
    repeated text fail; bench's id flag alone does not decide. 30 pass, together with the probe
    tests. The subprocess runner now sets the declared hash to the synthetic workload's.
  • README 2c: a dated amendment recording that the check was corrected after the run and why,
    and that the workload has 91 distinct texts.

On the real run

Run alone (not the full validator, so no verdict is computed), the content check passes on all
eight arms of p4_ab_20261001T082738Z. The full validator will be re-run on that directory only
after this change is approved; the verdict stands only if every other check passes.

The run of 08:27-09:03 UTC failed validation at 'prompts not as expected' in all eight
arms. long2048.jsonl holds 91 distinct texts among 512 prompts, and bench's prompt_index
keeps one id per text hash, so its id-based prompts_as_expected is False even when the
declared texts are sent. validate_p4_ab.py now compares the multiset of SHA-256 hashes of
the prompt texts in the profiling phase of the raw AIPerf stream with that of the declared
file's first 256 prompts (counts included), after checking that file's own hash. On
p4_ab_20261001T082738Z this content check passes in all eight arms (checked alone; the
verdict has not been computed). Tests: repeated texts sent in another order pass; a
foreign prompt and a wrong count of a repeated text fail; bench's id flag alone does not
decide (30 passed with the probe tests). README 2c records the correction as made after
the run, before its verdict was computed.
@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-01T10:07:39.931812Z 3292b57 PR opened
ℹ️ 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
SamMausberg changed the base branch from moonshot/p4-primary-window to main October 1, 2026 10:06
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Reviewed head e37eed1 (3292b57 and e37eed1, committed 10:05:41 and 10:06:14 UTC) on main, after #96. This changes a validator after the data exists, so I checked it against the run's own artifacts as a bug fix, not a relaxation.

The cause is a bench mapping artifact, not wrong prompts.

  • long2048.jsonl (the declared SHA-256 db376fa3…) has 91 distinct texts among its 512 prompts.
  • bench's prompt_index keeps one id per text hash, and the warm-up pool reuses the id names. bench's id-based prompts_as_expected is therefore False in all eight arms, dense and exact alike.

The new check is content-exact and no weaker.

  • check_sent_prompts verifies the declared file's SHA-256. It then requires the multiset of SHA-256 hashes of the profiling-phase prompt texts in the raw AIPerf stream to equal the multiset for the declared file's first 256 prompts, counts included.
  • It reads the same field bench uses (payload.messages[-1].content, bench/results.py:102), straight from the raw stream rather than through bench's ids.
  • Equal multisets mean the same texts were sent the same number of times, which is exactly what the id check was meant to establish. A foreign prompt, a missing one or a wrong repeat count all fail.
  • The diff removes only the prompts_as_expected test. No other check changed.

Verified on the run.

  • Before this PR, and independently of it, I compared the sent and declared multisets for all eight arms of p4_ab_20261001T082738Z, through bench's own prompt_sha. All eight were equal.
  • I then ran check_sent_prompts alone on all eight arms, and every arm passes.
  • No verdict.json exists in the run directory, so no verdict has been computed.

The README is honest about the timing. 2c records the correction at 10:05 UTC, after the run (08:27–09:03) and before any verdict. It gives the reason and the 91-distinct-texts fact, and notes that the radix cache is off, so the repeats have no caching effect.

Checks.

  • tests/test_validate_p4_ab.py and tests/test_output_probe.py pass (30). The new cases cover repeated texts in another order (pass), a foreign prompt (fail), a wrong repeat count (fail), and bench's id flag not deciding.
  • pre-commit passes, and the commits are Sam's with no AI attribution.
  • Codex finished on 3292b57 with no comments. It has not run on e37eed1, which changes only the README.

The full validator may now be run on that directory, and its verdict reported with the probe outcome.

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