code wiki / _hdl_build / nx_gate_gn_gate.nx
nx_gate_gn_gate.nx
buildroot/runtime/_hdl_build/nx_gate_gn_gate.nx
about
nx_gate_gn_gate.nx -- the gate for the integer printer 437 GATES IMPORT.
WHY THIS EXISTS: nx_gensota's worklist ranked the unattached organs of generation 3 by
importers, and rank 1 was nx_gate_gn itself -- the number-printer at the bottom of the
verification fleet had no verification of its own. A printer that silently mis-renders a
count would corrupt EVERY gate verdict that quotes a number, and nothing would catch it.
HOW IT IS TESTED HONESTLY: gn() writes straight to fd 1, so asserting on a return value
would prove nothing. This gate REDIRECTS fd 1 to a file (dup3), calls gn, restores fd 1,
and READS THE BYTES BACK -- a writer is only tested by a read-back.
TEETH: zero (the special case that returns early) - single digit - multi digit - the
decade boundary - negative sign placement - a large value - and a NEGATIVE CONTROL that
must FAIL if the comparator is vacuous.
license_tier: ORIGINAL expect_exit: 0 No hw writes (Rule 26).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_gate_gn.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
| 17 | const GG_SAVEFD: i64 = 19 |
| 18 | const GG_TMPMODE: i64 = 0x1a4 |
| 19 | const GG_BUFCAP: i64 = 256 |
functions
| 21 | func gg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 24 | func gg_capture(v: i64, path: *u8, out: *u8) -> i64 |
| 45 | func gg_eq(a: *u8, b: *u8) -> i64 |
| 55 | func gg_check_val(v: i64, want: *u8, ctr: *i64, name: *u8, path: *u8, buf: *u8) -> i64 |
| 69 | func main() -> i64 |