VNDetectBarcodesRequest fails on every frame: "Could not build inference plan - ANECF error: failed to load ANE model .../mrcdetector.H17.espresso.hwx"

On iPhone 16e running iOS 26, we have now lost barcode detection through two independent APIs. Other device models in the same fleet, on the same app build and the same iOS version, are unaffected.

Background: the original failure (AVCaptureMetadataOutput)

Our retail app scans EAN-13, Code 128 and ITF barcodes. It originally used AVCaptureMetadataOutput with metadataObjectTypes set accordingly.

After the update to iOS 26, this stopped working on iPhone 16e. The behaviour was completely silent: the capture session reported isRunning == true, the camera preview stayed live and correctly exposed, no interruption or runtime-error notifications were posted — but metadataOutput(_:didOutput:from:) simply never fired again, for any barcode. There was no error of any kind to go on.

Restarting the app did not help. Only a full device reboot restored detection.

Because the metadata path performs detection in the media daemon rather than in our process, we moved detection into the app to work around it.

The current failure (Vision)

Frames now come from an AVCaptureVideoDataOutput (preset .hd1280x720, .up orientation) and are analyzed in-process:

let request = VNDetectBarcodesRequest()
request.symbologies = [...]
let handler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer,
                                    orientation: .up, options: [:])
try handler.perform([request])

On the same devices, handler.perform() now throws for every analyzed frame:

Error Domain=com.apple.Vision Code=9 "Could not build inference plan - ANECF error: failed to load ANE model file:///System/Library/Frameworks/Vision.framework/ mrcdetector.H17.espresso.hwx Error=createProgramInstanceForModel:modelToken: modelFilePath:qos:isPreCompiled:enablePowerSaving:skipPreparePhase:statsMask: memoryPoolID:enableLateLatch:modelIdentityStr:owningPid:cacheUrlIdentifier: aotCacheUrlIdentifier:optOutOfModelMemoryUnwiring:error:: Program load failure (0x50004) (DESIGN)"

So the second approach fails as well — but loudly, and one layer down. The failing model is a system model shipped inside Vision.framework; we load no Core ML model of our own.

Shared characteristics

Both failures behave identically in the ways that matter:

  • Same device model (iPhone 16e), starting with iOS 26
  • Camera pipeline healthy throughout: frames keep arriving continuously (verified by a watchdog on the sample buffer delegate), preview live, no AVCaptureSessionWasInterrupted and no AVCaptureSessionRuntimeError
  • Detection never recovers on its own
  • An app restart does not help; only a device reboot does

Over one workday we recorded ~65,000 consecutive Vision failures across four devices, with zero successful detections in between.

This makes us suspect both symptoms share a root cause below the two APIs, rather than being two unrelated bugs.

What we tried

We found thread 761095, where the same error signature (Code=9, "Could not build inference plan - ANECF error", "(DESIGN)") was reported on visionOS 2.0 beta for a different system model, and where the suggested workaround was to restrict the request to CPU/GPU via setComputeDevice(_:for:). We implemented that as a runtime fallback:

let devices = try request.supportedComputeStageDevices[.main] ?? []
// pick .gpu, else .cpu
request.setComputeDevice(device, for: .main)

We have not yet been able to confirm on an affected device whether this actually bypasses the failing path, since we cannot reproduce the state on demand.

Questions

  1. Is this a known issue on iOS 26 / iPhone 16e?
  2. Could the silent AVCaptureMetadataOutput failure and this ANE model load failure share a common cause?
  3. Is restricting the compute stage to CPU/GPU a supported workaround for VNDetectBarcodesRequest, or does the barcode detector always require the ANE?
  4. Is there any way to recover the ANE state from within the app, so users do not have to reboot the device?
  5. Is there anything specific we should capture in a Feedback Assistant report to make this actionable? We can reproduce it in the field but not on demand.

Update: we have now tested the setComputeDevice workaround, and it cannot work for VNDetectBarcodesRequest. Some further findings below, plus a correction to my original post.

  1. The non-ANE path has no weights — reproducible on a healthy device

Restricting the request away from the Neural Engine is accepted, but every perform() then throws:

Error Domain=com.apple.Vision Code=9 "Could not create/add network to inference plan - Espresso exception: "I/O error": Missing weights path mrcdetector.espresso.weights_nonane (DESIGN)"

and this appears on stderr for every analyzed frame:

[Espresso::handle_ex_plan] exception=Espresso exception: "I/O error": Missing weights path mrcdetector.espresso.weights_nonane status=-2

Reproduction (iPhone 16e, iOS 26.5, ~4 lines of code, works every time):

let devices = try request.supportedComputeStageDevices[.main] ?? []
// 3 devices are reported; pick the .gpu one
request.setComputeDevice(gpuDevice, for: .main)
try handler.perform([request])

The important part: this device is completely healthy. Its barcode scanning works normally on the ANE. So this is not the broken state from my original post — the non-ANE weights for mrcdetector appear not to be shipped at all.

That makes the failure in my original post unrecoverable: there is no non-ANE path to fall back to.

Also logged by the system immediately before the switch, in case it means something:

numANECores: Unknown aneSubType
  1. VisionKit fails too, and it fails silently

On a device in the broken state, DataScannerViewController starts without any error and then recognizes nothing at all — no barcode, indefinitely. It reports neither frames nor errors, so there is no way to detect this from the delegate. We had to add a watchdog that fires when nothing has been recognized for 10 seconds, purely to make the state observable.

So on an affected device all three paths are dead: AVCaptureMetadataOutput (silently), Vision on the ANE, and VisionKit. Vision off the ANE was never an option per point 1.

  1. The state is intermittent per device, and rare

I described it as persistent, which was based on what we could see at the time. With more data that is only half right: it persists until reboot, but devices do come back. One device logged ~37,000 consecutive failures on one day and ran without a single failure days later.

Frequency, now that we log this properly: one occurrence across 42 devices and 260 scanner sessions over five days. It is rare, which is also why we cannot give you an on-demand reproduction for it — unlike point 1.

  1. Apple Intelligence is not the trigger by itself

SystemLanguageModel.default.availability reports .available on the healthy device we reproduced point 1 on, so simply having Apple Intelligence enabled does not cause the failure. We cannot rule out that ANE load or memory pressure plays a role.

Correction to my original post

I wrote that other device models in our fleet running the same build and iOS version are unaffected. I cannot support that. Our logs only carried UIDevice.model ("iPhone") at the time, so no model information was available. We have since added the exact model identifier, and every device we can identify is an iPhone 16e (iPhone17,5) — including the ones that work. We have no data on other models either way.

Revised questions

  1. Are the non-ANE weights for mrcdetector expected to be absent? If so, should setComputeDevice be considered unsupported for VNDetectBarcodesRequest, and is there any other supported way to run it off the Neural Engine?
  2. Given that, is there any in-app recovery from the ANE load failure at all, or is rebooting the device genuinely the only remedy?
  3. For the intermittent failure, what should a Feedback Assistant report contain to be actionable? We can catch a device in the state, but not on demand — is a sysdiagnose taken before rebooting the right thing?
VNDetectBarcodesRequest fails on every frame: "Could not build inference plan - ANECF error: failed to load ANE model .../mrcdetector.H17.espresso.hwx"
 
 
Q