Files
rose-ash/shared/static/wasm/sx/deps.sxbc.json
giles c923a34fa8 Fix WASM browser click handlers: 8 bugs, 50 new VM tests
The sx-get links were doing full page refreshes because click handlers
never attached. Root causes: VM frame management bug, missing primitives,
CEK/VM type dispatch mismatch, and silent error swallowing.

Fixes:
- VM frame exhaustion: frames <- [] now properly pops to rest_frames
- length primitive: add alias for len in OCaml primitives
- call_sx_fn: use sx_call directly instead of eval_expr (CEK checks
  for type "lambda" but VmClosure reports "function")
- Boot error surfacing: Sx.init() now has try/catch + failure summary
- Callback error surfacing: catch-all handler for non-Eval_error exceptions
- Silent JIT failures: log before CEK fallback instead of swallowing
- vm→env sync: loadModule now calls sync_vm_to_env()
- sx_build_bytecode MCP tool added for bytecode compilation

Tests: 50 new tests across test-vm.sx and test-vm-primitives.sx covering
nested VM calls, frame integrity, CEK bridge, primitive availability,
cross-module symbol resolution, and callback dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 00:37:21 +00:00

1 line
13 KiB
JSON

{"magic":"SXBC","version":1,"hash":"e71dcede46ada0e7","module":{"bytecode":[51,1,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,51,19,0,128,18,0,5,51,21,0,128,20,0,5,51,23,0,128,22,0,5,51,25,0,128,24,0,5,51,27,0,128,26,0,5,51,29,0,128,28,0,5,51,31,0,128,30,0,5,51,33,0,128,32,0,5,51,35,0,128,34,0,5,51,37,0,128,36,0,50],"constants":[{"t":"s","v":"scan-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,1,20,1,0,16,0,16,1,48,2,5,16,1,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"scan-refs-walk"}],"arity":1}},{"t":"s","v":"scan-refs-walk"},{"t":"code","v":{"bytecode":[16,0,52,1,0,1,1,2,0,52,0,0,2,33,56,0,20,3,0,16,0,48,1,17,2,16,2,1,5,0,52,4,0,2,33,31,0,16,1,16,2,52,7,0,2,52,6,0,1,33,12,0,20,8,0,16,1,16,2,49,2,32,1,0,2,32,1,0,2,32,67,0,16,0,52,1,0,1,1,9,0,52,0,0,2,33,14,0,51,11,0,1,1,16,0,52,10,0,2,32,37,0,16,0,52,1,0,1,1,12,0,52,0,0,2,33,20,0,51,13,0,1,0,1,1,16,0,52,14,0,1,52,10,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"symbol"},{"t":"s","v":"symbol-name"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,49,2,50],"constants":[{"t":"s","v":"scan-refs-walk"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"dict"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,52,1,0,2,18,1,49,2,50],"constants":[{"t":"s","v":"scan-refs-walk"},{"t":"s","v":"dict-get"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"keys"}],"arity":2}},{"t":"s","v":"transitive-deps-walk"},{"t":"code","v":{"bytecode":[16,1,16,0,52,1,0,2,52,0,0,1,33,126,0,20,2,0,16,1,16,0,48,2,5,20,3,0,16,2,16,0,48,2,17,3,16,3,52,5,0,1,1,6,0,52,4,0,2,6,34,14,0,5,16,3,52,5,0,1,1,7,0,52,4,0,2,33,25,0,51,9,0,1,1,1,2,20,10,0,16,3,52,11,0,1,48,1,52,8,0,2,32,43,0,16,3,52,5,0,1,1,12,0,52,4,0,2,33,26,0,51,9,0,1,1,1,2,20,10,0,20,13,0,16,3,48,1,48,1,52,8,0,2,32,1,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"island"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,49,3,50],"constants":[{"t":"s","v":"transitive-deps-walk"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"scan-refs"},{"t":"s","v":"component-body"},{"t":"s","v":"macro"},{"t":"s","v":"macro-body"}],"arity":3}},{"t":"s","v":"transitive-deps"},{"t":"code","v":{"bytecode":[52,0,0,0,17,2,16,0,1,2,0,52,1,0,2,33,5,0,16,0,32,9,0,1,2,0,16,0,52,3,0,2,17,3,20,4,0,16,3,16,2,16,1,48,3,5,51,6,0,1,3,16,2,52,5,0,2,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"transitive-deps-walk"},{"t":"s","v":"filter"},{"t":"code","v":{"bytecode":[16,0,18,0,52,1,0,2,52,0,0,1,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"="}],"arity":1,"upvalue-count":1}}],"arity":2}},{"t":"s","v":"compute-all-deps"},{"t":"code","v":{"bytecode":[51,1,0,1,0,20,2,0,16,0,48,1,52,0,0,2,50],"constants":[{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,6,34,14,0,5,16,1,52,2,0,1,1,4,0,52,1,0,2,33,19,0,20,5,0,16,1,20,6,0,16,0,18,0,48,2,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"island"},{"t":"s","v":"component-set-deps!"},{"t":"s","v":"transitive-deps"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"env-components"}],"arity":1}},{"t":"s","v":"scan-components-from-source"},{"t":"code","v":{"bytecode":[20,0,0,1,1,0,16,0,48,2,17,1,51,3,0,16,1,52,2,0,2,50],"constants":[{"t":"s","v":"regex-find-all"},{"t":"s","v":"\\(~([a-zA-Z_][a-zA-Z0-9_\\-:/]*)"},{"t":"s","v":"map"},{"t":"code","v":{"bytecode":[1,1,0,16,0,52,0,0,2,50],"constants":[{"t":"s","v":"str"},{"t":"s","v":"~"}],"arity":1}}],"arity":1}},{"t":"s","v":"components-needed"},{"t":"code","v":{"bytecode":[20,0,0,16,0,48,1,17,2,52,1,0,0,17,3,51,3,0,1,3,1,1,16,2,52,2,0,2,5,16,3,50],"constants":[{"t":"s","v":"scan-components-from-source"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,48,2,32,1,0,2,5,20,3,0,18,1,16,0,48,2,17,1,16,1,52,5,0,1,1,6,0,52,4,0,2,6,33,16,0,5,20,8,0,16,1,48,1,52,7,0,1,52,0,0,1,33,10,0,20,8,0,16,1,48,1,32,9,0,20,9,0,16,0,18,1,48,2,17,2,51,11,0,0,0,16,2,52,10,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"empty?"},{"t":"s","v":"component-deps"},{"t":"s","v":"transitive-deps"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}}],"arity":1,"upvalue-count":2}}],"arity":2}},{"t":"s","v":"page-component-bundle"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,49,2,50],"constants":[{"t":"s","v":"components-needed"}],"arity":2}},{"t":"s","v":"page-css-classes"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,48,2,17,2,52,1,0,0,17,3,51,3,0,1,1,1,3,16,2,52,2,0,2,5,51,4,0,1,3,20,5,0,16,0,48,1,52,2,0,2,5,16,3,50],"constants":[{"t":"s","v":"components-needed"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,33,19,0,51,5,0,0,1,20,6,0,16,1,48,1,52,4,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"component-css-classes"}],"arity":1,"upvalue-count":2}},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"scan-css-classes"}],"arity":2}},{"t":"s","v":"scan-io-refs-walk"},{"t":"code","v":{"bytecode":[16,0,52,1,0,1,1,2,0,52,0,0,2,33,55,0,20,3,0,16,0,48,1,17,3,16,1,16,3,52,4,0,2,33,31,0,16,2,16,3,52,4,0,2,52,5,0,1,33,12,0,20,6,0,16,2,16,3,49,2,32,1,0,2,32,1,0,2,32,71,0,16,0,52,1,0,1,1,7,0,52,0,0,2,33,16,0,51,9,0,1,1,1,2,16,0,52,8,0,2,32,39,0,16,0,52,1,0,1,1,10,0,52,0,0,2,33,22,0,51,11,0,1,0,1,1,1,2,16,0,52,12,0,1,52,8,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"symbol"},{"t":"s","v":"symbol-name"},{"t":"s","v":"contains?"},{"t":"s","v":"not"},{"t":"s","v":"append!"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,49,3,50],"constants":[{"t":"s","v":"scan-io-refs-walk"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"dict"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,52,1,0,2,18,1,18,2,49,3,50],"constants":[{"t":"s","v":"scan-io-refs-walk"},{"t":"s","v":"dict-get"}],"arity":1,"upvalue-count":3}},{"t":"s","v":"keys"}],"arity":3}},{"t":"s","v":"scan-io-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,2,20,1,0,16,0,16,1,16,2,48,3,5,16,2,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"scan-io-refs-walk"}],"arity":2}},{"t":"s","v":"transitive-io-refs-walk"},{"t":"code","v":{"bytecode":[16,1,16,0,52,1,0,2,52,0,0,1,33,163,0,20,2,0,16,1,16,0,48,2,5,20,3,0,16,3,16,0,48,2,17,5,16,5,52,5,0,1,1,6,0,52,4,0,2,33,52,0,51,8,0,1,2,20,9,0,16,5,52,10,0,1,16,4,48,2,52,7,0,2,5,51,11,0,1,1,1,2,1,3,1,4,20,12,0,16,5,52,10,0,1,48,1,52,7,0,2,32,71,0,16,5,52,5,0,1,1,13,0,52,4,0,2,33,54,0,51,8,0,1,2,20,9,0,20,14,0,16,5,48,1,16,4,48,2,52,7,0,2,5,51,11,0,1,1,1,2,1,3,1,4,20,12,0,20,14,0,16,5,48,1,48,1,52,7,0,2,32,1,0,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"scan-io-refs"},{"t":"s","v":"component-body"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,18,2,18,3,49,5,50],"constants":[{"t":"s","v":"transitive-io-refs-walk"}],"arity":1,"upvalue-count":4}},{"t":"s","v":"scan-refs"},{"t":"s","v":"macro"},{"t":"s","v":"macro-body"}],"arity":5}},{"t":"s","v":"transitive-io-refs"},{"t":"code","v":{"bytecode":[52,0,0,0,17,3,52,0,0,0,17,4,16,0,1,2,0,52,1,0,2,33,5,0,16,0,32,9,0,1,2,0,16,0,52,3,0,2,17,5,20,4,0,16,5,16,4,16,3,16,1,16,2,48,5,5,16,3,50],"constants":[{"t":"s","v":"list"},{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"transitive-io-refs-walk"}],"arity":3}},{"t":"s","v":"compute-all-io-refs"},{"t":"code","v":{"bytecode":[51,1,0,1,0,1,1,20,2,0,16,0,48,1,52,0,0,2,50],"constants":[{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,2,0,1,1,3,0,52,1,0,2,33,21,0,20,4,0,16,1,20,5,0,16,0,18,0,18,1,48,3,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"component-set-io-refs!"},{"t":"s","v":"transitive-io-refs"}],"arity":1,"upvalue-count":2}},{"t":"s","v":"env-components"}],"arity":2}},{"t":"s","v":"component-io-refs-cached"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,5,0,1,1,6,0,52,4,0,2,6,33,36,0,5,20,9,0,16,4,48,1,52,8,0,1,52,7,0,1,6,33,16,0,5,20,9,0,16,4,48,1,52,10,0,1,52,7,0,1,33,10,0,20,9,0,16,4,49,1,32,11,0,20,11,0,16,0,16,1,16,2,49,3,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"not"},{"t":"s","v":"nil?"},{"t":"s","v":"component-io-refs"},{"t":"s","v":"empty?"},{"t":"s","v":"transitive-io-refs"}],"arity":3}},{"t":"s","v":"component-pure?"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,5,0,1,1,6,0,52,4,0,2,6,33,16,0,5,20,9,0,16,4,48,1,52,8,0,1,52,7,0,1,33,14,0,20,9,0,16,4,48,1,52,10,0,1,32,15,0,20,11,0,16,0,16,1,16,2,48,3,52,10,0,1,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"not"},{"t":"s","v":"nil?"},{"t":"s","v":"component-io-refs"},{"t":"s","v":"empty?"},{"t":"s","v":"transitive-io-refs"}],"arity":3}},{"t":"s","v":"render-target"},{"t":"code","v":{"bytecode":[16,0,1,1,0,52,0,0,2,33,5,0,16,0,32,9,0,1,1,0,16,0,52,2,0,2,17,3,20,3,0,16,1,16,3,48,2,17,4,16,4,52,6,0,1,1,7,0,52,5,0,2,52,4,0,1,33,6,0,1,8,0,32,72,0,20,9,0,16,4,48,1,17,5,16,5,1,8,0,52,5,0,2,33,6,0,1,8,0,32,45,0,16,5,1,10,0,52,5,0,2,33,6,0,1,10,0,32,27,0,20,11,0,16,0,16,1,16,2,48,3,52,4,0,1,33,6,0,1,8,0,32,3,0,1,10,0,50],"constants":[{"t":"s","v":"starts-with?"},{"t":"s","v":"~"},{"t":"s","v":"str"},{"t":"s","v":"env-get"},{"t":"s","v":"not"},{"t":"s","v":"="},{"t":"s","v":"type-of"},{"t":"s","v":"component"},{"t":"s","v":"server"},{"t":"s","v":"component-affinity"},{"t":"s","v":"client"},{"t":"s","v":"component-pure?"}],"arity":3}},{"t":"s","v":"page-render-plan"},{"t":"code","v":{"bytecode":[20,0,0,16,0,16,1,48,2,17,3,52,1,0,0,17,4,52,2,0,0,17,5,52,2,0,0,17,6,52,2,0,0,17,7,51,4,0,1,1,1,2,1,4,1,5,1,7,1,6,16,3,52,3,0,2,5,1,5,0,16,7,1,6,0,16,5,1,7,0,16,4,1,8,0,16,6,65,4,0,50],"constants":[{"t":"s","v":"components-needed"},{"t":"s","v":"dict"},{"t":"s","v":"list"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[20,0,0,16,0,18,0,18,1,48,3,17,1,18,2,16,0,16,1,52,1,0,3,5,16,1,1,3,0,52,2,0,2,33,33,0,20,4,0,18,3,16,0,48,2,5,51,6,0,0,4,20,7,0,16,0,18,0,18,1,48,3,52,5,0,2,32,9,0,20,4,0,18,5,16,0,49,2,50],"constants":[{"t":"s","v":"render-target"},{"t":"s","v":"dict-set!"},{"t":"s","v":"="},{"t":"s","v":"server"},{"t":"s","v":"append!"},{"t":"s","v":"for-each"},{"t":"code","v":{"bytecode":[18,0,16,0,52,1,0,2,52,0,0,1,33,12,0,20,2,0,18,0,16,0,49,2,32,1,0,2,50],"constants":[{"t":"s","v":"not"},{"t":"s","v":"contains?"},{"t":"s","v":"append!"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"component-io-refs-cached"}],"arity":1,"upvalue-count":6}},{"t":"s","v":"io-deps"},{"t":"s","v":"server"},{"t":"s","v":"components"},{"t":"s","v":"client"}],"arity":3}},{"t":"s","v":"env-components"},{"t":"code","v":{"bytecode":[51,1,0,1,0,16,0,52,2,0,1,52,0,0,2,50],"constants":[{"t":"s","v":"filter"},{"t":"code","v":{"bytecode":[20,0,0,18,0,16,0,48,2,17,1,16,1,52,1,0,1,6,34,7,0,5,16,1,52,2,0,1,50],"constants":[{"t":"s","v":"env-get"},{"t":"s","v":"component?"},{"t":"s","v":"macro?"}],"arity":1,"upvalue-count":1}},{"t":"s","v":"keys"}],"arity":1}}]}}