code wiki / _hdl_build / nx_watemit_ws_register.nx
nx_watemit_ws_register.nx
buildroot/runtime/_hdl_build/nx_watemit_ws_register.nx
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
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
structs
| none |
consts
| 12 | const K_MAGIC_262144: i64 = 262144 |
functions
| 14 | func 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 } |
| 15 | func wer_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 16 | func wer_addid(idsbuf: *u8, olenp: *i64, id: *u8) -> i64 |
| 26 | func main() -> i64 |