Skip to content

Moonshot: declare P4's served A/B analysis before the run - #94

Merged
SamMausberg merged 9 commits into
mainfrom
moonshot/p4-declaration
Oct 1, 2026
Merged

SamMausberg merged 9 commits into
mainfrom
moonshot/p4-declaration

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Records the analysis of P4's served A/B in evidence/moonshot/README.md (section 2c). It is
committed before run_p4b.sh starts, so git history shows the declaration came before the data.

  • Design: batch 128, 2,048-token prompts, 512 generated, greedy, FP32 state, no speculation,
    radix off. Dense against exact replay (L = 4), four pairs in A B B A A B B A order.

  • Primary metric: token-weighted server full-batch decode rate. Client y and its ratio are
    reported beside it.

  • Statistic: t(3) interval on the mean log ratio of the four pairs.

  • Decision at the pre-registered 1.10x: rejected if the upper end is below 1.10, supported if
    the lower end is at or above 1.10, inconclusive otherwise. A supported result is worded as
    full-batch served decode throughput, not as an end-to-end speedup.

  • Server output probe: greedy tokens and top-20 logprobs at concurrency 1. A difference
    refutes end-to-end exactness; a pass does not establish it. Bit-exactness is shown only at
    kernel level. A dispatch-log check confirms that the exact-replay kernel ran.

  • experiments/moonshot/run_p4b.sh: the exact procedure the job runs, byte-identical to the
    queued copy in ~/vp-data/moonshot/. It is committed before the job started.

  • Failure propagation, from Codex's review: the kernel check exits non-zero on any
    differing word; quality_arms.py and lever_sweep.py exit non-zero when a configuration
    of the invocation fails. validate_p4_ab.py checks the fresh A/B directory (eight arms
    with exit 0, one complete c=128 point each, the dispatch line only in exact-replay logs,
    four dense/exact pairs) before it applies the decision rule. run_p4b.sh uses set -euo pipefail, logs each step's status and exits non-zero on any failure. The queued job runs
    the script from this branch's checkout.

No results change. pre-commit run passes on the changed files.

Primary metric, pairing, t(3) interval on the mean log ratio, the 1.10x decision rule,
the wording of a supported result and the bitwise-probe criterion, written before
run_p4b.sh starts.
@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-01T08:06:00.691120Z 7c894bd 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 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: 37fe05daed

ℹ️ 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 thread evidence/moonshot/README.md Outdated
Comment on lines +222 to +223
- Bit-exactness through the server: greedy tokens and top-20 logprobs at concurrency 1,
exact replay against dense; one differing token or logprob means not bit-exact end to end.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require full outputs before declaring bit-exactness

When exact replay changes a hidden state or any logit outside the reported top 20 while preserving the greedy token and top-20 values, this probe passes even though the server paths are not bit-exact. Since the result is presented as the end-to-end bit-exactness check, either compare the complete logits and relevant states at each step or explicitly classify this as a limited output probe that cannot establish bit-exactness.

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 4054d71, before run_p4b.sh started. The comparison is now called a "server output probe", and the README states its rule: a difference refutes end-to-end exactness, a pass does not establish it (it sees only emitted tokens and top-20 logprobs, not the state or hidden outputs), and bit-exactness is shown only at kernel level. The A/B decision rule is unchanged. run_p4b.sh is committed in the same PR (experiments/moonshot/run_p4b.sh) and is byte-identical to the queued copy.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES

Reviewed head 37fe05d, committed 2026-10-01 07:12:34 UTC. It adds 22 lines to evidence/moonshot/README.md.

Integrator checks

  • No P4b data existed at the commit.
    • ~/vp-data/moonshot/p4b.log is empty. Its mtime is 07:11:01, when the job was resubmitted with the log truncated.
    • None of run_p4b.sh's outputs exist: p4_ab/, quality_exact2/, exact_replay/check_L4_bv16.json, bench_bv16.json and p7/verify_width_flashinfer.json. The only files in p7/ are from 02:18, written by an earlier, unrelated job.
    • The job is still queued at priority 1 (ticket 1-1790838661…-x), behind two others.
  • The decision rule matches P4's pre-registered gate. P4 says "claim >= 1.10x … reject if the paired 95% CI upper bound is below 1.10x". The declaration rejects on an upper end below 1.10, supports on a lower end at or above 1.10, and calls anything else inconclusive. Its interval is a t(3) interval over four paired log ratios.
  • The wording is right.
    • The primary metric is bench's logged_gen_tps_full_batch (bench/sweep.py:206), token-weighted.
    • A supported result is worded "full-batch served decode throughput 1.xx times", never as an end-to-end speedup, with client y and its ratio beside it.
  • The diff stays inside section 2c, before "## 2d".
  • The design matches the script. The A B B A A B B A order is exactly the --configs order in run_p4b.sh (r1 A, r1 B, r2 B, r2 A, r3 A, r3 B, r4 B, r4 A).
  • The prior expectation (about 1.08×) matches the derived figure in the README's lever table.
  • pre-commit passes. The commit is Sam's, with no AI attribution.

Blocking

B1 (Codex P1, README.md:223): the server probe cannot establish bit-exactness. "Bit-exactness through the server: greedy tokens and top-20 logprobs at concurrency 1" can pass while a hidden state, or a logit outside the top 20, differs. This is the same distinction as "token-identical" against "bitwise" in #59, #74 and #76. Please:

  1. rename the bullet to what the probe measures, e.g. "server output probe: greedy tokens and top-20 logprobs identical at concurrency 1";
  2. state that passing it does not establish bit-exactness. Bit-exactness is shown only at kernel level (synthetic activations, one layer), and a difference refutes it.

This only narrows a claim and leaves the decision rule as it is. Still, land it before run_p4b.sh starts, so the whole declaration predates the data. The job is third in the queue.

Suggestion

The declaration names ~/vp-data/moonshot/run_p4b.sh, which is not committed. Commit it with the results PR, or now, so the declared design can be checked against the commands that ran. It was last modified at 07:11:35, before this commit.

…ore the run

The probe compares greedy tokens and top-20 logprobs only: a difference refutes
end-to-end exactness, a pass does not establish it; bit-exactness is shown at kernel
level. run_p4b.sh is the exact procedure the job runs (the queued copy in
~/vp-data/moonshot is byte-identical).
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Re-reviewed 4054d71, committed 07:16:51 UTC.

  • B1 is fixed. The bullet is now "Server output probe: greedy tokens and top-20 logprobs … A difference refutes end-to-end exactness; a pass does not establish it". It says the probe does not see the state or hidden outputs, and that bit-exactness is shown only at kernel level. The script's header comment says the same.
  • The suggestion is taken. experiments/moonshot/run_p4b.sh is committed, and the declaration cites it in place of the ~/vp-data copy. Ignoring comments, the committed script is identical to the queued ~/vp-data/moonshot/run_p4b.sh (updated 07:16:48), which is the file the queued job will execute.
  • The declaration still predates the data. At this head p4b.log is still empty (mtime 07:11:01), and the job is still queued, second at priority.
  • Checks. pre-commit passes, including shellcheck on the script. The commit is Sam's, with no AI attribution.

The integrator checks from my first review still hold: the gate matches P4's pre-registered rule, the wording is right, and the diff stays within section 2c plus the script. Codex has not run on 4054d71. Its P1 on 37fe05d is what this commit fixes.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@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: 4054d71561

ℹ️ 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 thread experiments/moonshot/run_p4b.sh Outdated
Comment on lines +17 to +19
SGLANG_GDN_EXACT_REPLAY_BV=16 python experiments/moonshot/gdn_exact_replay_check.py check \
--batch 8 --steps 48 --ring 4 --force-rate 0.1 --out ~/vp-data/moonshot/exact_replay/check_L4_bv16.json \
| grep -E "bit_identical|differing"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fail when the bit-exactness check finds differences

If the exact-replay kernel regresses, gdn_exact_replay_check.py check still exits successfully and prints fields such as "bit_identical": false and nonzero *_words_differing; this grep matches those failure values and therefore also succeeds, allowing the job to continue as though the kernel-level prerequisite passed. Check specifically for a true/zero result or make the checker return nonzero on disagreement.

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 7d7c371, before the job started. gdn_exact_replay_check.py check now exits non-zero when any output or state word differs. In run_p4b.sh the kernel check at the timed configuration (value tile 32) is a required step: anything but exit 0 stops the job with "P4b FAILED at required step kernel-check-bv32". The BV16 variant is optional, because it is not the timed configuration; if it fails, the job still exits non-zero at the end, with the failed step named.

Comment thread experiments/moonshot/run_p4b.sh Outdated
Comment on lines +27 to +30
python experiments/moonshot/quality_arms.py --out ~/vp-data/moonshot/quality_exact2 \
--reference plain+no_radix --probe-concurrency 1 \
--configs plain+no_radix plain+no_radix+exact_replay plain+no_radix+replayssm 'plain+no_radix#2' \
plain+no_radix+fp16_state plain+no_radix+bf16_state 2>&1 | grep -E '"(sequences_identical|kl_mean|argmax_agreement|divergences_per_1k_shared_tokens|error)"'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Treat output-probe errors as failures

When any probe configuration fails, quality_arms.py catches the exception, prints an "error" entry, and exits zero; because this grep explicitly matches "error", the pipeline also succeeds and the pre-registered A/B proceeds without a complete server output probe. The script should inspect the summary and abort if any requested configuration has an error or is missing its comparison.

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 7d7c371. quality_arms.py now exits non-zero when any configuration of this invocation has an error or, other than the reference, lacks its generate or score comparison. The probe is a required step and writes to a fresh directory per run (quality_exact_). A second required step checks that the exact-replay server log has the dispatch line. A token or logprob difference is still a result, not a failure: it refutes end-to-end exactness.

Comment thread experiments/moonshot/run_p4b.sh Outdated
Comment on lines +32 to +36
python experiments/moonshot/lever_sweep.py --out ~/vp-data/moonshot/p4_ab --stream-interval 4 \
--concurrency 128 --min-requests 256 --waves 2 \
--workload ~/vp-data/moonshot/workloads/long2048.jsonl \
--warmup-pool ~/vp-data/moonshot/workloads/long2048_warmup.jsonl \
--configs 'plain+no_radix#r1' 'plain+no_radix+exact_replay#r1' \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require all four A/B pairs to finish successfully

If one or more of these eight arm runs fails, lever_sweep.py catches the exception, records it in lever_sweep_log.jsonl, and still returns zero. The final grep -c also succeeds when any matching log contains the dispatch line, including an older run under the reused output directory, so the job can finish with fewer than the four declared pairs. Validate the current run's eight statuses and require exactly four successful dense/exact pairs before accepting the experiment.

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 7d7c371. lever_sweep.py exits non-zero when any configuration fails, and the A/B writes to a fresh directory per run (p4_ab_). The new validate_p4_ab.py is a required step. It checks that the log of this run lists exactly the eight expected arms with status exit 0, and that each arm has exactly one sweep.json with one complete c=128 point (completed == requests, failed 0) carrying the token-weighted rate. It checks that the dispatch line appears in every exact-replay server log and in no dense one, and that the arms form four dense/exact pairs. Otherwise it prints FAILED and exits 1. Only then does it apply the declared decision rule. Design, metric and rule are unchanged.

- gdn_exact_replay_check.py check exits non-zero when any word differs.
- quality_arms.py exits non-zero when a configuration of this invocation fails or lacks
  its generate/score comparison.
- lever_sweep.py exits non-zero when any configuration of this invocation fails.
- validate_p4_ab.py: checks one fresh A/B directory (eight arms with status exit 0, one
  complete c=128 point each, dispatch line only in exact-replay logs, four dense/exact
  pairs) and applies the declared decision rule; prints FAILED and exits 1 otherwise.
- run_p4b.sh: set -euo pipefail, per-step status lines, fresh output directories per run,
  required steps abort at once, optional steps (BV16 check and bench, FlashInfer verify
  timing) make the job exit non-zero at the end; tools run from the script's checkout.
- gdn_fast_verify_check.py: the FlashInfer verify timing the optional P7 step runs.
Design, metric and decision rule are unchanged.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@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: 7d7c371648

ℹ️ 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 thread experiments/moonshot/validate_p4_ab.py Outdated
Comment on lines +52 to +54
requests, completed = int(point.get('requests') or 0), int(point.get('completed') or 0)
if requests <= 0 or completed != requests or int(point.get('failed') or 0) != 0:
fail(f'{label}: {completed}/{requests} completed, {point.get("failed")} failed')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require all 256 requested samples

When AIPerf exits early after exporting only a successful subset, this accepts the arm because requests is merely len(rows) in bench.results.summarise_point, not the configured request count; for example, 128 exported successes become completed == requests == 128 even though the pre-registered 256-request point was incomplete. Also require requests == 256, a zero aiperf_exit_code, and prompts_as_expected before using the point so partial runs cannot contribute to the verdict.

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 aefef2d, before the job started. I cancelled the queued job and requeued it at its original priority arrival, so it now runs aefef2d. A point counts only if requests == completed == 256 (the configured count at c=128: --min-requests 256, 2 waves), failed is 0, aiperf_exit_code is 0, prompts_as_expected is true and osl_mismatch is 0. Otherwise the step prints FAILED and exits 1. The validator also requires the log to list the eight arms in the declared A B B A A B B A order. tests/test_validate_p4_ab.py covers a complete synthetic run (decided) and the failing cases: a partial point with 128 rows all successful, an AIPerf error, unexpected prompts, a wrong order and a failed arm (6 passed).

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex is running on 7d7c371, and I'll re-check it before merge)

Re-reviewed 7d7c371, committed 07:23:35 UTC, which fixes Codex's three P1s on 4054d71. This head is no longer docs-only. It changes run_p4b.sh and four moonshot scripts, and adds validate_p4_ab.py.

  • Failures now propagate.
    • gdn_exact_replay_check.py check exits non-zero when the replay is not bit-identical.
    • quality_arms.py exits non-zero if any configuration of the invocation errored or lacks its generate/score comparison. The reference config is exempt from the comparison check.
    • lever_sweep.py exits non-zero if any configuration did not exit 0.
    • run_p4b.sh runs under set -euo pipefail with a step wrapper. Required steps abort with exit 1. Optional steps (the BV16 check and bench, the P7 timing) are reported and make the job exit 1 at the end.
  • The prerequisite now matches the timed configuration. The required kernel check runs at the default value tile, which is what the A/B's exact_replay arm uses. Every output goes to a fresh $RUN_ID directory.
  • validate_p4_ab.py applies the declared rule.
    • It checks that the log lists exactly the eight configurations with exit 0.
    • It checks that each has one c = 128 point with all requests completed and the token-weighted full-batch rate.
    • It checks that the dispatch line appears in the exact-replay logs and in no dense log, and that four pairs are formed.
    • It then computes the B/A ratios and a t(3) 95% interval over the log ratios, and gives the 1.10 decision. The client-y ratio is reported beside it.
    • I tested it on a synthetic directory. Four pairs with ratios of 1.06–1.07 gave the interval I computed independently (1.0636 [1.0568, 1.0705]) and "rejected". Putting the dispatch line into one dense log made it print FAILED and exit 1.
  • The rule and wording are unchanged from the declaration. gdn_fast_verify_check.py adds an optional FlashInfer timing arm to the P7 side measurement, which is not part of the A/B.
  • The declaration still predates the data. p4b.log is empty (mtime 07:23:41). The job was requeued at its old priority place, still second, and runs the committed script from ~/vp-wt/moonshot-decl at 7d7c371 with a clean tree.
  • Checks. pre-commit passes on all changed files. The commits are Sam's, with no AI attribution. All four Codex threads have replies.

Suggestion (not blocking): validate_p4_ab.py checks the set of configurations but not their A B B A A B B A order in lever_sweep_log.jsonl. A one-line check against the declared order would make the validator enforce the design as well as the counts.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (this withdraws my provisional approval at 7d7c371)

Codex finished on 7d7c371 with a P1 on validate_p4_ab.py:54, which I missed, and it is valid. requests in a sweep point is the number of exported rows (bench.results.summarise_point), not the configured count. If AIPerf exits early after exporting, say, 128 successful requests, the point shows completed == requests == 128 and passes. The pre-registered point is 256 requests (--min-requests 256).

B1. Before a point can count toward the verdict, the validator must require:

  • requests == 256;
  • a zero aiperf_exit_code;
  • prompts_as_expected.

Add a synthetic failing case for a partial point to whatever test you ran. With that and the ABBA-order check I suggested, the validator enforces the whole declared design.

Everything else in my previous comment stands. The job has not started: p4b.log is still empty.

…red order

A point counts only with requests == completed == 256, failed 0, AIPerf exit code 0,
prompts as expected and no output-length mismatch (requests is the number of exported
rows, so an early AIPerf exit could pass as complete). The log must list the eight arms in
the declared A B B A A B B A order. tests/test_validate_p4_ab.py covers a complete run and
the failing cases: a partial point, an AIPerf error, unexpected prompts, a wrong order and a
failed arm.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Re-reviewed aefef2d, committed 07:28:45 UTC, which fixes Codex's P1 on 7d7c371.

  • A point counts only when it is complete. It needs requests == completed == 256, failed == 0, aiperf_exit_code == 0, prompts_as_expected true and osl_mismatch == 0. These are the field names bench/sweep.py (lines 361 and 367) and bench/results.py (lines 198–214) write, so a partial AIPerf export can no longer pass.
  • The order is enforced. The log must list the arms in the declared A B B A A B B A order. This was my suggestion.
  • Tests. tests/test_validate_p4_ab.py passes (6). It covers a complete run that gets decided, and FAILED for each of these: a 128-row partial point, an AIPerf error, unexpected prompts, a wrong order and a failed arm.
  • The declaration still predates the data. p4b.log is empty (mtime 07:28:50). The job was requeued at its old priority arrival and runs aefef2d from ~/vp-wt/moonshot-decl with a clean tree.
  • Checks. pre-commit passes, and the commit is Sam's with no AI attribution.

Codex has not run on aefef2d. If you trigger it, I'll re-check before merge. Everything else from my earlier comments stands.

@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: aefef2d345

ℹ️ 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 +54 to +55
data = json.loads(runs[0].read_text())
points = [p for p in data.get('points', []) if p.get('concurrency') == 128]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify the preregistered workload in each manifest

Because long2048.jsonl is an external mutable file, a run where it was regenerated with a different token length can still pass: prompts_as_expected only proves that AIPerf returned the prompts loaded for that run, while this code never checks the manifest's workload hash, isl_mean, osl, ignore_eos, or greedy request body against the declared 2,048-input/512-output design. Such a run would receive a decision for a different experiment, so validate those manifest and point fields before accepting the point.

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 ed1f723, before the job started. Each arm's sweep.json manifest must show long2048.jsonl by SHA-256 (db376fa3…659c, now in the README declaration with the warm-up pool's hash b4b5b4e4…30a6), 512 prompts, OSL 512 with ignore_eos, and a greedy request body (temperature 0.0, ignore_eos). The point's isl_mean must lie in 2,040-2,049. Otherwise the validator prints FAILED. The tests cover another workload hash and a sampled request body.

Comment on lines +72 to +73
if not (point.get('server_log') or {}).get('logged_gen_tps_full_batch'):
fail(f'{label}: no token-weighted server full-batch decode rate')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require the scheduler to reach batch 128

Client concurrency 128 does not guarantee that the server actually decodes a batch of 128. log_segment_stats defines logged_gen_tps_full_batch relative to the largest batch observed in that segment, so a run whose scheduler only reaches 64 requests can still provide a nonzero value here and pass validation. Check server_log.max_running_logged against the declared batch size (and reject undersaturated points) before using this metric for the preregistered decision.

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 ed1f723. Every arm must have server_log.max_running_logged >= 128. The A/B arms now pin the pools with a p4_pools lever: --max-running-requests 128, --max-total-tokens 360448, --max-mamba-cache-size 128. The validator reads each server's resolved max_running_requests, max_mamba_cache_size and max_total_num_tokens from its log. Running requests and mamba slots must be 128. The KV pool must be at least 327,680 tokens (128 x 2,560) and identical in all eight arms, and the resolved sizes are recorded in the verdict. The tests cover a batch below 128, an unpinned running limit and a small KV pool (11 passed).

Comment on lines +215 to +216
except Exception as exc:
point['flashinfer_error'] = repr(exc)[:300]

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 Propagate FlashInfer benchmark failures

If gated_delta_rule_mtp raises for any width—for example because of an API or kernel incompatibility—the exception is converted into flashinfer_error and the process still exits zero. Consequently the p7-flashinfer-verify step in run_p4b.sh is reported as successful, and the final job can print "all steps ok" even though no FlashInfer timings were collected. Re-raise the error or make the benchmark exit nonzero after writing the diagnostic.

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 ed1f723. gdn_fast_verify_check.py bench records the widths where gated_delta_rule_mtp raised or is unavailable, and exits non-zero after writing its JSON. The optional P7 step in run_p4b.sh therefore reports FAILED, and the job exits non-zero at the end.

…optional FlashInfer step

- validate_p4_ab.py: every arm must have run long2048.jsonl and its warm-up pool (SHA-256 in
  the README declaration), 512 prompts, mean input length 2,040-2,049, OSL 512 with
  ignore_eos and a greedy request body; the full-batch rate must come with
  max_running_logged >= 128; the resolved pools (server log) must be 128 running requests
  and 128 mamba slots with one KV pool size of at least 327,680 tokens in all arms.
- The A/B arms pin the pools with the new p4_pools lever (128 running, 360,448 KV tokens,
  128 mamba slots).
- gdn_fast_verify_check.py bench exits non-zero when the FlashInfer MTP verify raises or is
  missing at any width.
- Tests cover the new failing cases (11 passed).
Design, metric and decision rule are unchanged.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex is running on ed1f723, and I'll re-check it before merge)

Re-reviewed ed1f723, committed 07:36:32 UTC, which fixes Codex's three items on aefef2d.

  • The workload check is right. validate_p4_ab.py checks each arm's manifest. The SHA-256 hashes of long2048.jsonl and the warm-up pool match the files in ~/vp-data/moonshot/workloads/; I recomputed both. It also checks 512 prompts, OSL 512 with ignore_eos, a greedy request body (temperature 0) and a mean input length of 2,040–2,049.
  • The batch and pool checks match the engine's log lines. The validator requires max_running_logged >= 128. It reads the resolved pools from each server log and requires max_running_requests 128, max_mamba_cache_size 128, and one KV pool of at least 128 × 2,560 tokens, identical across arms. The three regexes match SGLang's own lines, which I checked in a server log from today (max_running_requests=128, max_total_num_tokens=…, max_mamba_cache_size: 128). If they didn't, every run would be voided.
  • The pools are pinned and declared. The p4_pools lever pins 128 running, 360,448 KV tokens and 128 mamba slots in both arms. These are capacity flags, and the README declares them. The decision rule is unchanged.
  • FlashInfer failures propagate. gdn_fast_verify_check.py exits non-zero when the FlashInfer MTP kernel raises or is missing, so the optional P7 step reports it.
  • Checks.
    • tests/test_validate_p4_ab.py passes (11), and pre-commit passes.
    • The job's checkout (~/vp-wt/moonshot-decl) is at ed1f723 with a clean tree.
    • p4b.log is still empty (mtime 07:36:33), so all of this predates the data.

Suggestion (not blocking): the README still heads the section "declared … at 07:12 UTC, before the run started", but the validity, workload and pool bullets were added at 07:36. Git shows each time. When the results land, a line such as "amended 07:16–07:36 UTC before the run; decision rule unchanged since 07:12" would make the page match the history without anyone reading the log.

@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: ed1f723761

ℹ️ 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 thread experiments/moonshot/run_p4b.sh Outdated
echo "P4b run $RUN_ID, engine $(git -C "$SGLANG_WORKTREE" rev-parse --short HEAD), repo $REPO at $(git rev-parse --short HEAD)"
git status --short -- experiments bench | sed 's/^/uncommitted: /'
export PYTHONPATH=$SGLANG_WORKTREE/python
step required kernel-check-bv32 python experiments/moonshot/gdn_exact_replay_check.py check \

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 Pin the required value tile to 32

If the invoking shell already has SGLANG_GDN_EXACT_REPLAY_BV=16 (for example from prior kernel testing), this supposedly BV32 check inherits that value because sglang_env.sh does not clear it. The later quality and A/B server processes also copy the inherited environment, so the run can validate and benchmark BV16 while naming the prerequisite artifact bv32 and applying the preregistered verdict to the wrong kernel configuration. Export SGLANG_GDN_EXACT_REPLAY_BV=32 for the main run, letting only the two explicit optional env ...=16 commands override it locally.

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 b8cfa66, before the job started. I cancelled the waiting job at 07:42 (its flock was still waiting and no step had run) and requeued it at its original priority arrival. run_p4b.sh exports SGLANG_GDN_EXACT_REPLAY_BV=32 and prints it at start; the BV16 steps override it explicitly. The exact_replay lever sets SGLANG_GDN_EXACT_REPLAY_BV=32 in each server's arm environment, which overrides any inherited value and which bench records in launch.json. validate_p4_ab.py fails any exact arm whose launch.json shows another tile (test added, 12 passed). The engine's dispatch line does not print the tile, so the validator reads it from the launch record.

run_p4b.sh exports SGLANG_GDN_EXACT_REPLAY_BV=32 (the BV16 steps still override it
explicitly) and prints it at start; the exact_replay lever sets it in each server's arm
environment, which overrides an inherited value and is recorded in bench's launch.json;
validate_p4_ab.py fails any exact arm launched with another tile (test added, 12 passed).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex is running on b8cfa66, and I'll re-check it before merge)

Re-reviewed b8cfa66, committed 07:43:00 UTC, which fixes Codex's P2 on ed1f723.

  • The value tile is pinned in three places.
    • run_p4b.sh exports SGLANG_GDN_EXACT_REPLAY_BV=32 and logs it. Only the two optional BV16 steps override it, explicitly, with env …=16.
    • The exact_replay lever sets the variable in each server's arm environment.
    • validate_p4_ab.py fails any exact arm whose launch.json env_overrides lacks SGLANG_GDN_EXACT_REPLAY_BV: '32'. Bench writes that field from the arm environment (bench/server.py:503), and I saw it in a launch record from today.
  • This run was not exposed. The job queued at 07:36 had no such variable in its environment (/proc/<pid>/environ), and the engine default is 32. The pin makes that explicit.
  • Checks.
    • tests/test_validate_p4_ab.py passes (12), and pre-commit passes.
    • The job's checkout is at b8cfa66 with a clean tree.
    • p4b.log is empty (mtime 07:43:06), so the job has not started.

@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: b8cfa66a20

ℹ️ 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 thread experiments/moonshot/run_p4b.sh Outdated
Comment on lines +51 to +52
echo "P4b run $RUN_ID, engine $(git -C "$SGLANG_WORKTREE" rev-parse --short HEAD), repo $REPO at $(git rev-parse --short HEAD)"
git status --short -- experiments bench | sed 's/^/uncommitted: /'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject dirty source trees before running the experiment

If either the repository checkout or SGLANG_WORKTREE contains tracked edits—such as changes made while this queued job is waiting—this only prints some repository changes and then executes them; it does not fail, does not inspect engine dirtiness, and validate_p4_ab.py never validates either tree's provenance. The run can therefore produce an accepted verdict from uncommitted harness or kernel code rather than the committed procedure and patch series. Make cleanliness of both trees a required preflight check before any measurements.

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 12e6fcb, before the job started. I cancelled the waiting job at 07:47; no step had run. It was requeued at 07:48:52 at its original priority arrival.

  • run_p4b.sh has two new required preflight steps: git status --porcelain must be empty in the repository checkout and in SGLANG_WORKTREE, counting tracked and untracked files. Otherwise the job stops.
  • It records both HEADs in p4b_.provenance.json, which is passed to the validator.
  • validate_p4_ab.py requires the provenance file and every arm's launch.json to show the same repository HEAD and engine HEAD, no modified tracked files in either, and sglang imported from the engine tree. It copies the provenance into verdict.json.
  • Tests cover another engine commit, a dirty repository and a missing provenance file (15 passed).
    Both trees were clean at requeue: repo 12e6fcb, engine c29a91692b. I won't touch either until the run finishes.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (this withdraws the provisional approval at b8cfa66)

Codex finished on b8cfa66 with a P1 on run_p4b.sh:52, and it is valid. The script only prints repository changes (git status --short -- experiments bench). It runs anyway, never checks the engine tree, and validate_p4_ab.py does not check either tree's provenance. A tracked edit made while the job waits would therefore produce an accepted verdict from uncommitted code.

B1. Make it a required preflight, before any measurement, that both the repository checkout and SGLANG_WORKTREE have no tracked changes. Record both commits in the run log and in verdict.json, and have the validator fail if either commit is missing or a recorded tree was dirty.

Right now both trees are clean: ~/vp-wt/moonshot-decl is at b8cfa66 and ~/sglang-wt/moonshot at c29a91692b, with 0 tracked changes each. So a run starting now would be fine. The check is still needed for the verdict to be self-certifying.

run_p4b.sh adds two required preflight steps: git status --porcelain must be empty in the
repository checkout and in SGLANG_WORKTREE. It records both HEADs in
p4b_<run id>.provenance.json and passes the file to the validator. validate_p4_ab.py
requires every arm's launch record to show the same repository HEAD and engine HEAD, no
modified tracked files, and sglang imported from the engine tree, and it copies the
provenance into verdict.json. Tests: 15 passed.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex is running on 12e6fcb, and I'll re-check it before merge)

Re-reviewed 12e6fcb, committed 07:48:43 UTC, which fixes Codex's P1 on b8cfa66.

  • The preflight stops dirty runs. Two required steps (clean_tree) stop the job if git status --porcelain is non-empty, covering tracked and untracked files, in the repository checkout or in SGLANG_WORKTREE. Both HEADs then go to p4b_<RUN_ID>.provenance.json.
  • The validator checks every arm's provenance. validate_p4_ab.py requires the provenance file with all four fields. For every arm's launch.json, it requires repo.head and sglang_source.head equal to the recorded HEADs, dirty_files 0 in both trees, and sglang_source.module_file inside the engine tree. These are the field names bench writes, which I checked in a launch record from today. The provenance is copied into verdict.json.
  • Checks.
    • tests/test_validate_p4_ab.py passes (15), and pre-commit passes.
    • At this head both trees are clean: ~/vp-wt/moonshot-decl at 12e6fcb and ~/sglang-wt/moonshot at c29a91692b.
    • p4b.log is empty (mtime 07:48:49), so the job has not started.

@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: 12e6fcbc87

ℹ️ 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 thread experiments/moonshot/run_p4b.sh Outdated
RUN_ID=$(date -u +%Y%m%dT%H%M%SZ)
# The exact-replay value tile is pinned to 32 (the packed decode's tile) for every step and
# server unless a step overrides it explicitly; the exact_replay lever also sets it per server.
export SGLANG_GDN_EXACT_REPLAY_BV=32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clear inherited GDN state-dtype overrides

The new BV pin still leaves SGLANG_MAMBA_SSM_DTYPE inherited from the invoking shell. If this job is launched after an FP8-state experiment exported SGLANG_MAMBA_SSM_DTYPE=float8_e4m3fn, Server.environment() copies it into both A/B servers, while the validator inspects only each arm's env_overrides; the run can therefore pass and issue a verdict for FP8 rather than the preregistered FP32 state. Explicitly unset this variable or pin the FP32 state dtype before running the probes and A/B.

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 for the whole class in f898067, before the job started. The queued job I cancelled at 07:52 carried none of these prefixes; I read its /proc environ, as did the coordinator.

  • run_p4b.sh unsets every inherited SGLANG_, FLASHINFER_, TRITON_, TORCH_, PYTORCH_ and NCCL_ variable at start. It then sets only its allowlist: SGLANG_WORKTREE, plus the exact-replay variables per kernel step and, through the exact_replay lever, per exact server. Dense servers get none of the exact-replay variables.
  • RecordingServer (lever_sweep.py and quality_arms.py) reads each server process's environment from /proc and records those prefixes in launch.json (env_prefixed).
  • validate_p4_ab.py requires env_prefixed to equal the declared set for the arm.
  • For the reviewer's request, the arms also pass --mamba-ssm-dtype float32. The validator requires mamba_ssm_dtype float32 in server_info.json and an FP32-sized SSM pool in the server log, so an FP16 or FP8 state fails however it arrives.
  • Tests: 18 passed.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (this withdraws the provisional approval at 12e6fcb)

Codex finished on 12e6fcb with another inherited-environment P1 (run_p4b.sh:29): SGLANG_MAMBA_SSM_DTYPE, or any other SGLANG_* engine variable in the submitting shell, reaches both servers through Server.environment(). The validator checks only each arm's env_overrides, so an inherited FP8 state could pass as the pre-registered FP32 run.

This is the second time an inherited variable has turned up, after the BV tile. Close the whole class rather than one variable at a time.

B1. Do both of these:

  1. Sanitize the environment at the top of run_p4b.sh. Unset every inherited SGLANG_* variable, plus FLASHINFER_* and TRITON_* if bench doesn't pin them, and set only the declared ones. Record the resulting environment in the provenance file.
  2. Validate the resolved state dtype from each server, not from what was asked for. Use the resolved value in the server log or server_info.json (it has mamba_ssm_dtype, which is null for the default), or pass --mamba-ssm-dtype float32 explicitly in both arms and check it. Fail any arm whose state is not FP32.

The queued job (gpu_lock pid 3834932) has no SGLANG_*, FLASHINFER_*, TRITON_* or CUDA_* variables in its environment, so a run starting now would not be affected. As with the earlier P1, the check is needed for the verdict to be self-certifying.

…rver's environment and state dtype

- run_p4b.sh unsets every inherited SGLANG_, FLASHINFER_, TRITON_, TORCH_, PYTORCH_ and
  NCCL_ variable at start and sets only its allowlist (SGLANG_WORKTREE; the exact-replay
  variables per kernel step and, through the exact_replay lever, per exact server). It
  prints the remaining set.
- server_env.RecordingServer (used by lever_sweep.py and quality_arms.py) reads each server
  process's environment from /proc and records those prefixes in launch.json
  (env_prefixed).
- validate_p4_ab.py requires env_prefixed to equal the declared set: SGLANG_WORKTREE for
  dense arms, plus SGLANG_GDN_EXACT_REPLAY=1 and SGLANG_GDN_EXACT_REPLAY_BV=32 for exact
  arms. It requires mamba_ssm_dtype float32 in server_info.json (the p4_pools lever now
  passes --mamba-ssm-dtype float32) and an SSM pool of FP32 size in the server log.
- Tests: 18 passed.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional: Codex is running on f898067, and I'll re-check it before merge)

Re-reviewed f898067, committed 07:54:47 UTC, which fixes the inherited-environment class from 12e6fcb.

  • The environment is sanitized, then checked per server.
    • run_p4b.sh unsets every inherited SGLANG_*, FLASHINFER_*, TRITON_*, TORCH_*, PYTORCH_* and NCCL_* variable before sourcing sglang_env.sh, which sets none of them, and logs what is left.
    • The kernel steps set the BV tile explicitly.
    • RecordingServer records each server process's own /proc/<pid>/environ for those prefixes in launch.json.
    • The validator requires exactly SGLANG_WORKTREE for dense arms, plus SGLANG_GDN_EXACT_REPLAY=1 and …_BV=32 for exact arms.
    • Bench's Server.environment() adds only PYTHONUNBUFFERED and the resolved SGLANG_WORKTREE, and ~/sglang-wt/moonshot resolves to itself. A clean run therefore matches the declared set and is not voided by a path mismatch.
  • The state dtype is checked as resolved by each server. The arms pass --mamba-ssm-dtype float32. The validator requires mamba_ssm_dtype == 'float32' in each server_info.json and an FP32-sized SSM pool in the log. That check matches the real line format: a log from today reads max_mamba_cache_size: 128, … ssm_state size: 6.05GB, against 24 × 32 × 128 × 128 × 4 B × 129 slots = 6.047 GiB. FP16 or FP8 would be half or less.
  • Checks.
    • tests/test_validate_p4_ab.py passes (18), and pre-commit passes.
    • Both trees are clean: the checkout is at f898067, and the engine at c29a91692b.
    • p4b.log is empty (mtime 07:54:54).

@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: f898067bfe

ℹ️ 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 +213 to +217
if 'error' in summary[config]
or (
config != args.reference
and not all(m in summary[config] for m in ('generate', 'score'))
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject exact-replay probe differences

When the exact-replay server emits different tokens or top-20 logprobs, logit_probe.py compare still exits successfully and stores a comparison, while this validation rejects only errors or missing comparison keys. Consequently the required output-probe step passes and the A/B validator can issue a supported verdict even though the probe has refuted the proposal's end-to-end exactness; explicitly inspect the exact-replay comparison and abort on any observed difference.

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 7c894bd, before the job started. I cancelled it at 07:59:48 (its environment carried no SGLANG_/TRITON_/... variables) and requeued it at 08:01:54 at the same priority arrival.

  • logit_probe.py compare records identical, meaning tokens and top-k entries are equal everywhere and compared exactly, plus first_difference (sequence, position, kind). It exits 3 on any difference. quality_arms.py records both outcomes and treats any other exit as an error.
  • New required step output_probe.py reads the exact-replay arm and the dense repeat (plain+no_radix#2, the noise control) against the dense reference. Its outcome is: refuted (exact differs, control identical), undecided (the control differs), or no difference. It records the first differing positions.
  • validate_p4_ab.py requires that outcome. The verdict always reads "throughput <supported|rejected|inconclusive>; ". A refuted probe gives "end-to-end exactness REFUTED by the output probe; P4 exact claim not supported", never plain support.
  • README 2c states how the two combine.
  • Tests: 24 passed, including a top-k difference with identical tokens, compare's exit 3, the three outcomes and the refuted verdict wording.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (this withdraws the provisional approval at f898067)

Codex finished on f898067 with a P1 on quality_arms.py:217, and it is valid. logit_probe.py compare exits 0 when the exact-replay server's tokens or top-20 logprobs differ from dense. quality_arms.py rejects only errors and missing comparisons, so the required server-output-probe step passes. validate_p4_ab.py never reads the probe. A run whose probe has already refuted end-to-end exactness can therefore still end with decision: supported.

B1. Make the probe outcome part of the declared decision. Before the run, do two things:

  1. Abort before the A/B, or at least have the validator read the exact-replay comparison, whenever exact replay differs from dense in any token or top-20 logprob. The #2 dense repeat is the noise control, so compare against it.
  2. State the combination in the README declaration, for example: "a probe difference refutes P4's exact claim, and the run reports throughput only as context". Otherwise the declared decision and the script disagree.

The declared throughput rule itself is unchanged.

…he throughput

- logit_probe.py compare records whether the runs are identical in everything the probe
  sees (tokens and top-k entries, compared exactly) and the first differing sequence and
  position, and exits 3 when they differ; quality_arms.py records both outcomes and treats
  any other exit as an error.
- output_probe.py (a required step after the probe) reads the exact-replay arm and the dense
  repeat (noise control) against the dense reference: refuted, undecided (control differs)
  or no difference, with first differences.
- validate_p4_ab.py requires that outcome and reports the verdict as
  'throughput <decision>; <probe outcome>'; a refuted probe reads 'end-to-end exactness
  REFUTED by the output probe; P4 exact claim not supported', never plain support.
- README 2c states how the two combine. Tests: 24 passed.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional until Codex runs on 7c894bd; I'll re-check before merge)

Re-reviewed 7c894bd, committed 08:01:45 UTC, which fixes Codex's P1 on f898067.

  • logit_probe.py compare now exits 3 on a difference. It reports the first difference: a token, a top-k entry compared exactly, or a length. quality_arms.py treats 0 and 3 as results and anything else as an error. It is the only caller of compare in the repository.
  • output_probe.py, a required step, decides the probe from the comparisons.
    • refuted when exact replay differs and the plain+no_radix#2 dense repeat does not.
    • undecided when the dense repeat itself differs.
    • no difference otherwise, and the README says that this does not establish exactness.
    • A missing or incomplete comparison fails the step.
  • The verdict always carries the probe outcome. validate_p4_ab.py requires the probe result and phrases the verdict as "throughput ; ". A refutation reads "end-to-end exactness REFUTED … P4 exact claim not supported", so a refuted run can never read as plain support.
  • The README declaration matches the script. Section 2c now states this combination and names the noise control. The throughput rule is unchanged.
  • Checks.
    • tests/test_output_probe.py and tests/test_validate_p4_ab.py pass (24), and pre-commit passes.
    • Both trees are clean: the checkout is at 7c894bd, and the engine at c29a91692b.
    • p4b.log is empty (mtime 08:01:51).

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 7c894bd589

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

Codex finished on 7c894bd with no comments, so my provisional approval at 7c894bd (#94 (comment)) now stands without conditions.

@SamMausberg
SamMausberg merged commit 65a0a23 into main Oct 1, 2026
SamMausberg added a commit that referenced this pull request Oct 1, 2026
Moonshot P4: primary metric at exactly 128 running requests (follow-up to #94)
SamMausberg added a commit that referenced this pull request Oct 1, 2026
Appendix E.5: describe P4's declared served analysis (#94)
@SamMausberg
SamMausberg deleted the moonshot/p4-declaration branch October 1, 2026 14:35
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