From f3df8f34d2ab135271d947609aa1a87d3513d2f1 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Tue, 3 Nov 2026 00:26:21 +0100 Subject: [PATCH 1/2] Fix #2786: the web build uses WebAssembly SIMD, so the canvas renders about 2.5x faster Without simd128, vello_cpu's SIMD layer (fearless_simd) runs its scalar fallback on wasm32. `.cargo/config.toml` now sets `-C target-feature=+simd128` for wasm32-unknown-unknown, which trunk (packaging/web/package.sh) and `cargo xtask wasm` both pick up. A full-frame canvas render of the issue's test drawing in headless Chrome 156 drops from 7.8 to 3.2 ms at 1400 x 900 and from 8.2 to 3.2 ms at 1920 x 1080 (median of 7 and 6 alternating runs on a loaded machine). The canvas pixels are identical. The web build now needs Chrome/Edge 91+, Firefox 89+ or Safari 16.4+; older browsers can no longer load it. Co-Authored-By: Claude Opus 5.5 --- .cargo/config.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 35049cbcb..6c26ee582 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,9 @@ [alias] xtask = "run --package xtask --" + +# WebAssembly SIMD for the web build: without it vello_cpu's SIMD layer (fearless_simd) runs its +# scalar fallback on wasm32 and the canvas renders about 2.4x slower (#2786). The web build then +# needs Chrome/Edge 91+, Firefox 89+ or Safari 16.4+. A RUSTFLAGS environment variable replaces +# these flags. +[target.wasm32-unknown-unknown] +rustflags = ["-C", "target-feature=+simd128"] From c95d711d4bb04fbcc8afd39c62b59ff4193aa93d Mon Sep 17 00:00:00 2001 From: vangel76 Date: Wed, 4 Nov 2026 00:45:25 +0100 Subject: [PATCH 2/2] Web: document the browser minimums the SIMD build needs (#2786) Co-Authored-By: Claude Sonnet 5.5 --- README.md | 2 +- packaging/web/README.md | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a3c453c5..85dc265cc 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ Installers and executables are code-signed. | Build | File | Notes | |---|---|---| -| Static site | `vectorcraft-web-.zip` | Runs in a modern browser; host it on any static server | +| Static site | `vectorcraft-web-.zip` | Runs in a browser with WebAssembly SIMD (Chrome/Edge 91, Firefox 89, Safari 16.4 or newer), see `packaging/web/README.md`; host it on any static server | ## The Crafting Apps diff --git a/packaging/web/README.md b/packaging/web/README.md index 38a8d6209..cac402c6b 100644 --- a/packaging/web/README.md +++ b/packaging/web/README.md @@ -50,6 +50,23 @@ location /vectorcraft/ { Local test: `python3 -m http.server 8765` inside the folder, then open http://localhost:8765/. +## Browser requirements + +The wasm is built with WebAssembly SIMD (`-C target-feature=+simd128`, `.cargo/config.toml`, +#2786), so it needs a browser that has it: + +| Browser | First version | +|---|---| +| Chrome, Edge | 91 | +| Firefox | 89 | +| Safari (macOS and iOS/iPadOS) | 16.4 | + +Source: caniuse `wasm-simd` and the WebAssembly feature table (webassembly.org/features). An older +browser can't compile the module. There is no fallback build and no message: the page stays on +"Loading VectorCraft..." and the console shows a WebAssembly compile error. The app also needs +WebGPU or WebGL2 (see "Renderer selection" below). If you must serve older browsers, put a +version check in front of the app on your own page. + ## Fonts folder Builds made with craft-fonts (`CRAFT_FONTS_DIR`, all releases) have a `fonts/` folder beside the