Skip to content

Tell SIMD-less devices why the converter cannot run (2.3.7) - #77

Merged
liladas merged 3 commits into
mainfrom
fix/simd-unsupported-message
Aug 1, 2026
Merged

liladas merged 3 commits into
mainfrom
fix/simd-unsupported-message

Conversation

@liladas

@liladas liladas commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What

@ffmpeg/core 0.12.x ships a wasm binary built with SIMD enabled. A browser running on a CPU without SSE4.1 disables Wasm SIMD in its engine, so the core fails to compile before it ever reads the user's files:

Chrome:  CompileError: Compiling function #81 failed: Wasm SIMD unsupported @+70121
Firefox: CompileError: wasm validation error: at offset 70122: v128 not enabled

These users were shown "Could not load the converter. Try again, or try a different browser." Both suggestions are dead ends on this hardware.

What all of this actually means
  • SIMD ("Single Instruction, Multiple Data") is one CPU instruction that operates on a batch of numbers at once instead of one at a time. Video encoding is exactly the kind of work that benefits, so ffmpeg builds lean on it heavily. V8's explainer is the readable version.
  • v128 is the 128-bit vector type that the WebAssembly SIMD proposal added to the language. A wasm binary that uses it can only run on an engine that implements SIMD. Both error messages above are the engine refusing that type. SIMD shipped in all major browsers in 2021 and is listed as supported on the WebAssembly features table, which is why this looks like it should never happen.
  • SSE4.1 is an x86 instruction set extension that Intel shipped from 2007 (Penryn) and AMD from 2011 (Bulldozer). Browser engines implement Wasm SIMD on top of it, so on a CPU older than that the engine turns SIMD off entirely regardless of how new the browser is. The support table says "supported"; the hardware says no. That gap is this bug.
  • Why the browser version is a tell: Chrome 109 and Firefox 115 ESR are the final versions supported on Windows 7/8.1. A machine still on those is almost by definition from the pre-SSE4.1 era.
  • The fix uses WebAssembly.validate() on a 31-byte module that returns a v128. If the engine will not even validate that, it will never run the 10MB core. This is the standard probe, lifted from wasm-feature-detect.

Evidence

Triggered by a Tally submission (input_type=zip, result=failure, build 200d62c) with the user's file attached. The file is fine: 187s .cdg + 188s .mp3, and the app's exact ffmpeg command produces a correct 189s MP4 locally. The failure is at stage=load, before the files are touched.

PostHog, all history, failures by browser:

Browser successful sessions load-stage failure sessions
Chrome 109 (Win) 0 8
Firefox 115 (Win) 0 3
Chrome 150 (Win) 59 5 (2 SIMD-confirmed)
Brave 7 1

Chrome 109 and Firefox 115 are the terminal versions on Windows 7/8.1, i.e. pre-SSE4.1 era machines: 11 sessions, 0% success rate. Of 136 conversion sessions overall, 16 never succeeded, so this is the majority of total failure. Confirmed SIMD messages only start Jul 17 because that is when be7a79b began attaching error_message.

Changes

  • src/lib/wasmFeatures.ts: hasWasmSimd() (memoized WebAssembly.validate probe), isSimdCompileError(), and the shared user-facing message. The docblock carries the same reference links as above.
  • Preflight in convertCdgToMp4 before loadFFmpeg(). Fails immediately with an accurate message and skips a ~10MB core download that could never be used.
  • Backstop on the load error path, for an engine that validates the probe but still refuses the real core.
  • classifyError: new simd_unsupported reason, split from load_failed, so a permanent hardware limit stops hiding among retryable load errors.
  • FfmpegCommand now renders on error. It was gated to status === "idle" || "done", so the users who had just failed were the only ones who never saw the local fallback. Native ffmpeg involves no wasm engine, so the same conversion runs fine on the very PC that cannot load the core: it is a real workaround, not a consolation. Auto-expanded for the SIMD case (via a ref, since an open prop would be controlled and snap shut on re-render), and the SIMD message now points at it.
  • Docs note on the new reason code; version 2.3.7.

Not a fix for the affected users, who still cannot convert. Scoping a non-SIMD core fallback separately.

Test

npm run typecheck, lint, format, test (96 passing, 15 new/updated) and e2e (5 passing) and build all clean locally. New coverage: probe true/false/throws/memoized, both production error strings, preflight skips the fetch, no stuck busy flag after preflight rejection, the validate-passes-but-core-refuses path, and the command disclosure appearing on failure / expanding only for SIMD.

liladas added 3 commits August 1, 2026 09:35
@ffmpeg/core 0.12.x ships a SIMD (v128) wasm, so a browser on a CPU
without SSE4.1 fails to compile the core before it ever reads the user's
files. Those users saw "Could not load the converter. Try again, or try
a different browser", which is wrong twice over: retrying never works
and no browser helps.

PostHog confirms it is terminal, not transient. Every Chrome 109 and
Firefox 115 session (the last versions supported on Windows 7/8.1)
failed at the load stage and none ever succeeded: 11 sessions, 0%
success. Two more Chrome 150 sessions report the same CompileError.
Together they are most of the sessions that never converted anything.

Probe for v128 support before loading and fail immediately with a
message that says what is actually wrong, which also avoids a ~10MB core
download that cannot possibly be used. Keep a message check on the load
error too, in case an engine validates the probe but still refuses the
real core. Split the failure out of `load_failed` as `simd_unsupported`
so a permanent hardware limit stops hiding among retryable load errors.
prettier --check failed CI on wasmFeatures.ts. Switch the probe from
Uint8Array.of(...) to an array literal so prettier keeps it compact
rather than one byte per line, annotate each wasm section so the bytes
are readable, and link the specs and references that explain what SIMD,
v128 and SSE4.1 are.
FfmpegCommand was gated to status idle/done, so the users who had just
failed were the only ones who never saw the local fallback. That is
backwards, and for a device without Wasm SIMD it hid the only thing that
would work: native ffmpeg has no wasm engine involved, so the same
conversion runs fine on the very PC that cannot load the core.

Render it on error too, and expand it automatically for the SIMD case so
it is not buried behind a collapsed "Prefer the command line?" summary.
Opened via a ref rather than an `open` prop, which React would treat as
controlled and snap shut again on the next render. Point the SIMD message
at the command instead of dead-ending on "use a newer computer".
@liladas
liladas merged commit d801b3e into main Aug 1, 2026
3 checks passed
liladas added a commit that referenced this pull request Aug 1, 2026
docs/ has been collecting drafts since #77: five posts landed there, and
two more went in with the WebCodecs work. None of them are
documentation. They carry editor notes, numbers flagged for rechecking
before publication, and copy that has not been through review.

Matched by pattern rather than by name so the next draft is covered
without anyone remembering to add it. Nothing links to them, and every
file stays on disk.
liladas added a commit that referenced this pull request Aug 1, 2026
* Keep the unpublished blog draft out of the repo

It was committed by accident: a `git add` of the whole docs/ directory
swept it in with the credits work. It is a draft awaiting a blog to
publish to, not documentation, and it carries editor notes that are not
meant to ship.

Gitignored so the same mistake cannot repeat, and the file stays on disk
where it was.

* Ignore the second blog draft too

* Untrack every unpublished blog and social draft

docs/ has been collecting drafts since #77: five posts landed there, and
two more went in with the WebCodecs work. None of them are
documentation. They carry editor notes, numbers flagged for rechecking
before publication, and copy that has not been through review.

Matched by pattern rather than by name so the next draft is covered
without anyone remembering to add it. Nothing links to them, and every
file stays on disk.
@liladas
liladas deleted the fix/simd-unsupported-message branch August 2, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant