Repository navigation
test: make the local suite actually runnable (1 test → 245) - #130
Merged
Merged
Conversation
Tier 3 from #128. MLX aborts the process when it cannot load its Metal library, so a bare `swift test` dies on the first test that touches MLX — in practice the second test of the run. Everything after it goes unexecuted while the output still reads as a short, passing run, which is a trap: a contributor can run the tests, see green, and have exercised one assertion out of ~250. CI is unaffected because it installs the metallib inline, which is why this went unnoticed. scripts/install-test-metallib.sh is that same step for local use. It prefers a metallib already built by build.sh and otherwise pulls one from the mlx wheel, then installs it beside the built products and inside every .xctest bundle — MLX looks for a metallib colocated with the running binary, which for tests is inside the bundle. Measured: 1 executed test before, 245 executed and 0 failures after. README documents the three-command sequence. Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tier 3 from #128.
The trap
MLX aborts the process when it cannot load its Metal library. A bare
swift testtherefore dies on the first test that touches MLX — in practice the second test of the run:Everything after that goes unexecuted, and the output still reads as a short, passing run. A contributor can run the tests, see green, and have exercised one assertion out of ~250.
CI is unaffected — it installs the metallib inline (
ci.yml, "Install MLX Metal library"), which is exactly why this went unnoticed.The fix
scripts/install-test-metallib.shperforms that same step locally. It prefers a metallib already produced bybuild.sh, otherwise pulls one from themlxwheel as CI does, then installs it beside the built products and inside every.xctestbundle — MLX looks for a metallib colocated with the running binary, which for tests is inside the bundle, not next to it.swift build --build-tests scripts/install-test-metallib.sh swift testMeasured
README documents the sequence in the Testing section.
Note
This also means the "full suite green" claims made while fixing #108/#110/#112 were per-suite (
--filter) runs, not a single invocation — the single invocation was never possible. It is now, and it passes.🤖 Generated with Claude Code