wasmplus #43
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wasmplus"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: removing JSON from the engine left the Tier-2 reactor emitting bson that its host glue couldn't decode, and just wasm-ci was broken with no plan. Resolution (the design we specced in docs/design/WASM_HOST_GLUE.md): 1. ABI enabler — plg_rt_atom_name(id) → u64 in reactor.rs, reading the runtime interner (program + query atoms). Implementation corrected the step-1 plan: the originally-proposed static @plg_atom_strs export couldn't resolve query-introduced atoms (ids ≥ table size), which surfaced as a vanished functor key on X=f(X). The runtime resolver fixes that. 2. Host bson→JSON glue — reactor.mjs rewritten with a bson parser, TermBuf/cell-ABI walker, and native JSON renderer; per-instance atom cache (WeakMap) to avoid cross-module conflation. 3. Smoke — reactor-smoke.mjs now fixture-asserts the bson→JSON decode (no native differential — native has no JSON), plus single-query mode for the deep-recursion check. 4. Recipe — wasm-reactor-smoke un-gated and restored; wasm-ci echo flipped back to honest "passed." The principle held: plgc speaks text + bson only. JSON lives entirely in host code (reactor.mjs), with plg_rt_atom_name as the one data export the host needs. Verified: atoms (program + query), ints/floats/big, compounds, proper/improper lists, cyclic terms (cut to "_"), errors, exhausted:false under limit — all through real worker modules under Node's V8; plus the 1M-deep return_call constant-stack gate. Two real findings the process surfaced (worth noting for review): the static-table insufficiency (revised to runtime plg_rt_atom_name) and the cross-module cache conflation (scoped via WeakMap). Both were caught by the cyclic-term test case and the two-module driver respectively — exactly what the verification was for. The design doc docs/design/WASM_HOST_GLUE.md records the decisions; once merged, per the myspec convention it moves to docs/design/done/ and the feature gets a first-class doc (the wasm-worker guide) — your call on timing and git.