code wiki / _hdl_build / nx_scratch_wasm_gate.nx

nx_scratch_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_scratch_wasm_gate.nx

3834 B75 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
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 3 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_scratch_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 wm_find_export wm_name_eq g_check g_puts ↻ 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

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_scratch_probe.nx"
13const OUT_WAT: *u8 = "/tmp/scr.wat"
14const OUT_WASM: *u8 = "/tmp/scr.wasm"
15const KAT_PROBE: i64 = 1496014960
16const KAT_GAP: i64 = 128

functions

18func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
38func main() -> i64