Repository navigation
Drop compile(shapeless:) shadows now that mlx-swift ships @Sendable overloads - #89
Merged
Merged
Conversation
…verloads mlx-swift upstream 26d685a (ml-explore/mlx-swift#469) gives the stateless compile(shapeless:_:) overloads a @sendable body for the [MLXArray], 1-, 2- and 3-input shapes. The four shadows in CompiledTrace.swift then duplicate them, and GPTOSS.swift:96 and Gemma4Text.swift:32/38 fail with "ambiguous use of compile(shapeless:_:)" (SharpAI/mlx-swift#28, Downstream Integration Test). CompiledTraceTests built its unguarded baseline with MLX.compile { capture }, which the @sendable overload now rejects. It uses the inputs:/outputs: form with no declared state instead; that form takes a non-@sendable body on both the current fork main and #28. Verified: swift build --build-tests against mlx-swift 9ab0a45 (#28 head), Xcode 26.3, exit 0. CompiledTraceTests need a Metal toolchain and are left to CI. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ximyro
pushed a commit
to ximyro/SwiftLM
that referenced
this pull request
Nov 17, 2026
Moves the mlx-swift-lm pin from 87232e7 to e2d15c7, the merge of SharpAI/mlx-swift-lm#89. It removes the compile(shapeless:) shadows in CompiledTrace.swift so the Downstream Integration Test on SharpAI/mlx-swift#28 no longer fails with "ambiguous use of compile(shapeless:_:)". Co-Authored-By: Claude Sonnet 5.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.
Why
SharpAI/mlx-swift#28 merges upstream
26d685a, which gives the statelesscompile(shapeless:_:)overloads a@Sendablebody for the[MLXArray], 1-, 2- and 3-input shapes. The four shadows inCompiledTrace.swiftthen duplicate them, and the umbrella build (Downstream Integration Teston mlx-swift#28) fails:GPTOSS.swift:96: ambiguous use ofcompile(shapeless:_:)Gemma4Text.swift:32,:38: sameWhat
compile(shapeless:_:)shadows fromCompiledTrace.swift;CompiledTraceitself is unchanged.CompiledTraceTests.testPlainCompileFreezesCapturedWeightsbuilt its unguarded baseline withMLX.compile { capture }, which the@Sendableoverload rejects. It now usesMLX.compile(inputs: [], outputs: []), which takes a non-@Sendablebody on both the current fork main and fix(Gemma4): add pad token (ID=0) to eosTokenIds to prevent infinite … #28.Verified
swift build --build-testsagainst mlx-swift9ab0a45(the fix(Gemma4): add pad token (ID=0) to eosTokenIds to prevent infinite … #28 head), Xcode 26.3: exit 0.CompiledTraceTestsneed a Metal toolchain and could not run locally; CI runs them.Note
Against the current fork main (before #28), the 1-, 2- and
[MLXArray]shapes ofcompile(shapeless:)lose the@Sendableguard, because fork main only has it on the 3-input shape. #28 restores it for all four.🤖 Generated with Claude Code