host: doc — wasm kernel boot crash fixed (crypto), boost still blocked on web-stack load
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 41s

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 07:57:18 +00:00
parent fce9e0c617
commit 0ca70eb4b5

View File

@@ -43,7 +43,29 @@ graceful degradation to plain server-rendered pages with no JS.
WASM kernel (sx.rose-ash.com avoids this because its Docker image ships a WASM kernel (sx.rose-ash.com avoids this because its Docker image ships a
consistent bundle and it navigates via client-router page-routes, not boost). consistent bundle and it navigates via client-router page-routes, not boost).
## Rebuild attempt (2026-06-28)FAILED, reverted ## UPDATE 2026-06-29kernel BOOT crash fixed (crypto WASM-safe)
The boot crash was NOT the build pipeline — it was the kernel's crypto stack
assuming 63-bit native int. On the web targets (js_of_ocaml 32-bit, wasm_of_ocaml
31-bit) sha2/cbor/cid/ed25519 truncated, and ed25519 precomputes `sqrtm1` +
`base_point` AT MODULE INIT via a base-2^26 bignum whose 52-bit products overflow
`Char.chr(-4)` crash on load. Fixed in `fce9e0c6` (sx_sha2 Int32 rounds +
Int64 length, sx_cbor Int64 width-select, sx_cid bounded base32, sx_ed25519 Int64
bignum mul/div_small). Verified: NIST/CID vectors match native↔js↔wasm; native
conformance 271/271; **the freshly-built browser kernel now BOOTS** (SxKernel
live, data-sx-ready=true, crypto-sha256 correct on js + wasm).
REMAINING for boost (separate layer — web-stack loading, NOT crypto):
- `.sxbc` still fail `VM: unknown opcode 0` against the SX-level `vm.sx`
interpreter, even freshly recompiled — a bytecode-format mismatch (likely the
sx-vm-extensions merge changed sx_vm.ml's opcodes but the served `vm.sx` wasn't
regenerated). So the web stack falls back to `.sx` source.
- `boot.sx` SOURCE then fails `Expected list, got string` (fails on the old
main-worktree kernel too), so `process-boosted` never runs → boost 0/N.
Next: either regenerate `vm.sx` to match the compiler so `.sxbc` load, or fix
the `boot.sx` source-eval failure so source fallback completes.
## Rebuild attempt (2026-06-28) — FAILED, reverted (superseded by the fix above)
Tried it: `dune build browser/sx_browser.bc.wasm.js` succeeded (with many Tried it: `dune build browser/sx_browser.bc.wasm.js` succeeded (with many
`integer-overflow` warnings — "generated code might be incorrect"), and `integer-overflow` warnings — "generated code might be incorrect"), and