code wiki / _hdl_build / nx_gatekit_runner_gate.nx

nx_gatekit_runner_gate.nx

buildroot/runtime/_hdl_build/nx_gatekit_runner_gate.nx

6877 B120 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_gatekit_runner_gate.nx -- THE BOUNDED RUNNER MUST REPORT A KILLED OR CRASHED SUBJECT AS A FAILURE. MEASURED 2026-08-18 (lane B, first trial of nx_gate_roster_run over the deployed-dark gates): 1787075461 trial nx_activities_gate GREEN exit=0 ms=60443 1787075522 trial nx_doctor_apply_gate GREEN exit=0 ms=60018 Both were KILLED by gk_run_cap3's 60 s watchdog and journaled as GREEN, because the runner returned wait_exit_code(status) = (status>>8)&0xFF, which is 0 for a child that died by signal. gk_run had the same hole, so a SEGFAULTING subject read as a pass through every gate built on the kit. ★★★★★★ A WATCHDOG-KILLED SUBJECT THAT RETURNS THE EXIT CODE OF A CLEAN ONE TURNS EVERY TIMEOUT INTO A PASS -- BOUNDING THE WAIT WITHOUT REPORTING THE KILL IS HALF A FIX, AND THE MISSING HALF READS GREEN. The fix is one helper in the base lib (gk_wait_code: 128+signal when the child died by signal) used by both gk_run and gk_run_cap3. This gate is its bite proof, and it uses ITSELF as the subject (`--as-subject <mode>` re-execs /proc/self/exe) so it needs no fixture on disk. TEETH: exit0 -> 0 . exit5 -> 5 . self-SIGKILL -> 137 . a 3 s sleeper under a 500 ms bound -> 137 within 2.5 s . captured output of a clean subject still arrives . BITE: kill fires (rc != 0) on the sleeper and is silent (rc == 0) on the clean subject. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_gatekit_lib.nx nx_gate_verdict.nx nx_gatekit_runner_gate.nx

imports: nx_gatekit_lib.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

main gk_streq gk_say gk_write_all sys_write gk_len 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 ↻ gk_run sys_mmap ↻ sys_fork sys_openat_wr sys_dup3 sys_execve sys_exit ↻ sys_wait4 gk_wait_code wait_status_rc wait_term_signal wait_exit_code gv_check gv_puts ↻ gk_run_capture_ms

structs

none

consts

22const RG_SLEEP_MS: i64 = 3000
23const RG_BOUND_MS: i64 = 500
24const RG_MAX_KILL_MS: i64 = 2500
25const RG_SIGKILL_RC: i64 = 137
26const RG_CAP: i64 = 4096

functions

28func main(argc: i64, argv: *i64) -> i64