From 729cab3760d6d867a49c18bf970ece31d99e56ab Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Sat, 20 Jun 2026 16:29:08 +0200 Subject: [PATCH 1/2] Declare context as nonisolated(unsafe) on SDK < 26. Otherwise, the code doesn't compile under Swift strict concurrency. --- Libraries/MLXVLM/MediaProcessing.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/MLXVLM/MediaProcessing.swift b/Libraries/MLXVLM/MediaProcessing.swift index 1d75072b1..ab51a1cc8 100644 --- a/Libraries/MLXVLM/MediaProcessing.swift +++ b/Libraries/MLXVLM/MediaProcessing.swift @@ -18,7 +18,11 @@ public struct ProcessedFrames { // scan accumulates thousands of cached intermediate surfaces and hits the // per-process IOSurface limit of 16384, crashing the render pipeline. // Batch-processing never re-renders the same frame twice, so the cache buys nothing. +#if compiler(>=6.2) // proxy check for macOS 26 SDK, where CIContext is Sendable private let context = CIContext(options: [.cacheIntermediates: false]) +#else +nonisolated(unsafe) private let context = CIContext(options: [.cacheIntermediates: false]) +#endif /// Collection of methods for processing media (images, video, etc.). /// From b4a18e936a9b6a4b747365060678bafe2a0347a8 Mon Sep 17 00:00:00 2001 From: Pedro Cuenca Date: Sat, 20 Jun 2026 17:56:47 +0200 Subject: [PATCH 2/2] Format --- Libraries/MLXVLM/MediaProcessing.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/MLXVLM/MediaProcessing.swift b/Libraries/MLXVLM/MediaProcessing.swift index ab51a1cc8..796bc63ac 100644 --- a/Libraries/MLXVLM/MediaProcessing.swift +++ b/Libraries/MLXVLM/MediaProcessing.swift @@ -18,10 +18,10 @@ public struct ProcessedFrames { // scan accumulates thousands of cached intermediate surfaces and hits the // per-process IOSurface limit of 16384, crashing the render pipeline. // Batch-processing never re-renders the same frame twice, so the cache buys nothing. -#if compiler(>=6.2) // proxy check for macOS 26 SDK, where CIContext is Sendable -private let context = CIContext(options: [.cacheIntermediates: false]) +#if compiler(>=6.2) // proxy check for macOS 26 SDK, where CIContext is Sendable + private let context = CIContext(options: [.cacheIntermediates: false]) #else -nonisolated(unsafe) private let context = CIContext(options: [.cacheIntermediates: false]) + nonisolated(unsafe) private let context = CIContext(options: [.cacheIntermediates: false]) #endif /// Collection of methods for processing media (images, video, etc.).