Skip to content

Lossy levers: INT4 target + INT4 DFlash and FP16 GDN state against the tuned exact arms, with quality costs - #209

Merged
SamMausberg merged 25 commits into
mainfrom
lossy/results
Oct 2, 2026
Merged

SamMausberg merged 25 commits into
mainfrom
lossy/results

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

This PR adds the lossy-lever study: two declared approximations, each timed against bench's tuned exact arms and charged against the quality budget fixed in evidence/moonshot/README.md before any lossy measurement.

  1. INT4: the quantization-aware-distilled target nota-ai/Qwen3.5-4B-QAD-W4A16 with its INT4 DFlash drafter nota-ai/Qwen3.5-4B-DFlash-GPTQ-W4A16.
  2. FP16 GDN state: the recurrent state stored in FP16 instead of the checkpoint's FP32, at capacity 256.

Neither lever is exact, and nothing here calls them exact. The study was pre-registered at a5d605f and revised before any timed hold (a4321f4, 4654446, a8ae713, 1f89c2c, 5f149d2; two of the revisions came from the red team's design review). The probe reference was pinned by SHA-256 at ec91737 before the first quality hold. evidence/lossy/README.md has every result with the command behind each file.

Verdicts under the declared rules

Lever Speed (declared decision, three sessions) Quality against the declared budget Within budget
INT4 target + INT4 DFlash c = 1: x 1.015, no detectable change (a consistent +1.5%, inside the band); y 1.046, faster. Slower in x and y at every c from 2 to 256: y 0.72-0.87 of the best exact arm Logit probe fails in both modes on both probed arms: top-1 agreement 0.969-0.975 (floor 0.98), KL 0.0120-0.0125 nats (ceiling 0.01). GSM8K: the declared run failed (time limit, see below) No (probe)
FP16 GDN state y faster at c = 64, 128, 256: 1.163, 1.158, 1.171 against the best exact arm, every session beyond +2% Probe passes in both modes: at the reference's noise in score mode, which cannot see a state's decode-path error; on the decode path, the mode that sees it, 4-6.5 times the reference's divergence rate and about 7-8 times its KL, still 44-48 times inside the KL ceiling. GSM8K misses the rule (at least -1.0 point against both references): -0.99/-1.29 points (plain-cap256-fp16: meets it against plain-tuned-a, misses against -b by 0.29), -1.06/-1.36 (replayssm-cap256-fp16: misses against both, by 0.06 and 0.36) No (GSM8K)

Neither lever is within its declared band. On this GPU, INT4 is slower in both x and y at every concurrency above 1 and fails the probe. At c = 1 its throughput is 1.046 (faster under the declared rule) and its per-user rate a consistent +1.5%, inside the band. The FP16 state buys 16-17% throughput at c >= 64. It pays for that with a measured logit change and 1.0-1.4 points of GSM8K against the declared references (plain-tuned), which this check cannot tell from run-to-run variation. Against plain-tuned-replayssm, the exact family of the speed headline's denominator, the gap is larger, about 2.1 points (undeclared, below). That is "outside the band, stated as the trade", as the pre-registration says to report it. It does not mean the FP16 state has no quality cost.

Quality costs (measured)

INT4, logit probe (48 prompts × 256 greedy tokens against stock plain-cap256):

Arm Score mode: agreement, KL Decode path: agreement, KL Divergences per 1k shared tokens
int4-plain-cap256 0.9707, 0.0124 0.9737, 0.0122 27.1
int4-dflash-b8 0.9694, 0.0125 0.9750, 0.0120 25.6
reference noise 0.9940, 0.00025 0.9994, 0.00003 0.62

The INT4 target first diverges from the reference at a median of 26-27 tokens per sequence. Both arms probe the same target, since greedy speculative decoding emits the target's tokens.

FP16 state. Probe: score-mode agreement 0.9938 and 0.9937, KL 0.00027. Decode path: agreement 0.9960 and 0.9974, KL 0.0002, with 4.0 and 2.6 divergences per 1k shared tokens against the reference's 0.62. Score mode runs the chunked prefill kernel and cannot see a state's decode-path error (pre-registration), so the decode path is the informative mode. There the FP16 state changes the logits: it diverges 4-6.5 times as often as a second launch of the reference, with about 7-8 times its KL (0.00021-0.00023 against 0.00003), and stays 44-48 times inside the KL ceiling. GSM8K, paired by problem (1,319 problems, thinking on, seed 0), against bench's two plain-tuned runs (89.99%, 90.30%):

Run Accuracy vs plain-tuned-a vs plain-tuned-b
plain-cap256-fp16 89.01% -0.99 pt (95% CI -2.94, +0.97), McNemar p 0.36 -1.29 pt (-3.17, +0.60), p 0.21
replayssm-cap256-fp16 88.93% -1.06 pt (-2.95, +0.83), p 0.31 -1.36 pt (-3.27, +0.54), p 0.18

Bench's exact arms span -1.36 to +1.06 points against the same references, and the exact mtp-stockverify scores exactly -1.06/-1.36. Not declared, for context (evidence/lossy/quality/context/): against plain-tuned-replayssm (91.05%), the exact family of the speed denominator and the most accurate of bench's six exact runs, both FP16 runs are about 2.1 points lower (p 0.049 and 0.032), and so is the exact mtp-stockverify (-2.12, p 0.031). These p-values are nominal and would not survive a correction for the comparisons made. With one run per arm, the gap can't be split between that reference's draw and the FP16 state. Post hoc: the two FP16 runs (89.01%, 88.93%) sit level with the lowest of the six exact runs (88.93-91.05%) and below the other five. Their mean is 0.95 points below the exact runs' mean, against an exact run-to-run SD of 0.72 points (pooled t 1.76, 6 df, p 0.13).

Speed (measured), and why each lever moves it (derived)

Matched pairs differ only in the lever. INT4: 0.75-0.87 from c = 2 to 256. FP16: 1.17-1.31 for plain-cap256-fp16 over plain-cap256 and 1.10-1.17 for replayssm-cap256-fp16 over replayssm-cap256. The envelope's best exact arm at c >= 64 is replayssm-cap256, which is bench's buffered decoding (classed exact-up-to-rounding) at capacity 256. plain-tuned ran at c = 64 and 128 in every session and ranks below it, so the larger capacity inflates no ratio.

The INT4 drafter accepts 0.65-0.77 fewer tokens per pass. At c = 1 the INT4 verify pass takes 0.87 of the BF16 time, which about cancels the lower acceptance; from c = 2 the pass itself is slower. The exploratory GEMM microbenchmark (gemm_w4a16.json, approved after s1, not declared) explains why. Marlin W4A16 takes 0.69 of the BF16 time on the target's quantized projections at 1-8 rows and 0.75 at 16, then crosses over: 1.19 at 32 rows, 1.76 at 64, 1.99 at 256. A verify pass carries c times the block size in rows, so c = 1 (16 rows) is the only timed point before the crossover.

Predicted change in projection time per pass (target plus drafter on drafted arms, target only on plain decoding), against the measured change in time per pass (drafted: ITL p50 × accept length) or ITL p50 (plain):

c 1 2 4 8 16 32 64 128 256
Arm pair b16 b16 b16 b8 b8 b8 plain plain plain
Predicted (ms) -0.82 +0.48 +2.19 +2.19 +1.99 +3.69 +1.95 +1.79 +3.31
Measured (ms) -0.66 +0.41 +1.65 +1.18 +1.16 +2.29 +1.72 +1.64 +3.24

The sign is right at all nine points. The size agrees within 2-13% on plain decoding and within 17-23% on the drafted arms at c = 1-2. The microbenchmark overpredicts by 33% at c = 4 and by 61-87% at c = 8-32, where it gives the direction, not the size. The likely cause, untested, is the per-pass estimator on speculative arms: a median per-token gap times a mean accept length, while the two drafters' acceptance distributions differ. A server-side time per pass would settle it. Projections timed in isolation don't decompose the served time.

The FP16 state's gain matches its traffic (derived). The FP32 state is 50.3 MB per request, read and written once per decode step (evidence/moonshot/README.md section 1), so FP16 saves 50.3 MB per request per step. At the GDN kernel's measured 3.47-3.48 TB/s that is 0.93, 1.85 and 3.70 ms per step at c = 64, 128 and 256, against measured ITL p50 changes of -0.93, -1.84 and -3.52 ms.

Validity

  • Sessions s1-s3 (05:08-08:38 UTC, repository 5f149d2, engine 57560de690 clean for all 30 launches): 102 of 102 points valid under bench's rules. Mean foreign CPU was at most 0.58 cores per point (peak 1.54). Every launch passed every required check: CUDA graphs covering capacity, overlap scheduler, capacity, backend, speculative settings. The declared slow-launch check flagged nothing (largest TTFT excess 6.7 ms, largest per-pass excess 2.0%, never both at one point), so no decision has a second verdict.
  • Quality holds q1-q3 (repository ec91737): package versions equal the references' (the runner refuses otherwise), and every launch check passed. q2 and q3 sgl-eval exited 0. The probes ran in all three holds.

Failures and deviations

  • q1's GSM8K run of int4-dflash-b8 failed. It stopped at the hold's 1,500 s limit (exit 124) with 1,305 of 1,319 problems scored, so there is no declared GSM8K result for INT4. The limit was set from bench's GSM8K runs (13.5-18 min), and the INT4 drafted arm decodes at 0.75-0.77 of stock DFlash; the server didn't fail. It was not rerun: the arm is already outside its band on the declared probe, so a GSM8K number can't change its verdict. experiments/lossy/gsm8k_partial.py (new, not declared) reports what the finished problems show: -0.69 and -0.92 points against the two references, -0.23 against stock DFlash, none significant. The 14 unfinished problems are the slowest, not a random sample. Whatever they would have scored, the full-split difference lies in [-1.52, -0.45] against plain-tuned-a and [-1.82, -0.76] against -b, which leaves the declared GSM8K rule undetermined for INT4.
  • figures.py's quality-against-speed figure shifted each reference's point by 0.12 points to separate them. It now plots true values, dodged sideways, with the exact arms' spread and the INT4 bounds.
  • The pre-run revisions are listed in experiments/lossy/README.md. They covered the EOS override on the INT4 arms (the INT4 config.json drops <|endoftext|> from the stop set) and a load-test harness fault (an nsys-launched server outlived its step). Both were fixed before any timed hold.

Measured and derived

Measured: every speed ratio, accept length, memory figure, probe statistic and GSM8K accuracy, each on the runs named in the README. Derived: the INT4 GSM8K bounds, time per pass (ITL p50 × accept length), the GEMM-based explanation of the INT4 slowdown, the bandwidth explanation of the FP16 gain, and the post hoc comparison with the six exact GSM8K runs.

Changes after review

  • Red team (at 72b4929), all four items taken:
    • B1: all nine GEMM-predicted per-pass points are reported, and size agreement is claimed only where it holds.
    • B2: the FP16 probe verdict now separates score mode, which can't see state error, from the decode path, where FP16 diverges 4-6.5 times as often as the reference with about 7-8 times its KL.
    • F3: the speed denominator's reference family is named, and the unsupported "reference's high draw" apportioning is replaced by the post hoc comparison with the six exact runs.
    • F4: INT4's y at c = 1 is "faster" under the declared rule, and the unverified x/y reason is dropped.
    • Also from the red team's checks: the FP16 bandwidth derivation.
  • Reviewer 1 approved at 81ffb18; its three optional nits are in 96b74fa. The pre-registration was revised in five commits, not twice. INT4 is "slower at c >= 2" rather than "no faster" in TASKS.md and moonshot row 6, since y at c = 1 is a declared "faster". The post hoc comparison lists the six exact GSM8K accuracies and their files.
  • Red team re-check at 96b74fa: no blocking items. Its two factual nits are in 3e43fea. TASKS.md no longer says FP16 "misses the GSM8K rule by about 1 point": it is about 1 point lower and misses the -1.0 rule by 0-0.36 points against at least one reference. The verdict cells give the outcome per reference. Moonshot row 6's measured column adds INT4's y at c = 1 (1.046, faster).
  • Codex at 3e43fea (P1, experiments/lossy/hold.sh: timeout --foreground signals only its direct child), partly valid; the reply is in the thread.
    • No process can outlive the lock: scripts/gpu_job.sh is a child subreaper and terminates every descendant before it releases the lock.
    • But the session and quality backstop equalled run_hold.py's own budget (2,640 s), so it could cut off the last launch's cleanup and the final manifest write. It is now 2,760 s (7473768), and the header comment describes both limits. No hold reached either limit.
  • Codex at 7473768 (P2, experiments/lossy/load_test.py), valid, fixed in 5728ac7:
    • A step whose port could not be cleared now counts as failed, the unreached steps are recorded as skipped, and the load test exits 1 if either is non-empty.
    • tests/test_lossy_load_test.py covers both cases. The committed L0/L0b records are unaffected: L0 predates the port check, and L0b cleared the port after all seven steps.
    • Same commit: hold.sh's header comment names the one case gpu_job.sh cannot clean up (a wrapper killed with SIGKILL) and the drain wait that covers it (reviewer's note).
  • Reviewer 1: the project-wide status lines (TASKS.md, evidence/moonshot/README.md portfolio rows 3 and 6 and the lever table, evidence/stack/README.md) now state these results instead of "queued", "pending" or "likely near-lossless".

What is in the PR

  • bench/arms.toml: the five lossy arms, plus plain-cap256 and replayssm-cap256, which are exact flags plus capacity 256.
  • engine/sglang/patches/lossy/0001 and its README section. SGLang builds the DFlash drafter's fc as a plain nn.Linear, so a quantized drafter's packed fc weights were skipped silently and fc stayed uninitialised: the drafts were garbage, though the outputs stayed correct. The patch builds fc with the quantization config and refuses a load that leaves it unset. Unquantized drafters are unchanged apart from that check.
  • experiments/lossy/: the pre-registration, plan, hold runner, load test, declared analysis, figures, checkpoint check, GEMM microbenchmark and the partial GSM8K script.
  • evidence/lossy/: points, launches, decisions, ratios, figures, GSM8K summaries, probe summaries (the 6.6 MB raw probe files stay outside git, with SHA-256s in the README), hold manifests, load test, checkpoint check, GEMM record.
  • tests/test_lossy_analyze.py, tests/test_lossy_gsm8k_partial.py and tests/test_lossy_load_test.py (CPU only).

The branch is origin/main (0821e6d) with lossy/int4-fp16 merged in, not rebased. That keeps the commits the evidence records reachable: sessions 5f149d2, quality holds ec91737, GEMM 90e45bf.

Checks

  • pytest -q tests/test_lossy_analyze.py tests/test_lossy_gsm8k_partial.py tests/test_lossy_load_test.py: 15 passed (CPU, at 5728ac7).
  • pre-commit run --files <every file the branch changes>: every hook passed (ruff check and format, mypy, codespell, shellcheck, the host-identity guard); the guard also ran on the evidence commit's staged files.
  • The evidence was regenerated from committed code: analyze.py at 08c4357 (unchanged since ec91737), the figures at c25b2bc, and the context comparisons with bench.quality compare at c25b2bc. The exact commands are in evidence/lossy/README.md.
  • Not run: scripts/verify_artifact.py, because no bundle code changed. No GPU work was done after the holds named above, and nothing new was installed.

…he quantized drafter, load test L0

Adds seven arms to bench/arms.toml (lossy INT4 target with its INT4 DFlash
drafter at block 16 and 8, INT4 plain, FP16 GDN state on plain and buffered
decoding, and stock/exact capacity-256 baselines), engine/sglang/patches/lossy/0001
(the drafter's compressed-tensors context projection was silently left
uninitialised), and the untimed load test with its hold entry point.
… runner and declared analysis

Three session-paired exclusive holds over nine arms (INT4 target + INT4 DFlash at
block 16/8, INT4 plain, FP16 GDN state on plain and buffered decoding, and their
exact tuned baselines), two quality holds (GSM8K on int4-dflash-b8 and
plain-cap256-fp16 against bench's two plain-tuned runs; logit probe score and
generate modes against the L0 reference), a 2% decision band, and analyze.py.
…r-problem pairing (pre-run revision, 2026-10-02 03:20 UTC)
…thout-flagged verdicts (pre-run revision, 2026-10-02 03:30 UTC)
…imed hold): red team's design review

Decode-path probe criterion for every probed arm; GSM8K also on
replayssm-cap256-fp16 (hold q3) with only GSM8K-measured arms in the FP16
envelope; plain-tuned in every session at c=64/128 as an exact arm; non-headline
arms at both ends of the session order; GSM8K yardstick from bench's exact
arms, stock DFlash comparison, version and EOS checks (checkpoint_check.py),
runner-up ratios and accept lengths.
…imed hold): decode-path KL includes the first divergence, per-lever GSM8K gate, drift note for the end-of-order pair
…ms, load test kills the nsys server group and clears the port per step, L0b step selection, mypy and ruff fixes

The resolved stop sets differ: BF16 Qwen3.5-4B stops on {248044, 248046}, the
INT4 checkpoint (top-level eos_token_id 248046 in config.json) on {248046} only.
The INT4 arms now pass json-model-override-args eos_token_id 248044, giving the
BF16 stop set; timed runs (ignore_eos) are unaffected.
…lared)

Hold q1's GSM8K run of int4-dflash-b8 hit its 1,500 s limit with 14 of 1,319
problems unfinished, so the declared paired comparison does not exist. The
script reports the paired comparison on the finished problems and bounds on the
full-split difference that hold whatever the unfinished problems would have
scored, labelled as outside the pre-registration.
…ad, INT4 partial bounds

The previous version shifted each reference's point by 0.12 points to separate
them, which misplotted the GSM8K differences; points now sit at their values,
dodged sideways. The band shows bench's exact arms against the same references,
labels no longer collide, and --partial-gsm8k adds the full-split bounds of the
INT4 run that stopped early, marked as not declared.
…nder the declared rules

Speed (three valid sessions, 102 points, no slow-launch flags): INT4 target +
INT4 DFlash shows no detectable change in x at c = 1 (1.015) and is slower in y
at every c from 2 to 256 (0.72-0.87 of the best exact arm); the FP16 GDN state
is faster at c = 64, 128, 256 (1.163, 1.158, 1.171 against replayssm-cap256).

Quality against the declared budget: INT4 fails the logit probe in both modes
(top-1 agreement 0.969-0.975, KL 0.0120-0.0125); its GSM8K run in q1 stopped at
the 1,500 s limit at 1,305 of 1,319 problems and has no declared result (partial
comparison and full-split bounds, not declared, in quality/...-partial). The FP16
state passes the probe at about the reference's noise and misses the GSM8K rule
(-0.99/-1.29 and -1.06/-1.36 points against the two references), inside bench's
exact arms' spread. Both levers are outside the declared band.

Includes points.csv, launches.csv, decisions.json, ratios.csv, the figures, the
GEMM microbenchmark record, GSM8K run summaries, probe summaries, hold manifests
and undeclared context comparisons; evidence/lossy/README.md gives the command
behind each file.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T14:52:04.260435Z b031154 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 72b49299ed

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

Reviewer 1 on #209: evidence/moonshot/README.md still called FP16 state "lossy,
likely near-lossless" with quality pending, and TASKS.md said the lossy load
test was queued. The status lines now state the result: FP16 state is faster at
c >= 64 (1.163x, 1.158x, 1.171x over the best exact arm), passes the logit probe
and misses the GSM8K rule by about a point (inside the exact arms' spread), so it
is outside its band with the trade stated; the INT4 target with its INT4 drafter
fails the probe and is no faster. evidence/stack/README.md's inventory lines and
the single-run lever table get the same update.
…raming, references, c = 1)

B1: report all nine GEMM-predicted against measured per-pass changes and claim
size agreement only where it holds (plain decoding within 2-13%, drafted c = 1-2
within 17-23%); at drafted c = 4-32 the microbenchmark overpredicts by 33-87%
and gives the direction only; the per-pass estimator (ITL p50 x mean accept) is
named as the likely, untested cause.
B2: the FP16 probe verdict separates score mode (at the reference's noise, blind
to decode-path state error) from the decode path (4-6.5 times the reference's
divergence rate, 7-8 times its KL, 44-48 times inside the ceiling).
F3: the trade names both references (declared plain-tuned, 1.0-1.4 points; the
speed denominator's family plain-tuned-replayssm, about 2.1 points, undeclared);
the unsupported apportioning sentence is replaced by the post hoc comparison
with the six exact runs (0.95 points below their mean, SD 0.72, t 1.76, p 0.13);
context p-values are labelled nominal.
F4: INT4's y at c = 1 is "faster" (1.046) under the declared rule, x a consistent
+1.5% inside the band; the unverified reason for the gap is dropped.
Adds the derived FP16 state-bandwidth account (0.93/1.85/3.70 ms predicted,
0.93/1.84/3.52 ms measured at c = 64/128/256).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 81ffb18

I reviewed 72b4929 in full, then the two commits on top of it, against the pre-registration in experiments/lossy/README.md. The CPU work ran in a CPU window from a fresh worktree.

Regenerated (all byte-identical to the committed files)

  • bench.pareto gives sessions/points.csv and launches.csv. The README's analyze command gives decisions.json and ratios.csv, using the raw probes. The raw probe files' SHA-256 values equal the README's table, including plain-ref-1 5186472b....
  • gsm8k_partial gives partial.json and problems.csv. The four bench.quality compare commands give context/*.json.
  • figures.py gives all three figures. I viewed quality_speed.png: the FP16 points sit at their true differences (-0.99/-1.29, -1.06/-1.36) at speed ratios 1.132/1.151/1.158/1.171, with only a ±0.00075 sideways dodge that the docstring states. The INT4 bars are the full-split bounds, and the exact arms' spread band runs from -1.36 to +1.06.
  • The two FP16 quality.json/problems.csv copies, all six hold manifests and the four probe summaries equal their raw sources. tests/test_lossy_*: 13 passed.

Validity under the pre-registration

  • Sessions s1-s3 ran 05:08-05:46, 06:59-07:37 and 08:00-08:38 UTC from 5f149d2, after every revision; the last, revision 4, committed at 03:39. s2 reversed the order, each session took 38 minutes (the cap is 44), and every launch exited 0.
  • q1-q3 ran from ec91737, after the probe reference was pinned (09:03). analyze.py, plan.py and run_hold.py are unchanged since then. The package versions equal the references'.
  • Every hold ran on engine 57560de690.
  • 102 of 102 points are valid: 0 failed, mean foreign CPU at most 0.575 cores, maximum 1.54. All 30 launches show no failed check and a clean SGLang tree.
  • The GEMM bench was committed after s1 (05:51; s1 ended 05:46) and is labelled exploratory. plan.GSM8K_TIMEOUT = 1,500 s has been declared since a5d605f.

Verdicts against the declared rules (from decisions.json)

  • INT4:
    • x at c = 1 is 1.015 (sessions 1.014-1.016), all inside ±2%, so no detectable change. y at c = 1 is 1.046, faster.
    • x and y are slower at every c from 2 to 256 (y 0.715-0.870).
    • The probe fails in both modes: 0.9707/0.0124 and 0.9737/0.0122; 0.9694/0.0125 and 0.9750/0.0120.
    • The q1 GSM8K run is reported as a failure (exit 124 at 1,560 s against the 1,500 s limit). The finished-problem comparison and the full-split bounds are labelled not declared. I recomputed the bounds: 1,167 of 1,305 solved gives [-1.52, -0.45] against plain-tuned-a and [-1.82, -0.76] against -b, so the rule is undetermined.
  • FP16 state:
    • The envelope is 1.163, 1.158 and 1.171 over replayssm-cap256, with every session beyond +2%. The matched pairs and runner-ups (1.169/1.250/1.330, 1.098/1.132/1.151) match the README.
    • The probe passes in both modes: 0.9938/0.00027, 0.9960/0.00021; 0.9937/0.00027, 0.9974/0.00023.
    • GSM8K: -0.99/-1.29 and -1.06/-1.36, with the Wald intervals, McNemar p 0.36/0.21/0.31/0.18 and the discordant counts as tabulated. That misses the -1.0 rule against both references, and it is stated as the trade.
  • No lossy arm is called exact or lossless. bench/arms.toml and launches.csv class all five lossy arms as lossy. After c6f5705, the moonshot portfolio row 3 no longer says "likely near-lossless", and nothing else in the tree's Markdown says so.

Derivations and the undeclared comparison

  • GEMM against per pass, from gemm_w4a16.json per_forward_totals and the session means:
    • W4A16/BF16 is 0.68-0.69 at 1-8 rows, 0.75 at 16, then 1.19, 1.76, 1.64 and 1.99; the drafter is 1.01 at 32.
    • Predicted changes: -0.82, +0.48, +2.19, +2.19, +1.99 and +3.69 ms on the drafted arms (target plus drafter at c x block rows), and +1.95, +1.79 and +3.31 ms on plain decoding (target only).
    • Measured changes: -0.66, +0.41, +1.65, +1.18, +1.16 and +2.29 ms (drafted), and the ITL p50 differences +1.72, +1.64 and +3.24 ms (plain).
    • The 81ffb18 table and its reading are right: the sign holds at all nine points, the size is close on plain decoding, and the 61-87% overprediction at c = 8-32 is given as the direction only, with an untested cause.
  • FP16 bandwidth: 50.3 MB saved per request per step at 3.47-3.48 TB/s gives 0.93, 1.85 and 3.70 ms. The measured ITL p50 changes are -0.93, -1.84 and -3.52 ms, within 5%, and labelled derived.
  • The plain-tuned-replayssm context: -2.05 (p 0.049), -2.12 (p 0.032), mtp-stockverify -2.12 (p 0.031), and FP16 against FP16 -0.08 (p 1.0). It is labelled not declared, with nominal p-values. I recomputed the post hoc pooled t from the six exact accuracies: mean gap 0.95, exact standard deviation 0.72, t 1.76 with 6 df, p 0.13.
  • The probe framing is accurate: decode-path KL is 7.0-7.7 times the reference's 0.00003, and 44-48 times inside the ceiling.

Status lines (c6f5705)

TASKS.md (H7, the lossy row, the M-items), moonshot rows 3 and 6 and the single-run table cell, and the stack README now state the measured outcomes. Their numbers match the evidence.

Codex found no major issues at 72b4929 and is re-requested on 81ffb18; the merge should wait until it is clean. check_host_identity.sh passes, and no commit has an attribution line.

Optional

  1. experiments/lossy/README.md, pre-registration intro: "revised twice before any timed hold", but the Revisions list has five revisions (a4321f4, 4654446, a8ae713, 1f89c2c, revision 4).
  2. TASKS.md (lossy row) and moonshot row 6: "no faster". y at c = 1 is a declared "faster" (1.046). "No faster at its headline points" would be exact.
  3. The post hoc t-test says "derived from the committed accuracies". Listing the six exact accuracies (89.99, 90.30, 89.54, 88.93, 89.69, 91.05) or naming the files would make it checkable at a glance.

…six exact GSM8K runs)

experiments/lossy/README.md: the pre-registration was revised in five commits,
not twice. TASKS.md (lossy row) and moonshot portfolio row 6: INT4 is slower at
c >= 2 rather than 'no faster', since y at c = 1 is a declared 'faster' (1.046).
evidence/lossy/README.md: the post hoc comparison lists the six exact GSM8K
accuracies and their files.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 96b74fa

Delta review of 81ffb18..96b74fa. The commit changes text only; no evidence file changed.

  1. experiments/lossy/README.md now reads "revised in five commits", which matches the Revisions list.
  2. The TASKS.md lossy row and moonshot row 6 now read "slower at c >= 2 (at c = 1, y 1.046, faster; x within the band)", which matches decisions.json. No "no faster" remains in TASKS.md, README.md or the evidence and experiment READMEs.
  3. The six exact GSM8K accuracies listed match each run's quality.json in evidence/bench/quality/: 88.93, 89.54, 89.69, 89.99, 90.30 and 91.05%.

No host identity appears and the commit has no attribution lines. Codex is re-requested; the merge should wait until it is clean.

… c = 1 in moonshot row 6

Red team's nits on #209: TASKS.md said FP16 state 'misses the GSM8K rule by about
1 point'; it is about 1 point lower (-0.99 to -1.36) and misses the -1.0 rule by
0-0.36 points against at least one reference (plain-cap256-fp16 meets it against
plain-tuned-a). The lossy README's verdict cell now gives the outcome per
reference. Moonshot portfolio row 6's measured column adds INT4's y at c = 1
(1.046, faster).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 3e43fea

Delta review of 96b74fa..3e43fea (text only). I checked the per-reference outcomes against decisions.json:

  • plain-cap256-fp16: -0.986 meets the -1.0 rule against plain-tuned-a; -1.289 misses against -b by 0.29.
  • replayssm-cap256-fp16: -1.061 and -1.365 miss by 0.06 and 0.36.

Moonshot row 6's "y 1.046 at c=1 (faster)" matches the envelope. One nit, not blocking: in TASKS.md, "missing the -1.0 rule by 0-0.36 points" would be exact as "by 0.06-0.36 points", since the smallest miss is 0.06.

No host identity appears, the commit has no attribution lines, and Codex is re-requested.

@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: 3e43fea160

ℹ️ 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/lossy/hold.sh
shift
steps=()
[ "$#" -gt 0 ] && steps=(--steps "$@")
timeout --foreground 2640 scripts/gpu_startup_lock.sh \

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 Time out the entire GPU process tree

At the 2,640-second boundary, --foreground sends the timeout signal only to gpu_startup_lock.sh, not to load_test.py or its server descendants; GNU timeout --help explicitly states that in this mode, “children of COMMAND will not be timed out.” The wrapper can therefore release the GPU lock while the orphaned load test continues and starts later steps, allowing it to overlap and corrupt another GPU experiment; the same option on the session/quality invocation can also strand the active launch and prevent Hold.kill_child() and the final manifest write. Remove foreground mode or add signal handling/headroom so the whole tree is stopped and recorded before the outer deadline.

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.

Partly valid. The manifest point is fixed in 7473768; the GPU-overlap scenario can't occur under the lock wrapper.

  • GPU overlap: not reachable here. Every hold runs under scripts/gpu_job.sh, through gpu_lock.sh, and that wrapper is a child subreaper. When timeout --foreground signals only gpu_startup_lock.sh, load_test.py and any server it started (servers run in their own session) are reparented to the wrapper. When hold.sh exits, the wrapper TERMs the job's process group and every other descendant, then KILLs whatever is left, repeating until a scan finds nothing. Only then does it exit and release the lock (stop_job and the header comment in scripts/gpu_job.sh). The next exclusive job also runs gpu_drain_wait.sh, which waits for leftover GPU processes and SGLang servers. An orphan therefore can't keep running once the lock is free. --foreground stays because plain timeout moves its child into a new process group, outside the group the wrapper signals as a unit.
  • Manifest: valid, fixed. The outer limit equalled run_hold.py's own plan.HOLD_BUDGET (2,640 s). The outer TERM could therefore arrive while run_hold was stopping the last launch (kill_child can take about 70 s) and end it before the final manifest write. The session and quality backstop is now 2,760 s, so run_hold's own deadline ends the launch with its process tree and writes the manifest first. The header comment of hold.sh now describes both limits and the containment.

No hold in this study reached either outer limit. q1's GSM8K timeout was run_hold's per-launch limit (1,500 s), and its manifest records it (exit 124).

…209)

The outer timeout of a session or quality hold equalled run_hold.py's
plan.HOLD_BUDGET (2640 s), so its TERM could end run_hold while it was stopping
the last launch (kill_child takes up to about 70 s) and before the final manifest
write. The backstop is now 2760 s. The header comment describes both limits and
why --foreground cannot leave a process running past the lock: scripts/gpu_job.sh
is a child subreaper and terminates every process the hold started before it
releases the lock. No hold of this study reached either outer limit.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (head 7473768; provisional on Codex, which is running on this head)

This is a delta review of 3e43fea..7473768: one commit, which changes only experiments/lossy/hold.sh. No evidence changed.

The backstop. run_hold.py sets its deadline in Hold.__init__, at plan.HOLD_BUDGET = 2640 s. A launch that is still running at the deadline returns from wait(timeout) and goes through kill_child: TERM and up to 30 s, KILL and up to 30 s, then wait(10), so at most 70 s. After that come the log read and the final manifest write. The worst case is about 2711 s plus Python's startup before Hold() is constructed, which fits inside the new 2760 s backstop. The old 2640 s backstop could cut kill_child short and lose the manifest, as Codex said. The new header comment describes this accurately.

The reply's account of gpu_job.sh (origin/main, unchanged on this branch). It is accurate:

  • The wrapper becomes a child subreaper (prctl(36, 1)) before anything starts.
  • stop_job runs when the command exits and when the wrapper is signalled. It TERMs the job's group and every stray descendant, waits the grace period, then KILLs until a scan finds nothing (up to 10 rounds). Only after that does the lock go.
  • On the load path, gpu_startup_lock.sh has no TERM trap, so timeout --foreground ends it and load_test.py is reparented to the wrapper. hold.sh's EXIT trap kills the port-30101 servers, and the wrapper stops whatever is left before it releases the lock.

One limit: gpu_job.sh's own header names the exception, a wrapper killed by SIGKILL, where gpu_drain_wait.sh is the backstop. The new comment's "no process outlives the hold" holds for every exit that goes through the wrapper. Optional: add "(short of the wrapper itself being SIGKILLed)".

"No hold of this study reached either outer limit." This holds, from ~/vp-data/lossy/holds/*.json and the logs:

  • Sessions s1-s3 ran 2286-2289 s, with 0 failed launches and none skipped.
  • The quality holds ran q1 1767 s, q2 1084 s and q3 1091 s. q1's exit 124 is its first launch's own timeout, not the hold limit.
  • The load holds ran 3 min 19 s and 8 min 52 s, and gemm ran 20 s.

Checks. shellcheck and hold_lint.sh are clean on the new hold.sh. The author and committer are Samuel Mausberg, and the commit has no attribution lines. The hostname grep on the delta is clean. The reply to Codex P1 4165956817 (4166275338) answers both halves of that comment. This approval becomes final once Codex is clean on 7473768.

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

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

print(f'=== {name}', flush=True)
record = run_step(known[name], root, worktree, tok)
# A server that outlived its step would make every later step fail on the port.
record['port_cleared'] = clear_port()

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 Fail the load test when the port cannot be cleared

When clear_port() returns false after an otherwise successful step, record['ok'] remains true, the loop stops before running the remaining declared steps, and the final failed list excludes this step, so the load test exits 0 with an incomplete L0 run. Incorporate port_cleared into the failure status (and report the skipped steps) so callers cannot treat this aborted run as successful.

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.

Valid; fixed in 5728ac7. A step whose port could not be cleared now counts as failed even when its own checks passed. The steps the loop never reached are recorded as skipped in load_test.json, and main() exits 1 when either list is non-empty. tests/test_lossy_load_test.py drives main() with the GPU work stubbed and covers both cases: a port left occupied after the second of three steps gives exit 1, with that step in failed and the third in skipped; a complete run gives exit 0. The committed L0/L0b records are unaffected. L0 predates clear_port, and L0b cleared the port after all seven steps.

…odex on #209)

When clear_port() failed after a step whose own checks passed, the loop stopped
before the remaining steps, but the step stayed ok and the skipped steps were
not counted, so the load test exited 0 with an incomplete run. Such a step now
counts as failed, the unreached steps are recorded as skipped, and main() exits
1 if either list is non-empty; tests/test_lossy_load_test.py covers both cases.
The committed L0/L0b records are unaffected (L0 predates clear_port; L0b cleared
the port after all seven steps). hold.sh's header comment also names the one
case gpu_job.sh cannot clean up, a wrapper killed with SIGKILL, and the drain
wait that covers it (reviewer's note).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (head 5728ac7; provisional on Codex, which is running on this head)

This is a delta review of 7473768..5728ac7: one commit, which fixes Codex P2 4166306678 and adds my optional note to hold.sh. No evidence changed.

  • load_test.main. port_cleared is set on every record before it is appended. A step counts as failed unless it has both ok and port_cleared. The steps after a break are recorded as skipped, and the run exits 1 if either list is non-empty. That closes the case Codex described, where a port left occupied after a passing step ended the run with exit 0.
  • Tests. The two new tests in tests/test_lossy_load_test.py drive main() with the GPU work stubbed. With a port left occupied after step 2 of 3 the run exits 1, with failed [step 2] and skipped [step 3]; a complete run exits 0. I ran the lossy tests in an untimed window: 15 passed. Pre-commit on the three files is clean, including shellcheck and mypy.
  • No evidence change. l0_20261002T033138Z.json predates clear_port (no port_cleared) and already lists 7 failed steps. l0b_20261002T035539Z.json has ok and port_cleared true on all 7 steps, so the new rule gives failed [] and skipped [] for it, as committed.
  • hold.sh. The header now names the SIGKILL exception and gpu_drain_wait.sh as the backstop, which is accurate.
  • Other checks. The author and committer are Samuel Mausberg, with no attribution lines, and the hostname grep on the delta is clean. The Codex thread has a reply (4166749251).

This approval becomes final once Codex is clean on 5728ac7.

@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: 5728ac7685

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

record['log_facts'] = log_facts(server.log_text())
record['log_tail'] = server.log_tail(30)
record['end_unix'] = time.time()
record['ok'] = bool(record.get('launch_ok')) and 'error' not in record

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 Fail a load-test step on tokenizer mismatches

When check_tokenizer() returns ok: false, no exception is raised and this assignment still marks the step successful as long as the server launch checks passed. An arm with a tokenizer mismatch therefore leaves failed empty and allows L0 to exit 0, despite tokenizer equality being a required validation before the arm is timed; include the tokenizer result in record['ok'].

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.

Correct about the harness: a tokenizer mismatch does not fail the step's ok. Not changed in this PR, because no committed result or claim depends on it.

  • Every step that ran has tokenizer.ok: true: 2 of 2 in L0 (the other seven failed only on the port fault, fixed before L0b) and 7 of 7 in L0b (evidence/lossy/load_test/l0*_*.json).
  • The README's tokenizer statement ("on every arm the server's token ids for 16 templated prompts equal those of the Qwen/Qwen3.5-4B tokenizer") reads that per-step field directly. The GO decision before the timed sessions was made from the same field, not from the exit status.
  • The study's holds are finished, and this load test will not run again for these results.
    This is hardening for a future run. I'll fold tokenizer.ok into record['ok'] if the harness is reused.

Comment on lines +355 to +357
reference = json.loads(Path(summary['reference']).read_text())
decode = decode_path(
reference, json.loads((summary_path.parent / 'probe_generate.json').read_text())

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 Verify raw probe files before deriving decisions

The documented analysis reads these probe inputs from mutable paths outside git, but it neither checks summary['reference_sha256'] before loading the reference nor verifies the candidate probe_generate.json. If either raw file is replaced, truncated, or copied incorrectly, rerunning the command silently derives different decode-path statistics and quality verdicts while the committed summaries still identify the original reference hash; record and validate hashes for both inputs before analysis.

AGENTS.md reference: AGENTS.md:L15-L18

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.

Agreed that a rerun should verify its raw inputs. Not changed in this PR, because the committed results already carry what is needed to check them, and the values in decisions.json cannot have come from unverified files:

  • Reference. run_hold.py probe refuses to run unless the reference's SHA-256 equals plan.REFERENCE_PROBE_SHA256, pinned at ec91737 before the first quality hold. Every committed probes/*/probe_summary.json records that hash (5186472b...c968f7).
  • Candidates. evidence/lossy/README.md ("probes/") lists the SHA-256 of every raw input the analysis reads: the four candidates' probe_generate.json and probe_score.json, and both reference launches. They were computed in the same job, immediately after decisions.json was generated. A rerun checks them with sha256sum before running the documented command.

Building that check into analyze.py is hardening for future reruns, not a fix to a committed result. Doing it here would also change the declared analysis code after its results were produced, so I've left it as a follow-up.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (head 5728ac7; final)

Codex finished on 5728ac7 with two P2s (4166792629, 4166792644). Both are answered with an explicit scope and no code change. I checked each factual claim in the replies:

  • 4166792629, the tokenizer result is not part of record['ok']. The harness gap is real, as the reply says, but no committed result depends on it. In the committed load-test records, every step that ran has tokenizer.ok true: 2 of 2 in l0_20261002T033138Z.json (the other seven steps failed at launch on the port fault, before any tokenizer check) and 7 of 7 in l0b_20261002T035539Z.json. The README's tokenizer statement (line 386) is about that per-step result.
  • 4166792644, analyze.py does not hash-check its raw inputs.
    • run_hold.py probe exits unless the reference's SHA-256 equals plan.REFERENCE_PROBE_SHA256 (lines 275-279).
    • That value (5186472b…c968f7) was pinned in ec91737 at 09:03 UTC, before q1 started at 09:11, and all four committed probe_summary.json files record it.
    • The 12 raw inputs listed in the README (lines 304-315: the four candidates' probe_generate.json and probe_score.json, and both reference launches) all match their listed SHA-256 on disk (sha256sum -c, 12 of 12 OK).

So both replies are accurate and scoped, and moving the checks into the harness is a fair follow-up for a rerun. With Codex finished, my approval at 5728ac7 stands as final.

Conflict in TASKS.md only, between adjacent rows: main (#210) changed H6 and this
branch changed H7; both kept (H6 from main, H7 from this branch).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg

SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (head b031154, the merge of origin/main into lossy/results; provisional on Codex for the merge commit)

This checks the merge resolution only. The content is my approved 5728ac7.

The approval becomes final once Codex is clean on b031154.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b03115448f

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

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