code wiki / _hdl_build / nx_sext_wasm_kat_gate.nx

nx_sext_wasm_kat_gate.nx

buildroot/runtime/_hdl_build/nx_sext_wasm_kat_gate.nx

4796 B81 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_sext_wasm_kat_gate.nx -- END-TO-END KAT for the WASM lane's subword sign-extend fix (2026-07-10): forks the sovereign pipeline (nx_compile_wat: .nx -> wat; nx_wat_compiler: wat -> wasm) on nx_sext_wasm_kat.nx, loads the wasm in nx_wasm_vm, and asserts the SEMANTICS in-VM: T1 both tools rc=0 (pre-fix: nx_wat_compiler REFUSED -- i64.store32/load32_* were unknown atoms) T2 exports resolve T3 sext_kat() == 0 (*i32 negative+positive round-trip AND *u8 0xA0->160 witness, all in-VM) T4 sext_load_neg() == -100 (the visible sign-extension number; a zero-extend lane returns 4294967196) This is the WASM twin of nx_i32store_probe_gate (x86) -- one language semantic, every backend. Stage first: nx_sov_build_run nx_compile_wat --build-only + nx_sov_build_run nx_wat_compiler --build-only. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_wasm_vm.nx nx_sext_wasm_kat_gate.nx

imports: nx_syscalls.nxnx_wasm_vm.nx

imported by: nobody (leaf or entry point)

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

main sw_puts sys_write sw_run_elf sys_fork sys_mmap sys_execve sys_exit sys_wait4 sw_pn sys_mmap ↻ sys_write ↻ sw_check sw_puts ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close wm_new sys_mmap ↻ wm_parse sys_mmap ↻ wv_u8 wv_uleb wm_find_export wm_name_eq 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 ↻

structs

none

consts

14const SW_CWAT: *u8 = "/tmp/nx_compile_wat.sov.elf"
15const SW_WATC: *u8 = "/tmp/nx_wat_compiler.sov.elf"
16const SW_SRC: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_sext_wasm_kat.nx"
17const SW_OWAT: *u8 = "/tmp/sextkat.wat"
18const SW_OWASM: *u8 = "/tmp/sextkat.wasm"

functions

20func sw_puts(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 2: sw_checkmain calls 1: sys_write
21func sw_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
25func sw_check(name: *u8, cond: i64) -> i64
called by 1: main calls 1: sw_puts
28func sw_run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
40func main() -> i64