Skip to content

chore: bump mlx-swift-lm to 4e6e521 and mlx-swift to 34bc52f (UserInput API) - #211

Merged
solderzzc merged 1 commit into
mainfrom
chore/bump-mlx-swift-lm-4e6e521
Oct 5, 2026
Merged

solderzzc merged 1 commit into
mainfrom
chore/bump-mlx-swift-lm-4e6e521

Conversation

@solderzzc

Copy link
Copy Markdown
Member

Summary

Bump the mlx-swift-lm submodule from 8055044 to 4e6e521 (SharpAI/mlx-swift-lm#74) and mlx-swift from 1a2b3af to 34bc52f (SharpAI/mlx-swift#20), and adapt one test file to the new UserInput API.

Pulled in by this bump:

  • Real merge of upstream ml-explore/mlx-swift-lm (5e46681): UserInput.Image / Audio / Video become structs with a Source enum, MatmulPrecision.splitTolerance, WHT barrier fix, fused GDN projection compile state, reranker changes, and more (see the lm PR description).
  • mlx v0.32.2 / mlx-c ebc88f1 sync in mlx-swift (Sync upstream ml-explore/mlx-swift (mlx v0.32.2, mlx-c ebc88f1) via real merge mlx-swift#20).
  • A KVarN decode-smoke warm-up test fix and the umbrella workflow ref fix (lm-side only).

SwiftLM change: tests/SwiftBuddyTests/VLMExtractionTests.swift matched .ciImage(...) / .url(...) with if case let. Those are now static factory functions, which cannot be patterns (pattern variable binding cannot appear in an expression), so the whole SwiftBuddyTests target stopped compiling. The two lines now match on images.first?.source; the assertions are unchanged. Production code needs no change (return .ciImage(x), .url(x) and .data(_, format:) resolve to the new factories). The test change needs the new lm (UserInput.Image.source), so it has to land together with the bump.

Test plan

Local (M5), against lm 4e6e521 + mlx-swift 34bc52f:

  • swift build --build-tests: clean (the only 2 errors before the change were the 2 lines above); swift build -c release: OK
  • SwiftLMTests: 226 tests, 0 failures
  • SwiftBuddyTests: 124 tests, 9 skipped (environment-gated), 0 failures (VLMExtractionTests: 5/5)
  • tests/test-vision.sh case 1 (Qwen2-VL-2B, --vision): pass through the release binary
  • Not run locally: tests/test-vision.sh case 2 (LFM2.5-VL, local HF cache issue), xcodebuild -scheme SwiftBuddy

CI:

  • build_and_unit_test
  • speculative-decoding, dflash-speculative-decoding, speculative-decoding-eval
  • Remaining integration_matrix jobs (these also exercise the bumped mlx-swift metallib build)

After this merges, re-run Test with SwiftLM (Umbrella Repo) on SharpAI/mlx-swift-lm#74; it checks out SwiftLM main and was red only because of the two lines above.

AI disclosure

This PR was prepared with AI assistance (Claude Code: diagnosis, the test change, build/test runs and this description). It still needs human review before merging.

  • I have read this PR description in full and approve it as my own

🤖 Generated with Claude Code

…in tests

Upstream ml-explore/mlx-swift-lm (merged into SharpAI/mlx-swift-lm in
5152526, upstream 5e46681) turned UserInput.Image / Audio / Video from
enums into structs that wrap a `Source` enum, and replaced the enum
cases with static factory functions (`.ciImage(_:)`, `.url(_:)`, ...).
A static func cannot be used as a pattern, so

    if case let .ciImage(image) = images.first

no longer compiles ("pattern variable binding cannot appear in an
expression") and the whole SwiftBuddyTests target fails to build, which
takes `swift build --build-tests` (and the mlx-swift-lm "Test with
SwiftLM (Umbrella Repo)" check) down with it.

Match on `images.first?.source` instead. The assertions are unchanged.

Production code needs no change: `return .ciImage(x)` / `.url(x)` /
`.data(_, format:)` in OpenAIPayloads.swift, Server.swift and
SwiftLMTestSTFT/main.swift resolve to the new static factories.

Also bump the submodules the fix depends on (against the old pinned lm
8055044 the `.source` member does not exist, so they must land together):

- mlx-swift-lm 8055044 -> 4e6e521 (SharpAI/mlx-swift-lm#74: real merge of
  upstream 5e46681 plus a KVarN decode-smoke warm-up and the umbrella
  workflow ref fix)
- mlx-swift 1a2b3af -> 34bc52f (SharpAI/mlx-swift#20: mlx v0.32.2 / mlx-c
  ebc88f1 sync)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@solderzzc
solderzzc merged commit b1e8ad1 into main Oct 5, 2026
14 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