code wiki / _hdl_build / nx_meshview_wasm_gate.nx

nx_meshview_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_meshview_wasm_gate.nx

20309 B255 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic meshview
docsdependenciesstructsconstsfunctions

about

nx_meshview_wasm_gate.nx -- R3 WASM proof: compiles nx_meshview_wasm.nx to .wasm via the SOVEREIGN chain (nx_compile_wat -> nx_wat_compiler, NO Emscripten), runs it in our own nx_wasm_vm, and checks the rendered framebuffer (read straight from the VM's linear memory) is z-correct + non-vacuous + deterministic -- i.e. our general-mesh renderer renders IN THE BROWSER LANE, sovereign, no WebGL/NVIDIA. expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_g_puts_lib.nx nx_wasm_vm.nx nx_meshview_wasm_gate.nx

imports: nx_syscalls.nxnx_g_puts_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 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 ↻ sys_exit ↻ wv_u8 ↻ wm_skip_imm

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_meshview_wasm.nx"
12const OUT_WAT: *u8 = "/tmp/mv.wat"
13const OUT_WASM: *u8 = "/tmp/mv.wasm"
15const O_FB: i64 = 0
16const MV_N: i64 = 4096
17const CTR: i64 = 2080 // (32*64+32) screen-centre pixel index
18const BG: i64 = 4280295456 // background r32 g32 b32 a255

functions

20func g_pn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var x: i64=v; if x<0{b[0]=45 as u8;sys_write(1,b,1);x=0-x} if x==0{b[0]=48 as u8;sys_write(1,b,1);return 0} var d: i64=0; var y: i64=x; while y>0{d=d+1;y=y/10} var i: i64=d-1; y=x; while i>=0{b[i]=(48+(y%10)) as u8;y=y/10;i=i-1} sys_write(1,b,d); return 0 }
called by 1: main calls 2: sys_mmapsys_write
21func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c }
called by 1: main calls 1: g_puts
22func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
41func cover(fbp: *i64) -> i64 { var k: i64=0; var i: i64=0; while i<MV_N { if fbp[i]!=BG {k=k+1} i=i+1 } return k }
called by 1: main
43func main() -> i64