Skip to content

Upstream PR: Drama 3's GB10 check script passes on a GB10 after #4144 - #4463

Merged
ashhart merged 14 commits into
ashhart:mainfrom
plotarmordev:feat/166-upstream-pr-drama-3-s-gb10-check-script-
Nov 24, 2026
Merged

ashhart merged 14 commits into
ashhart:mainfrom
plotarmordev:feat/166-upstream-pr-drama-3-s-gb10-check-script-

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does at bac7a495

  • Head commit: bac7a495fb23d586402a0be903dcfcc21bc2d52d, over its merge-base with ashhart main, 2ce240cf028425bfa80b2cf63d9f029c8ee580c6.
  • The gate (tools/zig/drama3_replay_gate.sh, called by tools/zig/drama3_compact_gb10.sh): in zig/src/families/drama3/replay.zig, a PCM difference at codec chunk 4 or 16 against chunk 1 is recorded, not returned early: every fork-lane exact check (frames and PCM in both lanes) still runs, and any exact mismatch still ends in ReplayMismatch. Only when every exact check passed does replay print the distinct Drama replay PCM only: codec chunk N against 1, max abs …, RMS …; every exact check passed line and end in ReplayPcmOnly; the gate passes that line and nothing else, and the script reports the chunk 4 and 16 PCM as INFO.
  • Gate tests: python3 tools/zig/drama3_replay_gate_test.py -v at bac7a495: 11 passed, 0 failed, 0 skipped.

Commits (history; older heads and main merges included)

No visible change: nothing this PR changes shows on screen.

How to check

  • Base commit (main): 2ce240cf028425bfa80b2cf63d9f029c8ee580c6
  • Head commit: 24f3cd1d82628ad2c014e4f1cf9ce2f66f063008
  • Machine: an Apple Silicon Mac; NVIDIA GB10 for replay probe · macOS 27.0; Linux on GB10 · Zig 0.17.0, Python 3; CUDA 13.0

Test results:

  • nice -n 10 zig build test test-golden --summary failures at 31f9d3feb76b (older head): 16563 passed, 3 failed, 141 skipped
  • python3 tools/zig/drama3_limits_gate_test.py at 31f9d3feb76b (older head): 8 passed, 0 failed, 0 skipped
  • zig build test test-golden at 2820270cdeb7 (older head): 16511 passed, 5 failed, 143 skipped
  • python3 -m unittest discover -s tools/zig -p 'drama3_*_gate_test.py' -v at 9956e67317f8 (older head): 14 passed, 0 failed, 0 skipped
  • python3 tools/zig/drama3_replay_gate_test.py at b2dbff0a7784 (older head): 6 passed, 0 failed, 0 skipped
  • python3 tools/zig/drama3_replay_gate_test.py -v at 24f3cd1d8262: 14 passed, 0 failed, 0 skipped
  • nice -n 10 zig build test-drama-host check-drama-cuda-host -Dcpu=apple_m1 -j4 --summary all at 24f3cd1d8262: 50 passed, 0 failed, 0 skipped
  • swarm gpu-run plotarmordev/TensorFold fc34f2d948de3ccac50eaff2438b21bc3f1dd010 docs/recipes/drama3-cuda/door-166-bound.sh at fc34f2d948de (older head): 2 passed, 0 failed, 0 skipped

@AIFlowML

Copy link
Copy Markdown
Contributor

I trial-merged 2820270cde into main 2ce240cf0. It applies cleanly. Both shell syntax checks and all six cases in python3 tools/zig/drama3_replay_gate_test.py passed on macOS.

The first gap is the fork-lane frame check. In zig/src/families/drama3/replay.zig:79-98, a PCM difference at chunk 4 or 16 returns before either fork-lane assertion runs. If the PCM comparisons pass but a forked frame differs at line 94, the log still ends with codec chunks 1 1 4 16 and error: ReplayMismatch. I fed that exact fixture to the new helper and got exit 0. The current test named test_fork_lane_pcm_mismatch_fails exercises the later PCM check, which has one more codec line.

Could the replay check record the chunk-4/16 differences and continue through the fork-lane checks, then report a distinct PCM-only result once every exact check has passed? A regression for the fork-frame case would show that it still exits nonzero. This reproduces the gate's decision from its input log. The GB10 model run is a separate check.

Igor Lessio - AIFLOW LABS

plotarmordev added a commit to plotarmordev/TensorFold that referenced this pull request Nov 22, 2026
…ay.zig's format; one-line comments

A receipt without RMS, with a non-numeric max abs or trailing text now fails (review of ashhart#4463 fix).
@plotarmordev

Copy link
Copy Markdown
Contributor Author

Thanks @AIFlowML, that was a real gap. I fixed it in replay.zig: a codec chunk 4 or 16 PCM difference is now recorded and the run goes on through both fork lanes' frame and PCM checks, so any exact mismatch still ends in ReplayMismatch. Only when every exact check passed does it print a distinct Drama replay PCM only: … line (chunk, max abs, RMS) and end in ReplayPcmOnly, and drama3_replay_gate.sh passes on that pair alone. Your fixture is now test_fork_frame_mismatch_after_chunk_16_fails in drama3_replay_gate_test.py and exits nonzero, with a matching Zig test in replay_test.zig for a forked frame behind a chunk 16 PCM difference. The GB10 model run is a separate check.

@AIFlowML

Copy link
Copy Markdown
Contributor

Thanks for closing the gap. I trial-merged bac7a495 into main 25586070b. Both shell scripts passed syntax checks, all 11 shell-gate test cases passed, and the build passed 48 host tests and compiled the CUDA host entry points.

sh -n tools/zig/drama3_compact_gb10.sh
sh -n tools/zig/drama3_replay_gate.sh
python3 tools/zig/drama3_replay_gate_test.py
zig build test-drama-host check-drama-cuda-host -Dcpu=apple_m1 -j4 --summary all

I also compiled a scratch standalone driver from replay_test.zig with -O ReleaseFast, then fed its actual stderr to drama3_replay_gate.sh. The fallback accepted a run with both chunk 4 and chunk 16 PCM differences after the exact checks. It refused both a later forked frame mismatch and a later forked PCM mismatch, even when the chunk 16 difference came first. The all-exact case exited 0 directly. This verifies the producer-to-gate handoff on the host. The compact checkpoint run on GB10 remains separate.

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Thanks @plotarmordev. We can't take this replay gate as it stands. replay.zig now reports any chunk 4 or chunk 16 PCM difference as ReplayPcmOnly, and drama3_replay_gate.sh accepts that with no limit on its size. The gate also reads only the last PCM line, so a non-finite chunk 4 result can pass when chunk 16 differs by a finite amount.

Could you keep those differences as failures, or bound them with a limit the gate checks for every chunk? The served audio isn't affected; this is about what the gate can catch.

  • Synthena

@plotarmordev

Copy link
Copy Markdown
Contributor Author

I bounded each chunk 4/16 PCM max-abs difference to 2^-15 in replay.zig before ReplayPcmOnly can be returned. Larger differences now end in ReplayPcmBound, which the gate rejects; the gate checks every PCM report line, including non-finite or malformed earlier lines. The GB10 replay probe on the new code passed the gate for both prompt-row settings (1 and 64): chunk 4 max abs 1.058e-6 / 1.125e-6, chunk 16 max abs 9.118e-7 / 1.047e-6. Host replay tests and shell-gate regressions pass.

devopsfortunato and others added 14 commits November 24, 2026 06:02
… vs the fix (scratch, not for merge)"

This reverts commit 38fd623.
…k-lane checks, then ends ReplayPcmOnly

A forked frame or fork-lane PCM mismatch now fails ReplayMismatch even when the chunk 4/16 PCM differed first (ashhart#4463 review).
…bare 1 1 4 16 + ReplayMismatch stop

Regression: Igor's fixture on ashhart#4463 (PCM at chunk 4/16, then a forked frame) exits nonzero.
…ay.zig's format; one-line comments

A receipt without RMS, with a non-numeric max abs or trailing text now fails (review of ashhart#4463 fix).
@ashhart
ashhart force-pushed the feat/166-upstream-pr-drama-3-s-gb10-check-script- branch from 24f3cd1 to 233297b Compare November 24, 2026 06:02
@ashhart
ashhart merged commit 82ec0c1 into ashhart:main Nov 24, 2026
12 checks passed
ashhart pushed a commit that referenced this pull request Nov 24, 2026
…k-lane checks, then ends ReplayPcmOnly

A forked frame or fork-lane PCM mismatch now fails ReplayMismatch even when the chunk 4/16 PCM differed first (#4463 review).
ashhart pushed a commit that referenced this pull request Nov 24, 2026
…bare 1 1 4 16 + ReplayMismatch stop

Regression: Igor's fixture on #4463 (PCM at chunk 4/16, then a forked frame) exits nonzero.
ashhart pushed a commit that referenced this pull request Nov 24, 2026
…ay.zig's format; one-line comments

A receipt without RMS, with a non-numeric max abs or trailing text now fails (review of #4463 fix).
@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thank you @plotarmordev. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

4 participants