code wiki / (root) / nx_ioconfirm_checked_test_20260907.nx

nx_ioconfirm_checked_test_20260907.nx

buildroot/runtime/nx_ioconfirm_checked_test_20260907.nx

15086 B316 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_ioconfirm.nx -- THE CONFIRMED I/O-STORM LEVEL: maintained continuously, read in constant time. Rung DG7, /compare/degradation. WHY THIS EXISTS, MEASURED. The D-state witness that gates every build on this estate reads /proc/stat ONCE. nx_blkprofile sampled 2,400 times at 100 ms on 2026-09-04 and found procs_blocked with median 4 against a bar of 8, p90 8, max 15, and 118 permil of SINGLE samples at or above the bar. So roughly one build in eight is refused by a transient spike on a box whose sustained level is HALF the bar. Two nx_dstate rosters 90 s apart shared only four pids: the D population is mostly churn over a small persistent core. AND THE OBVIOUS FIX IS THE WRONG ONE, WHICH IS THE POINT OF THIS ORGAN. Making the gate take a median AT DECISION TIME is already built and wired (ioa_measure_median, armed by two keys in build_admit.conf) and the same run shows why it must not be armed: the refusal curve is STILL FALLING at a 12,000 ms span (118 -> 36 permil) and has not flattened, so any span wide enough to help costs SECONDS on EVERY admission check -- the clock dispatcher's pre-dispatch call included. That does not remove the stall, it relocates it onto every caller. build_admit.conf refuses arming for exactly this reason and asks for the cost to be measured first. It now has been, and the answer is no. THIS IS THE AEROSPACE ANSWER INSTEAD. Flight control does not confirm a fault inside the control law; a monitor confirms CONTINUOUSLY and the law reads an already-confirmed state. So: a beat pays the whole confirmation window once per cadence, off the critical path, and every consumer reads one small file in constant time. The window costs the beat its span and costs the consumer nothing. FRESHNESS IS PART OF THE ANSWER, NOT A FOOTNOTE. A stale level is WORSE than none: it decides with authority about a box it last saw minutes ago. `read` returns FRESH, STALE and ABSENT as three distinct exits so a consumer that cannot get FRESH falls back to its own single sample -- degrade to the incumbent, never acquit on a reading nobody took. KEY NAMES ARE DELIBERATELY NOT build_admit.conf's. That conf is parsed by PLAIN SUBSTRING with no comment handling, and its own header records a measured incident where prose describing a key ARMED it. This file uses confirm_samples and confirm_gap_ms so its bytes can never be mistaken for that envelope. COMPOSES, DOES NOT RE-IMPLEMENT: ioa_measure_median is the same sampler nx_build_admit would use if it were armed, so the level published here is the level that gate would have computed -- one ruler, not two.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_ioadmit_lib.nx nx_atomic_rewrite.nx nx_ioconfirm_checked_test_2026

imports: nx_syscalls.nxnx_ioadmit_lib.nxnx_atomic_rewrite.nx

imported by: nobody (leaf or entry point)

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

main ic_werr sys_write ic_slen sys_exit 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 ↻ ic_atoi ic_slen ↻ ic_slen ↻ ic_puts sys_openat_rdwr sys_flock sys_close ioa_measure_median sys_mmap ↻ ioa_measure sys_mmap ↻ rm_read sys_openat_rd sys_read sys_close ↻ ioa_ncpu rm_field rm_slen sys_munmap ioa_sleep_ms

structs

none

consts

40const IC_STDOUT: i64 = 1
41const IC_STDERR: i64 = 2
42const IC_OUTCAP: i64 = 8192
43const IC_MEAS_BYTES: i64 = 64
44const IC_BOX_BYTES: i64 = 64
45const IC_MODE_644: i64 = 420
46const IC_UNREADABLE: i64 = 0 - 1
47const IC_EXIT_STALE: i64 = 1
48const IC_EXIT_USAGE: i64 = 2
49const IC_EXIT_ABSENT: i64 = 3
50const IC_EXIT_UNMEASURED: i64 = 4
51const IC_EXIT_BUSY: i64 = 5
52const IC_LOCK_SUFFIX_BYTES: i64 = 5
53const IC_NUL_BYTES: i64 = 1
58const IC_DEF_SAMPLES: i64 = 5
59const IC_DEF_GAP_MS: i64 = 3000
62const IC_DEF_MAX_AGE_S: i64 = 900
63const IC_STATUS: *u8 = "knowledge/status/ioconfirm.status"
64const IC_STATUS_UP: *u8 = "../knowledge/status/ioconfirm.status"
65const IC_CH_MINUS: i64 = 45
66const IC_CH_0: i64 = 48
67const IC_CH_9: i64 = 57
68const IC_CH_BEAT: i64 = 98
69const IC_CH_READ: i64 = 114
70const IC_KEY_TS: *u8 = "ts="
71const IC_KEY_CONF: *u8 = "blocked_confirmed="

functions

73func ic_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
74func ic_werr(s: *u8) -> i64 { sys_write(IC_STDERR, s, ic_slen(s)); return 0 }
called by 1: main calls 2: sys_writeic_slen
76func ic_puts(b: *u8, off: i64, s: *u8) -> i64
called by 1: main
83func ic_puti(b: *u8, off: i64, v: i64) -> i64
called by 1: main
100func ic_atoi(s: *u8) -> i64
called by 1: main calls 1: ic_slen
117func ic_now() -> i64
129func ic_field(buf: *u8, n: i64, key: *u8) -> i64
called by 1: main calls 1: ic_slen
167func main(argc: i64, argv: *i64) -> i64