nx_map_file_gate.nx
buildroot/runtime/nx_map_file_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 13 | func 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 } |
| 14 | func mf_n(v: i64) -> i64 |
| 28 | func main() -> i64 |