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/`.