code wiki / _hdl_build / nx_gatekit_runner_gate.nx
nx_gatekit_runner_gate.nx
buildroot/runtime/_hdl_build/nx_gatekit_runner_gate.nx
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
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
structs
| none |
consts
| 22 | const RG_SLEEP_MS: i64 = 3000 |
| 23 | const RG_BOUND_MS: i64 = 500 |
| 24 | const RG_MAX_KILL_MS: i64 = 2500 |
| 25 | const RG_SIGKILL_RC: i64 = 137 |
| 26 | const RG_CAP: i64 = 4096 |
functions
| 28 | func main(argc: i64, argv: *i64) -> i64 |