code wiki / _hdl_build / nx_transient_monitor.nx
nx_transient_monitor.nx
buildroot/runtime/_hdl_build/nx_transient_monitor.nx
about
nx_transient_monitor.nx -- S-CLASS transient / flakiness monitor (hardware-rung-up). The Nishi ecosystem must
ACCOUNT FOR every transient (intermittent failure, watchdog timeout) -- NEVER hand-wave "transient, watch if
it recurs". This runs a target N times under a per-run watchdog, records EVERY outcome (exit code + duration),
and turns "transient" into a MEASURED flakiness rate + verdict (STABLE / FLAKY / BROKEN) with a durable
SOVEREIGN record (seg-store pattern: per-key file + index under knowledge/store, NO tsv/csv/json).
usage: nx_transient_monitor <runs> <timeout_ms> <elf-path>
exit 0 = STABLE, 1 = FLAKY (a transient is real -> root-cause), 2 = BROKEN
license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_transient_monitor_gate.nxnx_transient_sweep.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const TM_MAGIC_1000000000: i64 = 1000000000 |
| 11 | const TM_MAGIC_2048: i64 = 2048 |
| 13 | const TM_STORE_DIR: *u8 = "knowledge/store" |
functions
| 15 | func tm_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func tm_wn(v: i64) -> i64 { var m: i64=v; var k: i64=0; if m<0{tm_w("-" as *u8);m=0-m} let t: *u8=sys_mmap(24); if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: *u8=sys_mmap(24); var w: i64=0; var q: i64=k-1; while q>=0{o[w]=t[q];w=w+1;q=q-1} sys_write(1,o,w); return 0 } |
| 17 | func tm_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} return o } called by 1: tm_record |
| 18 | func tm_n(dst: *u8, off: i64, v: i64) -> i64 { var o: i64=off; var m: i64=v; if m<0{dst[o]=45 as u8;o=o+1;m=0-m} let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{dst[o+i]=t[k-1-i];i=i+1} return o+k } |
| 19 | func tm_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ if s[i]>=(48 as u8){ if s[i]<=(57 as u8){ v=v*10+((s[i] as i64)-48) } } i=i+1 } return v } |
| 22 | func tm_run_once(elf: *u8, timeout_ms: i64, dur_out: *i64) -> i64 |
| 44 | func tm_probe(elf: *u8, runs: i64, timeout_ms: i64, out: *i64) -> i64 |
| 63 | func tm_verdict(pass: i64, runs: i64) -> i64 { if pass==runs {return 0} if pass==0 {return 2} return 1 } |
| 66 | func tm_record(elf: *u8, runs: i64, out: *i64, verdict: i64) -> i64 |
| 87 | func main(argc: i64, argv: *i64) -> i64 |