Skip to content

Run Drama on macOS (PR #17 with the Mac-tested repair; supersedes #21) - #22

Merged
plotarmordev merged 6 commits into
mainfrom
pr17-macos-clean
Oct 24, 2026
Merged

plotarmordev merged 6 commits into
mainfrom
pr17-macos-clean

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Description and motivation

Supersedes #21. Lands #17 (macOS support and Metal reference-prefill reuse) through the Mac-tested repair, so the
recipe runs on Apple silicon with the full model on Metal. The GB10/CUDA path is unchanged.

This replaces #21 only to fix commit metadata: the three repair commits in #21 carried an author email with the
authoring machine's default local hostname. Here the commit emails were switched to GitHub noreply addresses to
keep credit without exposing host names. Author names, messages and author dates are unchanged; the code is
unchanged (tree proof below).

Credit:

How this branch was built: jerryfane's tested head f119696d1eca0aa53e91e1e7c2c141685e38c9fd replayed as linear
history on main (844d0eab), commit by commit, with no merge commit:

Commit Original Author Author email
ed11f6d feat: run the recipe on macOS and cache a voice reference's prefill e77d80a BobClawblaw [email protected] (already noreply, unchanged)
7e5a119 fix: make macOS reference caching safe and bounded e9660d7 Jerry (jerryfane) [email protected]
c8776a4 Merge current main while preserving the macOS full-model build path d7dc8ec Jerry (jerryfane) [email protected]
60d1e59 test: record real Metal cache and macOS lifecycle verification f119696 Jerry (jerryfane) [email protected]
882caa3 docs(macos): drop the production Studio remark from the repair verification new plotarmordev [email protected]
  • Replaying on main conflicted in two places that jerryfane's merge d7dc8ec had already resolved:
    scripts/build-engine.sh in the first commit and README.md in the second. Each was resolved with the file
    exactly as in d7dc8ec, so every commit keeps the macOS and Linux build paths working. The third commit keeps
    its original message and carries the rest of that merge's resolution (recipe/README-macos.md, 5+/4−).
  • Tree proof: git rev-parse 60d1e59^{tree} = ff708fb7891b5884bba3e4aa21898e17eb3554a4 =
    git rev-parse f119696^{tree}. Also c8776a4^{tree} = d7dc8ec^{tree} = 8742f83deeb7227b4eed7f7e65064dcf825a34a0.
  • The fifth commit deletes one clause in recipe/README-macos.md (line 186) and touches nothing else.

Engine patches: adds 0012-feat-drama3-reuse-a-voice-reference-s-prefill-across.patch (one bounded
reference-prefix snapshot per Metal lane, exact prompt-prefix identity including tower lookahead, invalidation
before default or different-prefix prefill and on errors; CUDA execution unchanged). SHA256SUMS and
engine/patches/README.md are updated. Patch 0012 has no upstream TensorFold PR yet; the patch table lists it as
"to be proposed".


Testing

The Metal results are jerryfane's Mac runs, not mine. They are in his
repair comment and in
results/macos-pr17-repair.json (on Mac: clean Metal build 66/66 steps; 48/48 paired corpus PCM captures
byte-identical; voice/default/text transitions passed; streaming 9/9 checks in four runs; 0 KiB RSS spread over
eight warmed voice switches). I have no Mac and did not re-run any of it.

Re-run at this head (882caa3) on a GB10 host (aarch64 Linux), no GPU work, no model downloads:

Check Result
(cd engine/patches && sha256sum -c SHA256SUMS) 12/12 OK
python3 -m unittest discover -s recipe -p 'test_*.py' 32 run, OK, 15 skipped (the macOS-only lifecycle smoke)
python3 -m unittest discover -s recipe -p test_pilot_macos.py 22 run, OK, 15 skipped (macOS-only)
python3 -m unittest discover -s recipe -p test_build_voice.py 10 run, OK
python3 bench/stream_check.py --self-test "self_test": "passed"
gitleaks 8.30.1 over 844d0eab..882caa3 (5 commits, linear) and over the full main..HEAD diff no leaks found
Author/committer name+email of every commit; commit messages; all 3,522 added lines, searched for host names, home paths, IPs and tokens every email is a GitHub noreply address; only loopback 127.0.0.1/0.0.0.0/localhost in code and docs; clean

Carried from #21, not re-run here because the engine inputs are byte-identical (the fourth commit's tree equals
f119696's, and the fifth commit changes only recipe/README-macos.md), run at f119696 with Zig 0.17.0 and
CUDA 13 nvcc:

Check Result
scripts/build-engine.sh from a clean checkout Build Summary: 102/102 steps succeeded; engine d1018b3 + 12 patches = c265ca2fc4b9b54ba75b6780e110c566483c93d2
Base comparison the same series without 0012 (main 844d0eab, 11 patches) gives 881151ca8b83605c38a99f26fc8a94a92a6a51d7, which equals the PR build's HEAD~1: 0001–0011 are unchanged
zig build test -Dnvcc=/usr/local/cuda/bin/nvcc in build/tensorfold (host tests, CUDA_VISIBLE_DEVICES= empty) 215/215 steps succeeded; 3056/3070 tests passed (14 skipped)
python3 tools/zig/test_speech_flags.py (built binary) 1 run, OK
python3 tools/zig/test_drama_prefill_compare.py 5 run, OK

Built artifacts (from #21's build):

67605fb2ca88c14f4e47a1582360f982b352db7e9365c9ac53a8e150c7997416  zig-out/native/bin/tensorfold-native
cb4b62d23953296a5deaecf14c73bda50f1132a175c3d38db01bc91cf2cbf3fd  zig-out/bin/drama3-generate

Not run by me:

  • Everything on Metal, including PILOT_MACOS_INTEGRATION=1 lifecycle smoke: needs macOS.
  • bench/reference_cache_test.py, the corpus audio-identity gate and served stream_check.py: they need a
    running server with the model, and this change was checked without GPU work.
  • The qualification gates: they need the sglang-omni CUDA reference stack.

Performance or quality claim

None.


Checklist

  • One change per patch, new patches at the end of the series, SHA256SUMS and engine/patches/README.md
    updated
  • scripts/build-engine.sh applies the whole series and builds from a clean checkout (Linux/CUDA by me;
    macOS/Metal by jerryfane)
  • Every behaviour change has a deterministic test that fails without it (CPU regressions for 0012;
    recipe/test_pilot_macos.py, recipe/test_build_voice.py; real-model checks are Mac-run by jerryfane)
  • No dead code, debug output or leftovers
  • No personal voices, recordings, private names, host names or private paths in code, fixtures, docs, evidence
    or commit messages (commit emails are GitHub noreply addresses)
  • Where audio should not change, compare_gate.py reports "identical": true and stream_check.py passes:
    reported by jerryfane on Mac only (48/48 identical, streaming 9/9); not re-run on GB10

Evidence (only with a claim)

n/a: no claim.

BobClawblaw and others added 5 commits October 24, 2026 18:05
Adds a macOS path that leaves the GB10 path unchanged, and one engine
patch that removes the repeated reference prefill from Drama 3 speech.

- scripts/build-engine.sh: on Darwin, omit -Dnvcc (the option is only
  declared for the CUDA steps) and use shasum where sha256sum is absent.
  The Linux branch is the previous code.
- recipe/pilot_macos.py: the guarded pilot without systemd. Same shared
  GPU lock, admission check, port check, DRAMA_PILOT_READY and evidence
  files; vm_stat replaces /proc/meminfo and process-group signals replace
  systemd-run. --host defaults to 0.0.0.0, --host 127.0.0.1 available.
- recipe/README-macos.md: the macOS procedure, measurements and the voice
  cloning steps.
- recipe/build_voice.py: builds a drama3-http-voice/1 catalog from an
  encoded reference clip and its transcript.
- engine/patches/0012: the Metal host prefills a voice reference once per
  lane, snapshots the recurrent state and reuses it. Measured 3.59 s to
  1.37 s first audio on a short line and 4.68 s to 2.41 s on a 454
  character paragraph, with byte-identical audio. It stacks on 0005 and is
  proposed upstream once that lands.
- engine/patches/SHA256SUMS and the patch table updated.
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.

3 participants