Hey HN, I recently spent a week tracking down an uncatchable C++ assertion in Apple's CoreML stack and wanted to share the post-mortem.
I’ve been building an iOS/macOS companion app called Blueprint: Scoring Engine. It uses a complex pipeline of multiple CoreML YOLO models and an AR overlay to provide real-time scoring analysis for Balatro—detecting everything from playing cards and Jokers to specific card enhancements, seals, and editions.
The app ran flawlessly on an iPhone 13 but was instantly fatal on an iPhone SE 2. The crash was an uncatchable assertion in MPSGraphExecutable.mm:5070 (Error: MLIR pass manager failed).
Initially, I thought it was an Apple Neural Engine issue due to an Unknown kMGQAppleNeuralEngineSubtype=0x8030 log. It turns out the issue wasn't the ANE driver itself, but a failing MLIR lowering pass in MPSGraph when targeting unfamiliar hardware profiles. Even setting computeUnits = .cpuAndGPU crashed because MPSGraph still routes through the same MLIR compiler infrastructure.
I ended up having to build a resilience layer to detect the hardware and force .cpuOnly to bypass MPSGraph entirely. This routes execution through BNNS, avoiding the crash while keeping latency acceptable for the real-time AR overlay. I've filed a Feedback with Apple, but until it's patched, .cpuOnly is the only safe fallback.
volvogradSaint•1h ago
I’ve been building an iOS/macOS companion app called Blueprint: Scoring Engine. It uses a complex pipeline of multiple CoreML YOLO models and an AR overlay to provide real-time scoring analysis for Balatro—detecting everything from playing cards and Jokers to specific card enhancements, seals, and editions.
The app ran flawlessly on an iPhone 13 but was instantly fatal on an iPhone SE 2. The crash was an uncatchable assertion in MPSGraphExecutable.mm:5070 (Error: MLIR pass manager failed).
Initially, I thought it was an Apple Neural Engine issue due to an Unknown kMGQAppleNeuralEngineSubtype=0x8030 log. It turns out the issue wasn't the ANE driver itself, but a failing MLIR lowering pass in MPSGraph when targeting unfamiliar hardware profiles. Even setting computeUnits = .cpuAndGPU crashed because MPSGraph still routes through the same MLIR compiler infrastructure.
I ended up having to build a resilience layer to detect the hardware and force .cpuOnly to bypass MPSGraph entirely. This routes execution through BNNS, avoiding the crash while keeping latency acceptable for the real-time AR overlay. I've filed a Feedback with Apple, but until it's patched, .cpuOnly is the only safe fallback.