code wiki / _hdl_build / nx_flap_probe.nx
nx_flap_probe.nx
buildroot/runtime/_hdl_build/nx_flap_probe.nx
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
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
structs
| none |
consts
| 27 | const FP_DEFAULT_RUNS: i64 = 20 |
| 28 | const FP_MAX_DISTINCT: i64 = 64 |
functions
| 30 | func 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 } |
| 31 | func 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 } |
| 35 | func fp_run_once(path: *u8, envp: *i64) -> i64 |
| 51 | func main(argc: i64, argv: *i64) -> i64 |