Utensil's Zettelkasten-style forest of evergreen notes on math and tech. utensil.tngl.sh/forest/
0

Configure Feed

Select the types of activity you want to include in your feed.

experiment(spindle-ci): iter 9 — wasm-opt --all-features (replace bulk-memory only)

Iter 8 hit a fresh wasm-validator error after bulk-memory was unblocked:
'i32.trunc_sat_f32_u … all used features should be allowed'
(the nontrapping-fptoint feature, also default-on for wasm32 in Rust 1.82+).

Same pattern: Rust enables defaults; binaryen wasm-validator rejects.
Per utensil/forest#55, replace the explicit flag list with --all-features.
Updates wgputoy-wasm-opt-bulk-memory.patch's hunk: wasm-opt args become
['-O', '--all-features'] in the appended [package.metadata.wasm-pack.
profile.release] block. Verified clean roundtrip apply.

utensil (May 30, 2026, 11:30 AM +0800) b9eb71e2 df6d2e55

+14 -8
+14 -8
nix/patches/wgputoy-wasm-opt-bulk-memory.patch
··· 1 - wgputoy: tell wasm-pack's wasm-opt to enable bulk-memory features 1 + wgputoy: tell wasm-pack's wasm-opt to accept ALL wasm features Rust emits 2 2 3 3 After cargo finishes the wasm32 build, wasm-pack runs binaryen's wasm-opt 4 - to shrink the output. Rust 1.82+ defaults wasm32-unknown-unknown to the 5 - `bulk-memory` target feature, so the .wasm contains `memory.copy` / 6 - `memory.fill` ops; recent binaryen wasm-validator rejects them unless 7 - `--enable-bulk-memory` (and `--enable-bulk-memory-opt`) is passed. 4 + to shrink the output. Rust 1.82+ enables increasing default-on wasm 5 + features for wasm32-unknown-unknown (`bulk-memory`, `nontrapping-fptoint`, 6 + `reference-types`, …). Binaryen's wasm-validator rejects features it 7 + isn't told are allowed, with errors like: 8 + '[wasm-validator] memory.copy operations require bulk memory operations' 9 + '[wasm-validator] all used features should be allowed' (for trunc_sat_f32_u) 10 + 11 + Rather than chase each feature as Rust enables more, pass `--all-features` 12 + once. Discussion of trade-offs (vs whack-a-mole flags / skipping wasm-opt 13 + / bumping binaryen) is at github.com/utensil/forest/issues/55. 8 14 9 15 The pinned commit's Cargo.toml has no `[package.metadata.wasm-pack.profile.*]` 10 16 block (verified at 60d0bec); appending one is safe and additive. 11 17 12 - Tracked: github.com/utensil/forest/issues/54 item 2 (new). 13 - To drop: upstream PR to wgputoy adding the metadata block, then bump 18 + Tracked: github.com/utensil/forest/issues/54 item 2, github.com/utensil/forest/issues/55. 19 + To drop: upstream PR adding the metadata block, then bump 14 20 prep_wasm hash + flake pin. 15 21 16 22 diff --git a/Cargo.toml b/Cargo.toml ··· 22 28 strip = true 23 29 + 24 30 +[package.metadata.wasm-pack.profile.release] 25 - +wasm-opt = ['-O', '--enable-bulk-memory', '--enable-bulk-memory-opt'] 31 + +wasm-opt = ['-O', '--all-features']