code wiki / _hdl_build / nx_gate_triage.nx

nx_gate_triage.nx

buildroot/runtime/_hdl_build/nx_gate_triage.nx

9314 B213 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic gate
docsdependenciesstructsconstsfunctions

about

nx_gate_triage.nx -- TEAM-OWNED failure LOCALIZER for the game gate (operator: "keep building the team to handle this autonomously"). Mechanizes the oracle-differential diagnosis ladder Claude ran by hand on 2026-06-09 (the tictactoe draw-detect hunt): for every gated module, build the SAME compiler-emitted .s twice -- once with the sovereign assembler, once with gcc (ORACLE USE ONLY, per the C-is-for-benchmarking law; gcc never lands on a deploy path here) -- run both, and classify: PASS : sovereign build exits 0 ASM-GAP : nxasm refuses the .s (encoding gap) or crashes TOOLCHAIN-NXASM : sovereign build fails BUT gcc build of the SAME .s passes -> the assembler mis-encoded something COMPILER-OR-SOURCE : BOTH builds fail the same way -> the .s itself is wrong (compiler bug) or the module's source is COMPILE-FAIL : no usable .s after retries One TRIAGE line per module -> stdout + /tmp/nishi_game_gate_triage.log. The sentinel forks this automatically on REGRESSION, so a red beat arrives pre-localized: the Engineer reads WHERE the bug lives, not just that one exists. Usage: nx_gate_triage.elf [compiler] (default _offc, repo root). license_tier: ORIGINAL Reuses the gg_ spine from nx_game_gate.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_gate_triage.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_openat_wr sys_openat_append sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real gt_module gt_triage_one sys_mmap ↻ gt_cat sys_openat_rd sys_close sys_openat_wr ↻ gt_run sys_fork sys_dup3 sys_execve sys_exit sys_mmap ↻ sys_wait4 gt_filesize sys_openat_rd ↻ sys_mmap ↻ sys_read sys_close ↻ gt_report sys_mmap ↻ gt_cat ↻ gt_cat_n sys_mmap ↻ sys_write sys_close ↻

structs

none

consts

24const GT_MAGIC_4096: i64 = 4096
26const GT_MIN_ASM_BYTES: i64 = 128
27const GT_MAX_RETRIES: i64 = 12
92const GT_PASS: i64 = 0
93const GT_ASM_GAP: i64 = 1
94const GT_TOOLCHAIN_NXASM: i64 = 2
95const GT_COMPILER_OR_SOURCE: i64 = 3
96const GT_COMPILE_FAIL: i64 = 4

functions

29func gt_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
30func gt_cat_n(dst: *u8, off: i64, v: i64) -> i64
called by 1: gt_report calls 1: sys_mmap
43func gt_run(path: *u8, argv: *i64, envp: *i64, redir_out: i64, redir_err: i64) -> i64
58func gt_filesize(path: *u8) -> i64
70func gt_module(i: i64) -> *u8
called by 1: main
98func gt_triage_one(name: *u8, compiler: *u8, envp: *i64, devnull: i64, sov_exit: *i64, ora_exit: *i64) -> i64
163func gt_report(logfd: i64, name: *u8, cls: i64, sov: i64, ora: i64, ts: i64) -> i64
188func main(argc: i64, argv: *i64) -> i64