Repository navigation
fix(web): iOS Safari crash — force WASM backend + tiny.en on mobile - #3
Merged
Merged
Conversation
…ny.en on mobile iPhone 16e / iOS 26 crashes the tab loading the engine — base.en AND tiny.en both crash, while ?engine=mock works. So it's not memory or the UI: it's the real-engine runtime. On iOS the worker selects WebGPU (navigator.gpu exists), and Safari's WebGPU + ONNX-runtime (jsep) path crashes loading Whisper. Fix: iOS forces the stable WASM backend (skips the WebGPU probe); mobile also defaults to the lighter/faster tiny.en. Both overridable for on-device bisecting: ?device=wasm|webgpu and ?model=…. Desktop is unchanged (isIOS/isMobile false → probe WebGPU + base.en as before). device threads main → LiveModeSession → TransformersRecognizer → worker load message. UNVERIFIED on iOS from here — needs a real-device test after deploy. tsc clean; 219 vitest pass; net-silence canary 2/2; build ok. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
talk.pilgrimapp.org crashes the tab on iPhone 16e / iOS 26 during model download.
Root cause (systematic debugging)
On-device tests isolated the failing component:
?engine=mock(no model) → works → UI/terminal fine on iOS.?model=…tiny.en(37 MB) → still crashes → not memory, not model size.The only difference is the real-engine runtime: the worker selects WebGPU on iOS 26 (
navigator.gpuexists), and Safari's WebGPU + ONNX-runtime (jsep) path crashes the tab loading Whisper. (An OOM/GPU tab-kill can't be caught in JS, so the fix is to avoid the path, not catch it.)Fix
?device=wasm|webgpu,?model=….isIOS/isMobilefalse → WebGPU probe + base.en).devicethreads mainresolveEngine→LiveModeSession→TransformersRecognizer→ the workerloadmessage.Verification
tsc clean · 219 vitest · net-silence canary 2/2 · build ok. Needs a real iPhone test after deploy — I can't reproduce iOS Safari from CI.
🤖 Generated with Claude Code