Skip to content

MagentaRT2: root-cause engine metallib failure (LFS), drop unsafe swap option - #132

Merged
a-github-name merged 1 commit into
mainfrom
fix/magenta-lfs-metallib-and-swap
Jul 3, 2026
Merged

MagentaRT2: root-cause engine metallib failure (LFS), drop unsafe swap option#132
a-github-name merged 1 commit into
mainfrom
fix/magenta-lfs-metallib-and-swap

Conversation

@a-github-name

Copy link
Copy Markdown
Member

Closes out the Magenta RT2 investigation with two corrections to the record.

1. The engine was never toolchain-broken — it's Git LFS

vendor/magentart.xcframework/**/Resources/*.metallib are LFS-tracked 107MB objects; un-hydrated checkouts carry 134-byte pointer stubs, and Metal's "Invalid library file ×2" was it rejecting those stubs. git lfs install --local && git lfs pull fixes it — verified: music realtime renders 101 frames / 5s of audio immediately after hydration. The modelLoadFailed message now includes the LFS hint, and the docs note the constraint. (The earlier task chip's "rebuild the xcframework" hypothesis was wrong; chip dismissed. Related context: this is a sibling of the tracked-stale-metallib class of problem fixed in #131 — binary Metal artifacts in git that don't obviously fail when wrong.)

2. The promotion gate ran — and rejected the non-blocking swap

With the engine live, the gated integration test shipped in #128 delivered its verdict: overlapping mrt2_engine_generate_frame with the engine's async prompt encode segfaults deterministically (signal 11). The opt-in MERERUN_MAGENTA_NONBLOCKING_PROMPT_SWAP and its code path are removed; mid-session swaps block for the encode by engine constraint (1ms poll retained from #128). Stall-free swaps need the engine's threaded mrt2_runner_* API with its buffered ring — documented as the future path.

The rewritten test suite pins the supported blocking behavior and passes live:

[magenta-test] blocking swap completed, peak_after_swap=0.33
Executed 1 test, with 0 failures

🤖 Generated with Claude Code

…p option

The "Invalid library file" engine failure was never a toolchain or
xcframework problem: vendor/magentart.xcframework's Metal libraries are
Git LFS objects (107MB each), and checkouts without hydrated LFS carry
134-byte pointer stubs that Metal rejects. `git lfs install --local &&
git lfs pull` restores them; the modelLoadFailed error message now says
exactly that, and docs/configuration.md documents the constraint.

With the engine finally runnable, the gated prompt-swap integration test
delivered its verdict on the opt-in non-blocking swap shipped in #128:
overlapping mrt2_engine_generate_frame with the engine's asynchronous
prompt encode SEGFAULTS (signal 11, deterministic). The option and its
env switch are removed — a mid-session swap blocks the render loop for
the encode by engine constraint, with the 1ms poll retained. Stall-free
swaps need the engine's threaded mrt2_runner_* API with its buffered
audio ring; the test suite now pins the supported blocking behavior
(passes live: 50 frames through a swap, finite non-silent audio,
[magenta-test] peak_after_swap=0.33).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@a-github-name
a-github-name merged commit b172571 into main Jul 3, 2026
12 checks passed
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