code wiki / _hdl_build / nx_resmon_gate.nx

nx_resmon_gate.nx

buildroot/runtime/_hdl_build/nx_resmon_gate.nx

16495 B229 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_resmon_gate.nx -- referee for nx_resmon's two policy predicates (debt seq1005). It gates the SAME functions the organ runs (nx_resmon_lib.nx), not a reimplementation, and it needs no /proc and no fixtures on disk -- every input is synthetic, so the result is deterministic. T2 AND T4 ARE THE TEETH THAT MATTER: T2 is the NON-VACUITY control: with thresholds set unreachably high, measurements that trip RED under real thresholds must return GREEN. If T2 ever fails, T1 is passing for free. T4 pins the EXACT false positive this instrument made on its first live run: a process with a huge RESERVED VmData but almost nothing committed reported a worst case of 40.6 GiB on a 36.9 GB box. A leaker is judged on rss+swap, never on reserved address space. That regression cannot return silently now. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_gate.nx nx_gate_verdict.nx nx_resmon_lib.nx nx_resmon_gate.nx

imports: nx_gate.nxnx_gate_verdict.nxnx_resmon_lib.nx

imported by: nobody (leaf or entry point)

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

main rm_verdict rm_is_leaker rm_field rm_slen rm_blind_class rm_verdict_blind rm_verdict ↻ rm_blind_sev rm_slen ↻ rm_trend_read_tail lt_read_tail sys_openat_rd sys_lseek sys_close sys_read lt_shift_down gv_ctr 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 ↻ gv_head gv_puts sys_write ↻ gv_check gv_puts ↻ gv_verdict gv_note_bare_rate

structs

none

consts

25const RG_STALE_AGE_OBSERVED_S: i64 = 27259
32const RG_MAX_AGE_S: i64 = 900 // the declared memvel freshness bound
33const RG_BLIND_ALARM_AGE_S: i64 = RG_MAX_AGE_S * RM_BLIND_ALARM_WINDOWS // DERIVED: exactly at the alarm
34const RG_BLIND_UNDER_ALARM_S: i64 = RG_BLIND_ALARM_AGE_S - 1 // DERIVED: one second short of it

functions

40func main() -> i64