Skip to content

fix(MLXVLM): mark shared CIContext nonisolated unsafe - #204

Merged
ekryski merged 1 commit into
ekryski:alphafrom
TheTom:codex/mlxvlm-cicontext-sendable
May 13, 2026
Merged

ekryski merged 1 commit into
ekryski:alphafrom
TheTom:codex/mlxvlm-cicontext-sendable

Conversation

@TheTom

@TheTom TheTom commented May 13, 2026

Copy link
Copy Markdown

Summary

  • annotate the shared MLXVLM CIContext static as nonisolated(unsafe)
  • fixes Swift concurrency isolation diagnostics without changing runtime behavior

Notes

  • draft PR split from the alpha integration stack
  • based on fresh ekryski:alpha

Swift 6.x strict-concurrency on the macOS 15 GitHub runner rejects
`private let context = CIContext()` because CIContext is reference-typed
but doesn't conform to Sendable. Local macOS 26 Swift is more permissive
and lets it compile. CIContext is documented thread-safe for the methods
this file uses (createCGImage, render), so `nonisolated(unsafe)` is the
correct annotation — opts into Swift 6 concurrency in a controlled way
without lying about the type's Sendable conformance.

Unblocks vllm-swift CI builds that compile MLXVLM transitively.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ekryski
ekryski marked this pull request as ready for review May 13, 2026 03:34
@ekryski

ekryski commented May 13, 2026

Copy link
Copy Markdown
Owner

This PR is good. I made some of these same fixes in other places just yesterday.

@ekryski ekryski added the bug Something isn't working label May 13, 2026
@ekryski
ekryski merged commit 52a1d88 into ekryski:alpha May 13, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants