code wiki / _hdl_build / nx_chip8_wasm_gate.nx

nx_chip8_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_chip8_wasm_gate.nx

5470 B100 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic chip8
docsdependenciesstructsconstsfunctions

about

nx_chip8_wasm_gate.nx -- R0.3 WASM proof: compiles nx_chip8.nx to wasm via the sovereign pipeline, then drives the SAME program in nx_wasm_vm (reset -> load -> step, state persisting in the VM's linear memory) and checks registers + framebuffer + collision match the native gate. Proves the CHIP-8 emulator runs in the browser lane, bit-identical to native. NISHI all the way (fork sovereign compilers -> nx_wasm_vm, no .sh).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_chip8_wasm_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.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 g_puts sys_write run_elf sys_fork sys_mmap sys_execve sys_exit sys_wait4 g_pn sys_mmap ↻ 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 g_check g_puts ↻ 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 ↻

structs

none

consts

9const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf"
10const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf"
11const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_chip8.nx"
12const OUT_WAT: *u8 = "/tmp/ch8.wat"
13const OUT_WASM: *u8 = "/tmp/ch8.wasm"

functions

15func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
36func wld(mod: *WasmMod, addr: i64, byte: i64) -> i64 { return wm_run(mod, "ch8_load" as *u8, 0, addr, byte, 0, 0, 3) }
called by 1: main calls 1: wm_run
37func wstep(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_step" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main calls 1: wm_run
38func wreg(mod: *WasmMod, xi: i64) -> i64 { return wm_run(mod, "ch8_reg" as *u8, 0, xi, 0, 0, 0, 2) }
called by 1: main calls 1: wm_run
39func wpix(mod: *WasmMod, px: i64, py: i64) -> i64 { return wm_run(mod, "ch8_pixel" as *u8, 0, px, py, 0, 0, 3) }
called by 1: main calls 1: wm_run
40func wvf(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_vf" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main calls 1: wm_run
41func wgeti(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_geti" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main calls 1: wm_run
43func main() -> i64