From 7d07ac7e4a2191e2d7d7777749337a584c4e536d Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 30 Jun 2026 15:51:44 +0000 Subject: [PATCH] =?UTF-8?q?note:=20rebuild=20does=20NOT=20fix=20the=20WASM?= =?UTF-8?q?=20'try'=20deprecation=20(tested)=20=E2=80=94=20needs=20toolcha?= =?UTF-8?q?in=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ran build-all.sh with wasm_of_ocaml 6.3.2: output .wasm units came out byte-identical to the Jun-29 backup (same hashes, diff -rq clean), so 6.3.2 still emits legacy 'try'. A plain rebuild is a dead end; the fix needs a newer wasm_of_ocaml (or flag) that emits try_table. No harm done — deployed artifacts unchanged, live SPA intact. apt wabt/wasm2wat can't read these wasm-GC binaries (0x5e); need wasm-tools or a real-browser check. Co-Authored-By: Claude Opus 4.8 --- plans/NOTE-wasm-try-deprecation.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plans/NOTE-wasm-try-deprecation.md b/plans/NOTE-wasm-try-deprecation.md index bdba7664..28a15c3e 100644 --- a/plans/NOTE-wasm-try-deprecation.md +++ b/plans/NOTE-wasm-try-deprecation.md @@ -19,14 +19,16 @@ interactive picker need the kernel). ## Fix -1. **Rebuild the kernel with the current toolchain.** `bash hosts/ocaml/browser/build-all.sh` - (dune builds `browser/sx_browser.bc.wasm.js`), then `bundle.sh` syncs to - `shared/static/wasm/`. Modern wasm_of_ocaml 6.x *may* emit `try_table` by default → a fresh - rebuild alone could fix #1. **Verify:** disassemble a `.wasm` unit (`wasm-tools print` / grep - for `try_table` vs `try`), then boot it in a REAL up-to-date browser (not just the older - Playwright chromium, which still accepts `try`) and confirm no deprecation warning + SxKernel - registers. If 6.3.2 still emits legacy `try`, check for a wasm_of_ocaml flag or bump the - compiler. +1. **A plain rebuild does NOT fix it — TESTED 2026-06-30, dead end.** Ran + `bash hosts/ocaml/browser/build-all.sh` with the current `wasm_of_ocaml 6.3.2`. The output + `.wasm` units came out **byte-identical** to the Jun-29 backup (same content hashes, e.g. + `dune__exe__Sx_browser-4878f9e1.wasm`; `diff -rq` clean). So 6.3.2 still emits the legacy + `try` — rebuilding gains nothing. **The fix needs a newer `wasm_of_ocaml` (or a flag) that + emits `try_table`** — a toolchain *upgrade* (`opam upgrade wasm_of_ocaml-compiler` to a + version that defaults to `try_table`, or find the relevant `--enable` flag), then rebuild + + verify. (Disassembly check note: apt's `wasm2wat`/wabt is too old for these wasm-GC binaries — + `error: unexpected type form (got 0x5e)`; need `wasm-tools` for wasm-GC, or verify in a real + up-to-date browser. Playwright's older chromium still accepts `try`, so it won't tell you.) 2. **`loadManifest` → async.** Change to an async fetch and restructure the boot so the manifest is awaited before module loading (it's currently consumed synchronously). Contained to `hosts/ocaml/browser/sx-platform.js` + its copy in `shared/static/wasm/`.