code wiki / _hdl_build / nx_scratch_wasm_gate.nx

nx_scratch_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_scratch_wasm_gate.nx

4277 B82 linesdepth 3pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic scratch
docsdependenciesstructsconstsfunctions

about

nx_scratch_wasm_gate.nx -- R0.0b gate, NISHI all the way up. Forks the sovereign compiler ELFs to build nx_scratch_probe.nx -> wasm, then EXECUTES it in the sovereign nx_wasm_vm and checks that the WASM-lane nx_scratch hands out DISTINCT framed buffers (sp_probe == 1496014960, sp_gap == 128). Proves native<->wasm scratch parity -- the multi-word-local idiom now works in the browser lane, no [i64;N] compiler feature. license_tier: ORIGINAL (build-fork spine from nx_aw_push; VM-verify spine from nx_sha256_wasm_vm_gate)

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_gate_verdict.nx nx_scratch_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 ↻ gv_ctr sys_mmap ↻ gv_verdict

structs

none

consts

11const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf"
12const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf"
13const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_scratch_probe.nx"
14const OUT_WAT: *u8 = "/tmp/scr.wat"
15const OUT_WASM: *u8 = "/tmp/scr.wasm"
16const KAT_PROBE: i64 = 1496014960
17const KAT_GAP: i64 = 128

functions

19func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
39func main() -> i64