code wiki / _hdl_build / nx_budget_run.nx
nx_budget_run.nx
buildroot/runtime/_hdl_build/nx_budget_run.nx
about
nx_budget_run.nx -- TIME-BUDGETED step runner: turns silent slowness
into a FILED defect automatically.
Operator 2026-06-10: "slowness anywhere in our entire ecosystem is a
total failure." The 885KB sovereign assembly that silently ate 90
minutes would have been auto-filed by this organ at its budget line.
Usage: nx_budget_run <budget_seconds> <path> [args...]
- runs <path>, polling wait4(WNOHANG) on a 100ms beat
- inside budget -> "BUDGET-OK <path> elapsed=<s>s limit=<s>s",
exit = child's exit code
- budget blown -> kill -9, "BUDGET-EXCEEDED <path> limit=<s>s"
appended to the sentinel log (the PM/loop
dispatcher's queue), exit 99
The wrapper is the PREVENTION pillar: every build/step the team runs
through it converts "mysteriously slow" into a logged, gated verdict.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_kill_portable.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
| 21 | const BR_MAGIC_1000000: i64 = 1000000 |
| 23 | const BR_EXIT_USAGE: i64 = 2 |
| 24 | const BR_EXIT_BUDGET: i64 = 99 |
| 25 | const BR_LOG_PATH: *u8 = "/tmp/nishi_perf_sentinel.log" as *u8 |
| 26 | const BR_BEAT_MS: i64 = 100 |
functions
| 28 | func br_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 29 | func br_app(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 34 | func br_app_n(dst: *u8, off: i64, v: i64) -> i64 called by 1: main |
| 47 | func br_atoi(s: *u8) -> i64 called by 1: main |
| 60 | func main(argc: i64, argv: *i64) -> i64 |