Repository navigation
Moonshot: declare P4's served A/B analysis before the run - #94
Conversation
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.
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: 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".
| - 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. |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
Verdict: REQUEST CHANGES Reviewed head 37fe05d, committed 2026-10-01 07:12:34 UTC. It adds 22 lines to Integrator checks
BlockingB1 (Codex P1,
This only narrows a claim and leaves the decision rule as it is. Still, land it before SuggestionThe declaration names |
…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).
|
Verdict: APPROVE Re-reviewed 4054d71, committed 07:16:51 UTC.
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. |
|
@codex review |
There was a problem hiding this comment.
💡 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".
| 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" |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| 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)"' |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| 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' \ |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
@codex review |
There was a problem hiding this comment.
💡 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".
| 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') |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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).
|
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
Suggestion (not blocking): |
|
Verdict: REQUEST CHANGES (this withdraws my provisional approval at 7d7c371) Codex finished on 7d7c371 with a P1 on B1. Before a point can count toward the verdict, the validator must require:
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: |
…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.
|
@codex review |
|
Verdict: APPROVE Re-reviewed aefef2d, committed 07:28:45 UTC, which fixes Codex's P1 on 7d7c371.
Codex has not run on aefef2d. If you trigger it, I'll re-check before merge. Everything else from my earlier comments stands. |
There was a problem hiding this comment.
💡 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".
| data = json.loads(runs[0].read_text()) | ||
| points = [p for p in data.get('points', []) if p.get('concurrency') == 128] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| if not (point.get('server_log') or {}).get('logged_gen_tps_full_batch'): | ||
| fail(f'{label}: no token-weighted server full-batch decode rate') |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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).
| except Exception as exc: | ||
| point['flashinfer_error'] = repr(exc)[:300] |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
@codex review |
|
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.
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. |
There was a problem hiding this comment.
💡 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".
| 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 \ |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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).
|
@codex review |
|
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.
|
There was a problem hiding this comment.
💡 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".
| 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: /' |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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 --porcelainmust 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.
|
Verdict: REQUEST CHANGES (this withdraws the provisional approval at b8cfa66) Codex finished on b8cfa66 with a P1 on B1. Make it a required preflight, before any measurement, that both the repository checkout and Right now both trees are clean: |
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.
|
@codex review |
|
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.
|
There was a problem hiding this comment.
💡 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".
| 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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
Verdict: REQUEST CHANGES (this withdraws the provisional approval at 12e6fcb) Codex finished on 12e6fcb with another inherited-environment P1 ( 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:
The queued job (gpu_lock pid 3834932) has no |
…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.
|
@codex review |
|
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.
|
There was a problem hiding this comment.
💡 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".
| if 'error' in summary[config] | ||
| or ( | ||
| config != args.reference | ||
| and not all(m in summary[config] for m in ('generate', 'score')) | ||
| ) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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 comparerecordsidentical, meaning tokens and top-k entries are equal everywhere and compared exactly, plusfirst_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.
|
Verdict: REQUEST CHANGES (this withdraws the provisional approval at f898067) Codex finished on f898067 with a P1 on B1. Make the probe outcome part of the declared decision. Before the run, do two things:
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.
|
@codex review |
|
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.
|
|
Codex Review: Didn't find any major issues. Hooray! 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". |
|
Codex finished on 7c894bd with no comments, so my provisional approval at 7c894bd (#94 (comment)) now stands without conditions. |
Moonshot P4: primary metric at exactly 128 running requests (follow-up to #94)
Appendix E.5: describe P4's declared served analysis (#94)
Records the analysis of P4's served A/B in
evidence/moonshot/README.md(section 2c). It iscommitted before
run_p4b.shstarts, 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 thequeued 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.pyandlever_sweep.pyexit non-zero when a configurationof the invocation fails.
validate_p4_ab.pychecks the fresh A/B directory (eight armswith 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 runsthe script from this branch's checkout.
No results change.
pre-commit runpasses on the changed files.