code wiki / _hdl_build / nx_wasm_vm_exec_gate.nx

nx_wasm_vm_exec_gate.nx

buildroot/runtime/_hdl_build/nx_wasm_vm_exec_gate.nx

5906 B95 linesdepth 5pulls 17 transitivereach 0 importersview sourcekind gate/prooftopic wasm
docsdependenciesstructsconstsfunctions

about

nx_wasm_vm_exec_gate.nx -- R1+R2: the sovereign WASM VM EXECUTES the real nx_vcodec.wasm and we DIFF it against the native codec. R1 validates the executor on functions that touch NO byte memory (constant accessors + the pure-integer vc_vbits with its calls/control-flow) -- if those match native, the VM's arithmetic, calls, and structured control are sound. R2 then runs the actual codec (vc_wasm_encode -> vc_wasm_decode) on a real 16x16 frame and compares the independent-decoder output to the native packed codec's. If R1 passes but R2 diverges, the fault is the wasm's u8 memory access -- the exact thing this VM exists to catch.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_vcodec.nx nx_wasm_vm_exec_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_wasm_vm.nxnx_vcodec.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit wm_new sys_mmap ↻ wm_parse sys_mmap ↻ wv_u8 wv_uleb wm_find_export wm_name_eq g_pn sys_mmap ↻ sys_write ↻ wm_run wm_find_export ↻ sys_mmap ↻ wm_call sys_mmap ↻ wv_u8 ↻ wm_memo_get wm_match_end sys_mmap ↻ sys_write ↻ sys_exit ↻ wv_u8 ↻ wm_skip_imm wv_u8 ↻ wv_uleb ↻ wv_sleb sys_munmap wm_memo_put

structs

none

consts

none

functions

12func g_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: main
14func main() -> i64