code wiki / (root) / nx_map_file_gate.nx

nx_map_file_gate.nx

buildroot/runtime/nx_map_file_gate.nx

4604 B96 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic map
docsdependenciesstructsconstsfunctions

about

nx_map_file_gate.nx -- gates the DEBT-EATEN file I/O floor (2026-07-15): (a) sys_read_file now sizes its buffer from the file itself (the old fixed 4 GiB cap SILENTLY TRUNCATED bigger files into plausible-garbage tensor reads); (b) NEW sys_map_file = read-only file-backed mmap (any size, zero-copy, only touched pages resident -- the lazy-MoE serving shape). Teeth: T1 sys_map_file: exact length + BYTE-IDENTICAL to sys_read_file on a patterned temp file T2 honesty: absent path -> 0 pointer + 0 length (both functions) T3 read-only by construction: the mapping's first byte reads correctly twice (stability), and the pattern check covers head/middle/tail (page boundaries crossed) expect_exit: 0 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_map_file_gate.nx

imports: nx_syscalls.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 mf_w sys_write sys_openat_wr sys_mmap sys_write ↻ sys_close sys_map_file sys_openat_rd sys_lseek sys_close ↻ sys_read_file sys_openat_rd ↻ sys_lseek ↻ sys_mmap ↻ sys_read sys_close ↻ mf_n mf_w ↻ sys_mmap ↻ sys_write ↻ gv_ctr sys_mmap ↻ gv_verdict gv_puts sys_write ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gv_cat

structs

none

consts

none

functions

13func mf_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: mf_nmain calls 1: sys_write
14func mf_n(v: i64) -> i64
called by 1: main calls 3: mf_wsys_mmapsys_write
28func main() -> i64