Skip to content

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

Closed
plotarmordev wants to merge 4 commits into
mainfrom
pr17-macos
Closed

plotarmordev wants to merge 4 commits into
mainfrom
pr17-macos

Conversation

@plotarmordev

@plotarmordev plotarmordev commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Description and motivation

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.

Credit:

This branch is exactly jerryfane's tested repair head f119696d1eca0aa53e91e1e7c2c141685e38c9fd, with no
commits added. It already merges current main (844d0eab), so it is a fast-forward from main, and it keeps
both authors' commits (e77d80a is an ancestor). A normal merge therefore also brings in #17's head commit.

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

Commits (844d0eab..f119696):

  • e77d80a feat: run the recipe on macOS and cache a voice reference's prefill (BobClawblaw)
  • e9660d7 fix: make macOS reference caching safe and bounded (jerryfane)
  • d7dc8ec Merge current main while preserving the macOS full-model build path (jerryfane)
  • f119696 test: record real Metal cache and macOS lifecycle verification (jerryfane)

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.

I re-ran only Linux/CPU checks at f119696, on a GB10 host (aarch64 Linux, Zig 0.17.0, CUDA 13 nvcc), with no
GPU work and 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"
scripts/build-engine.sh from a clean checkout (ZIG=…/zig-0.17.0/zig NVCC=/usr/local/cuda/bin/nvcc) 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
gitleaks over 844d0eab..f119696, plus over the full range diff (includes the merge commit) no leaks found

Built artifacts:

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: files, docs, evidence and commit messages are clean, but the author email on the three
    repair commits carries the authoring machine's default local hostname. I left it because this PR lands
    the exact tested head without rewriting commits.
  • 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 4 commits October 21, 2026 10:25
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.
@plotarmordev

Copy link
Copy Markdown
Owner Author

Superseded by #22: same code (its 4th commit's tree equals f119696's), with commit emails switched to GitHub noreply addresses so no host names are exposed.

plotarmordev added a commit that referenced this pull request Oct 24, 2026
Run Drama on macOS (PR #17 with the Mac-tested repair; supersedes #21)
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.

2 participants