nx_sync_promote_gate.nx
buildroot/runtime/nx_sync_promote_gate.nx
about
nx_sync_promote_gate.nx -- proves the PROMOTABLE sync lane (2026-08-22).
The defect it guards: the synchronous MCP lane, at its deadline, forked a WATCHDOG that SIGKILLed the
worker -- DESTROYING THE ANSWER of every call that outran the 15s edge window while the work itself ran
on and its side effects landed. The fix (tr_run_capture_deadline) instead PROMOTES the still-running
worker: it returns TR_PROMOTE plus the live pid and read end, and the caller adopts it onto the job lane.
This gate drives that function IN-PROCESS against a real fixture ELF (nx_slowtick), so it needs no
daemon and no socket -- and it proves the window-pair SSOT (edge_window.conf vs the compiled fallback).
SUBJECT for the bite: buildroot/runtime/nx_tool_run.nx (tr_run_capture_deadline) + the fixture
_offc/nx_slowtick.elf. The 4th nx_gate_bite arg is MANDATORY (this fork/execs a deployed fixture).
BITE-PROVEN 2026-08-22: the targeted incumbent-revert mutation (the promotion arm
`if pr == 0 { promoted = 1 }` -> `nx_kill(pid, TR_SIGKILL)`) flipped T1/T2/T3 RED (6/9) while T4-T9
stayed GREEN, and the pristine restore rebuilt byte-identical (b53a887a). The auto-bite was
INCONCLUSIVE (generic mutations do not reach the promote/kill decision); the targeted mutation is the
real non-vacuity proof and it is recorded here so the next reader need not re-derive it.
license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_tool_exec_allow.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
| 19 | const SPG_FIX: *u8 = "_offc/nx_slowtick.elf" as *u8 |
| 20 | const SPG_CAP: i64 = 65536 |
| 21 | const SPG_DEADLINE_MS: i64 = 150 // < the fixture's 600ms sleep, so it is genuinely mid-run at the deadline |
| 22 | const SPG_LONG_MS: i64 = 5000 // > any fixture runtime, so the fast path finishes inline |
| 23 | const SPG_DRAIN_MS: i64 = 4000 // upper bound on how long we wait for the promoted tail |
| 24 | const SPG_POLLFD_BYTES: i64 = 8 |
| 25 | const SPG_POLLIN: i64 = 1 |
| 26 | const SPG_PF_EV_OFF: i64 = 4 |
| 27 | const SPG_PF_FD_BYTES: i64 = 4 |
| 28 | const SPG_BITS: i64 = 8 |
| 29 | const SPG_MASK: i64 = 0xff |
| 31 | const SPG_FIXCONF_DIR: *u8 = "/tmp/nx_sync_promote_gate" as *u8 |
| 32 | const SPG_FIXCONF_OK: *u8 = "/tmp/nx_sync_promote_gate/edge_window.conf" as *u8 |
| 33 | const SPG_FIXCONF_BAD: *u8 = "/tmp/nx_sync_promote_gate/edge_window_bad.conf" as *u8 |
| 34 | const SPG_FIXCONF_NONE: *u8 = "/tmp/nx_sync_promote_gate/edge_window_absent.conf" as *u8 |
| 35 | const SPG_MODE_DIR: i64 = 493 // 0755 |
| 36 | const SPG_MODE_644: i64 = 420 |
| 37 | const SPG_OTRUNC: i64 = 0x241 // O_WRONLY|O_CREAT|O_TRUNC |
| 38 | const SPG_AT_FDCWD: i64 = 0 - 100 |
| 39 | const SPG_SYS_OPENAT: i64 = 257 |
functions
| 42 | func spg_has(buf: *u8, n: i64, needle: *u8) -> i64 called by 1: main |
| 57 | func spg_write(path: *u8, content: *u8) -> i64 called by 1: main |
| 66 | func spg_drain(rfd: i64, out: *u8, cap: i64, deadline_ms: i64) -> i64 called by 1: main |
| 91 | func main() -> i64 |