code wiki / (root) / nx_enginelab_driver_gate.nx

nx_enginelab_driver_gate.nx

buildroot/runtime/nx_enginelab_driver_gate.nx

23148 B403 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic enginelab
docsdependenciesstructsconstsfunctions

about

nx_enginelab_driver_gate.nx -- END-TO-END gate for nx_enginelab, THE DRIVER. WHAT THIS PROVES THAT nx_enginelab_gate CANNOT. That gate asserts arithmetic properties of the instrument library on fixtures built in memory, and says so in its own verdict: "fixtures whose answers are known by construction". It therefore passes exactly as well when NOTHING drives the library over a real frame -- which is the state the estate was in until nx_enginelab existed. This gate forks the DEPLOYED driver against the REAL engine and asserts on its published report, so a green here means a real renderer was really measured. EVERY TOOTH BINDS TO A DENOMINATOR. A report block that was never printed parses as -1 here, never as 0, so a tooth cannot pass because a field was missing: the field helpers return -1 for "the tag was not printed" and -1 for "the key was not on that tag's line", and the teeth test for positive values. THE FIXTURE-REACHED-THE-CONDITION TEETH COME FIRST and assert the subprocess actually ran and produced bytes, because a harness failure returns an empty capture that would otherwise make every absence-shaped assertion below vacuously true. PARSING IS TAG-ANCHORED AND LINE-BOUNDED. The driver prints several blocks that share key names (q= appears on SUBJECT and on every JOIN row; draws= appears on JOIN and on the named-absence row), so an unanchored search would read one block's data as another's. gdrv_field finds the TAG, bounds itself to that tag's line, and only then looks for the key -- the same positional discipline gv_last_line uses for verdicts. SCRATCH IS PRIVATE AND UNDER /tmp. A gate that shares scratch with a production beat measures the fixture instead of the code; this one writes only under GDRV_DIR, created at SETUP (a teardown does not run when a run crashes). license_tier: ORIGINAL No hardware writes (Rule 26): forks a read-only measurement organ.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_tool_run.nx nx_enginelab_driver_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ sys_mkdir gdrv_num_str sys_mmap ↻ gdrv_buf sys_mmap ↻ gdrv_len sys_mmap ↻ gdrv_run gdrv_subject gdrv_exists sys_mmap ↻ sys_fstatat sys_munmap sys_mmap ↻ tr_run_capture sys_mmap ↻ sys_pipe2 sys_fork sys_close sys_dup3

structs

none

consts

38const GDRV_SUBJ_REL: *u8 = "_offc/nx_enginelab.elf"
39const GDRV_SUBJ_ABS: *u8 = "/volume1/homes/elderwesto/nishihost/_offc/nx_enginelab.elf"
40const GDRV_STATBUF: i64 = 256
41const GDRV_DIR: *u8 = "/tmp/nx_enginelab_driver_gate"
42const GDRV_CAPFILE: *u8 = "/tmp/nx_enginelab_driver_gate/roundtrip.elc"
44const GDRV_BADPATH: *u8 = "/tmp/nx_enginelab_driver_gate/no_such_dir/deep.elc"
45const GDRV_MODE_0755: i64 = 493
46const GDRV_OUTCAP: i64 = 32768
47const GDRV_ARGVMAX: i64 = 16
52const GDRV_Q_FAST: i64 = 8
53const GDRV_Q_MID: i64 = 4
54const GDRV_FRAMES: i64 = 3
55const GDRV_V: i64 = 2
56const GDRV_GRID: i64 = 8
57const GDRV_THRESH: i64 = 4
60const GDRV_EXIT_OK: i64 = 0
61const GDRV_EXIT_FAIL: i64 = 1
62const GDRV_EXIT_USAGE: i64 = 2
63const GDRV_EXIT_UNMEASURABLE: i64 = 3
64const GDRV_ASCII_0: i64 = 48
65const GDRV_ASCII_9: i64 = 57
66const GDRV_NL: i64 = 10
67const GDRV_DEC: i64 = 10
68const GDRV_NOTFOUND: i64 = -1
69const GDRV_MINUS_CH: i64 = 45
70const GDRV_NS_PER_US: i64 = 1000
71const GDRV_PERMIL_FULL: i64 = 1000
73const GDRV_MIN_CELLS: i64 = 1

functions

76func gdrv_exists(p: *u8) -> i64
83func gdrv_subject() -> *u8
called by 1: gdrv_run calls 1: gdrv_exists
87func gdrv_resolved() -> i64
called by 1: main calls 1: gdrv_exists
93func gdrv_buf() -> *u8 { return sys_mmap(GDRV_OUTCAP) }
called by 1: main calls 1: sys_mmap
94func gdrv_len() -> *i64 { return sys_mmap(16) as *i64 }
called by 1: main calls 1: sys_mmap
97func gdrv_lit_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
100func gdrv_find(buf: *u8, n: i64, from: i64, lit: *u8) -> i64
119func gdrv_count(buf: *u8, n: i64, lit: *u8) -> i64
called by 1: main calls 1: gdrv_find
131func gdrv_eol(buf: *u8, n: i64, from: i64) -> i64
140func gdrv_int_at(buf: *u8, n: i64, at: i64) -> i64
157func gdrv_field(buf: *u8, n: i64, tag: *u8, key: *u8) -> i64
167func gdrv_field_nth(buf: *u8, n: i64, tag: *u8, key: *u8, nth: i64) -> i64
185func gdrv_num_str(v: i64) -> *u8
called by 1: main calls 1: sys_mmap
200func gdrv_run(a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, a6: *u8, a7: *u8, buf: *u8, lenp: *i64) -> i64
216func gdrv_pos(v: i64) -> i64 { if v > 0 { return 1 } return 0 }
called by 1: main
217func gdrv_eq(a: i64, b: i64) -> i64 { if a == b { return 1 } return 0 }
called by 1: main
218func gdrv_eq2(a: i64, b: i64, c: i64, d: i64) -> i64 { if a == b { if c == d { return 1 } } return 0 }
called by 1: main
219func gdrv_eq3(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64) -> i64
called by 1: main
222func gdrv_eq4(a: i64, b: i64, c: i64, d: i64, e: i64, f: i64, g: i64, h: i64) -> i64
called by 1: main
225func gdrv_has(buf: *u8, n: i64, lit: *u8) -> i64
called by 1: main calls 1: gdrv_find
230func main() -> i64