code wiki / _hdl_build / nx_flap_probe.nx

nx_flap_probe.nx

buildroot/runtime/_hdl_build/nx_flap_probe.nx

4405 B117 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind probe
docsdependenciesstructsconstsfunctions

about

nx_flap_probe.nx -- TEAM-OWNED repeat-run stability probe (Engineer's verify verb). Runs a target ELF N times via fork/execve/wait4 and judges from the RAW wait status -- never a shell $? (the fake-green channel, see feedback-wsl-exit-code-judging-2026-06-09: $? echoes pre-expand through PS AND Git-Bash into wsl, so every inline RC=$? is the OUTER shell's last status, not the target's). Born 2026-06-10: a P3 KAT "passed" via $?-echo and "failed" in the game gate -- the gate (wait4) was right, the $? channel lied, and the hunt for "same-binary nondeterminism" was chasing a phantom. This organ makes the honest repeat-run judgment a one-call team capability, in pure NishiLang from the syscall layer up (no sh, no py). Usage: nx_flap_probe.elf <target.elf> [n_runs] (default n_runs = 20) Output: one FLAPPROBE line with a status histogram, e.g. FLAPPROBE target=/tmp/ft.elf runs=20 distinct=1 status=4 x20 verdict=STABLE FLAPPROBE ... distinct=2 status=0 x17 status=4 x3 verdict=FLAP Exit: 0 = STABLE (all runs same status; the status itself is REPORTED, not judged -- a stable failure is the caller's evidence, not ours); 2 = FLAP (nondeterminism proven); 3 = usage/exec error. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_flap_probe.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 fp_puts sys_write sys_mmap fp_run_once sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 fp_putn sys_mmap ↻ sys_write ↻

structs

none

consts

27const FP_DEFAULT_RUNS: i64 = 20
28const FP_MAX_DISTINCT: i64 = 64

functions

30func fp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
31func fp_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=48+(m%10); m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(1, bb, k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
35func fp_run_once(path: *u8, envp: *i64) -> i64
51func main(argc: i64, argv: *i64) -> i64