code wiki / _hdl_build / nx_faithdiff.nx

nx_faithdiff.nx

buildroot/runtime/_hdl_build/nx_faithdiff.nx

10644 B182 linesdepth 7pulls 19 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_faithdiff.nx -- THE WAT-FAITHFULNESS DIFFERENTIAL DEBUGGER (operator 2026-07-06: "build the tool that can troubleshoot this in one step in <10s so we can eat the debt and grow"). ONE command: nx_sov_build_run nx_faithdiff It (1) compiles nx_faithdiff_probe.nx -> wasm via the two sovereign compilers, (2) loads it in the sovereign wasm-VM, (3) runs EACH probe function in the VM AND natively over an input battery, (4) reports the FIRST function+input where VM != native. That pin is the exact WAT-lowering (or VM-interp) bug -- no more manual bisect-by-rebuild. To debug any new module: paste its suspect funcs into the probe + run. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_wasm_vm.nx nx_faithdiff_probe.nx nx_faithdiff.nx

imports: nx_syscalls.nxnx_wasm_vm.nxnx_faithdiff_probe.nx

imported by: nobody (leaf or entry point)

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

main fw sys_write sys_openat_rd sys_exit sys_close run_elf sys_fork sys_mmap sys_execve sys_exit ↻ sys_wait4 sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read sys_close ↻ fn sys_mmap ↻ sys_write ↻ wm_new sys_mmap ↻ wm_parse sys_mmap ↻ wv_u8 wv_uleb vc_aq_level wm_run wm_find_export wm_name_eq sys_mmap ↻ wm_call sys_mmap ↻ wv_u8 ↻ wm_memo_get wm_match_end sys_mmap ↻ sys_write ↻

structs

none

consts

12const K_MAGIC_262144: i64 = 262144
13const K_MAGIC_65535: i64 = 65535
15const CWAT: *u8 = "/tmp/nx_compile_wat.sov.elf"
16const WATC: *u8 = "/tmp/nx_wat_compiler.sov.elf"
17const SRC: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/_hdl_build/nx_faithdiff_probe.nx"
18const WAT: *u8 = "/tmp/nx_faithdiff_probe.wat"
19const WASM: *u8 = "/tmp/nx_faithdiff_probe.wasm"

functions

21func fw(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
22func fn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
27func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
43func fill_block(cur: *u8, seed: i64) -> i64
called by 1: main
54func main() -> i64