nx_npy_gate.nx
buildroot/runtime/nx_npy_gate.nx
about
nx_npy_gate.nx -- proves the .npy parser reads what is there and REFUSES the three things that
corrupt silently. procgen PG38's opening move, gateable on its own before any model byte is fetched.
WHY THE NEG-CONTROLS ARE THE POINT. A forward-only suite here would pass for a parser that ignores
fortran_order, guesses an itemsize and trusts the declared shape -- and every one of those returns
PLAUSIBLE NUMBERS rather than an error. A transposed basis, a factor-of-two offset walk, or a read
past the end of a member all look like data. So T7-T10 are the load-bearing teeth.
THE FIXTURE IS ASSEMBLED AT RUNTIME, never read from disk: the parser's own subject is a byte layout,
so a byte layout built in memory is the honest fixture and there is no file to go stale. The teeth are
ARITHMETIC over that layout (count = product of dims; data_off + count*itemsize = total), which makes
them their own oracle in the mathcore sense -- no second implementation to disagree with.
license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_npy_lib.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
| 22 | const NG_CAP: i64 = 262144 |
| 23 | const NG_Q: i64 = 39 // '\'' by name, the header's own quoting |
functions
| 25 | func ng_puts(b: *u8, o0: i64, s: *u8) -> i64 called by 1: ng_mk |
| 32 | func ng_putb(b: *u8, o: i64, v: i64) -> i64 { b[o] = v as u8; return o + 1 } called by 1: ng_mk |
| 36 | func ng_mk(b: *u8, descr: *u8, fortran: *u8, shape_txt: *u8, nbytes: i64) -> i64 |
| 67 | func main() -> i64 |