code wiki / _hdl_build / nx_meshview_wasm_gate.nx
nx_meshview_wasm_gate.nx
buildroot/runtime/_hdl_build/nx_meshview_wasm_gate.nx
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
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
structs
| none |
consts
| 9 | const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf" |
| 10 | const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf" |
| 11 | const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_meshview_wasm.nx" |
| 12 | const OUT_WAT: *u8 = "/tmp/mv.wat" |
| 13 | const OUT_WASM: *u8 = "/tmp/mv.wasm" |
| 15 | const O_FB: i64 = 0 |
| 16 | const MV_N: i64 = 4096 |
| 17 | const CTR: i64 = 2080 // (32*64+32) screen-centre pixel index |
| 18 | const BG: i64 = 4280295456 // background r32 g32 b32 a255 |
functions
| 20 | func 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 } |
| 21 | func 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 } |
| 22 | func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64 |
| 41 | func 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 |
| 43 | func main() -> i64 |