code wiki / _hdl_build / nx_chip8_wasm_gate.nx

nx_chip8_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_chip8_wasm_gate.nx

5911 B107 linesdepth 3pulls 6 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 4 imports · 0 importers

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

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_wasm_vm.nxnx_gate_verdict.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 nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ 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_munmap sys_close sys_exit ↻ g_check g_puts ↻ wld wstep wreg

structs

none

consts

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

functions

16func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
37func 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
38func wstep(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_step" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main
39func wreg(mod: *WasmMod, xi: i64) -> i64 { return wm_run(mod, "ch8_reg" as *u8, 0, xi, 0, 0, 0, 2) }
called by 1: main
40func 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
41func wvf(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_vf" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main
42func wgeti(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_geti" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main
44func main() -> i64