Files
rose-ash/shared/static/wasm/sx/freeze.sxbc
giles 59ac51a8ba
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 46s
kernel+bundle: fix nil-bytecode .sxbc (compile-blob serializer dropped Integer)
Every .sxbc shipped with `:bytecode (nil nil ...)` and `:arity nil`, so the WASM
kernel's vm.sx hit "VM: unknown opcode 0" on every module and fell back to .sx
source (slower, noisy console). Root cause: `raw_serialize` in the `compile-blob`
command (sx_server.ml) handles `Number` but not `Integer`, and bytecode opcodes +
arity/upvalue-count are `Integer`s — so they fell through to the `_ -> "nil"`
catch-all and serialized as nil. Same class of bug as the value_to_js Integer gap
(689dae7d). It went unnoticed because source-fallback masks it. Add the Integer
case and regenerate: the web stack now loads entirely from bytecode (0 unknown-
opcode warnings, 0 source fallbacks), boost + SPA unchanged. compiler.sx in the
bundle was also stale — re-synced to the canonical lib/compiler.sx.

Verified: native host conformance 271/271; chromium boots with 0 unknown-opcode
warnings + 0 source-fallback loads; spa-check still passes (boost 6/6, fragment
swap). Prereq for content-addressing the assets (caching real bytecode, not nil).
2026-06-29 13:17:20 +00:00

4 lines
2.5 KiB
Plaintext

(sxbc 1 "050ab6181dc93341"
(code
:constants ("freeze-registry" "dict" "freeze-signal" {:upvalue-count 0 :arity 2 :constants ("sx-freeze-scope" "context" "freeze-registry" "get" "list" "name" "signal" "dict" "append!" "dict-set!") :bytecode (1 0 0 2 52 1 0 2 17 2 16 2 33 55 0 20 2 0 16 2 52 3 0 2 6 34 5 0 5 52 4 0 0 17 3 16 3 1 5 0 16 0 1 6 0 16 1 52 7 0 4 52 8 0 2 5 20 2 0 16 2 16 3 52 9 0 3 32 1 0 2 50)} "freeze-scope" {:upvalue-count 0 :arity 2 :constants ("sx-freeze-scope" "scope-push!" "freeze-registry" "list" "dict-set!" "cek-call" "scope-pop!") :bytecode (1 0 0 16 0 52 1 0 2 5 20 2 0 16 0 52 3 0 0 52 4 0 3 5 16 1 2 52 5 0 2 5 1 0 0 52 6 0 1 5 2 50)} "cek-freeze-scope" {:upvalue-count 0 :arity 1 :constants ("freeze-registry" "get" "list" "dict" {:upvalue-count 1 :arity 1 :constants ("name" "get" "signal-value" "signal" "dict-set!") :bytecode (18 0 16 0 1 0 0 52 1 0 2 20 2 0 16 0 1 3 0 52 1 0 2 48 1 52 4 0 3 50)} "for-each" "name" "signals") :bytecode (20 0 0 16 0 52 1 0 2 6 34 5 0 5 52 2 0 0 17 1 52 3 0 0 17 2 51 4 0 1 2 16 1 52 5 0 2 5 1 6 0 16 0 1 7 0 16 2 52 3 0 4 50)} "cek-freeze-all" {:upvalue-count 0 :arity 0 :constants ({:upvalue-count 0 :arity 1 :constants ("cek-freeze-scope") :bytecode (20 0 0 16 0 49 1 50)} "freeze-registry" "keys" "map") :bytecode (51 0 0 20 1 0 52 2 0 1 52 3 0 2 50)} "cek-thaw-scope" {:upvalue-count 0 :arity 2 :constants ("freeze-registry" "get" "list" "signals" {:upvalue-count 1 :arity 1 :constants ("name" "get" "signal" "nil?" "reset!") :bytecode (16 0 1 0 0 52 1 0 2 17 1 16 0 1 2 0 52 1 0 2 17 2 18 0 16 1 52 1 0 2 17 3 16 3 52 3 0 1 167 33 12 0 20 4 0 16 2 16 3 49 2 32 1 0 2 50)} "for-each") :bytecode (20 0 0 16 0 52 1 0 2 6 34 5 0 5 52 2 0 0 17 2 16 1 1 3 0 52 1 0 2 17 3 16 3 33 14 0 51 4 0 1 3 16 2 52 5 0 2 32 1 0 2 50)} "cek-thaw-all" {:upvalue-count 0 :arity 1 :constants ({:upvalue-count 0 :arity 1 :constants ("cek-thaw-scope" "name" "get") :bytecode (20 0 0 16 0 1 1 0 52 2 0 2 16 0 49 2 50)} "for-each") :bytecode (51 0 0 16 0 52 1 0 2 50)} "freeze-to-sx" {:upvalue-count 0 :arity 1 :constants ("cek-freeze-scope" "sx-serialize") :bytecode (20 0 0 16 0 48 1 52 1 0 1 50)} "thaw-from-sx" {:upvalue-count 0 :arity 1 :constants ("sx-parse" "empty?" "cek-thaw-scope" "name" "get") :bytecode (20 0 0 16 0 48 1 17 1 16 1 52 1 0 1 167 33 24 0 16 1 169 17 2 20 2 0 16 2 1 3 0 52 4 0 2 16 2 49 2 32 1 0 2 50)} {:library (sx freeze) :op "import"}) :bytecode (52 1 0 0 128 0 0 5 51 3 0 128 2 0 5 51 5 0 128 4 0 5 51 7 0 128 6 0 5 51 9 0 128 8 0 5 51 11 0 128 10 0 5 51 13 0 128 12 0 5 51 15 0 128 14 0 5 51 17 0 128 16 0 5 1 18 0 112 50)))