code wiki / _hdl_build / nx_watemit_ws_register.nx

nx_watemit_ws_register.nx

buildroot/runtime/_hdl_build/nx_watemit_ws_register.nx

2790 B51 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_watemit_ws_register.nx -- file the WAT-emitter 16-ARGUMENT CAP bug into the WMS SSOT for the toolchain empire (safe read-modify-write; seed NOT rerun). THE BUG (found 2026-07-02 via nx_mineworld_wasm_vet): a call to a >16-param function emits only 16 operands at the call site -- silently. Native x86 is fine, so every native gate passes; the WASM is INVALID: browsers reject the module at VALIDATION (the /mineworld light-blue box) and the sovereign VM underflows its operand stack (VM-TRAP code=3 op=0x10). Repro: any .nx fn with >16 params -> nx_compile_wat -> count operands before its `call` in the .wat. Games ship-path works around it (fill_zt packs uv pairs = exactly 16 params); the ROOT fix + an emitter ARITY GATE (call-site operand count == callee type param count, whole-module) belongs to E-NXC2. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_workstream_store.nx nx_seg_store.nx nx_syscalls.nx nx_watemit_ws_register.nx

imports: nx_workstream_store.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ss_begin ss_begin_cap sys_mmap sys_mmap ↻ ws_get ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 wer_addid ws_member ws_len ss_add ss_add2 ss_w32 ss_len ↻ wer_len ws_seg_next ss_next_segid sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_segid_ok ss_commit ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻

structs

none

consts

12const K_MAGIC_262144: i64 = 262144

functions

14func wer_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
15func wer_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
16func wer_addid(idsbuf: *u8, olenp: *i64, id: *u8) -> i64
called by 1: main calls 1: ws_member
26func main() -> i64