code wiki / _hdl_build / nx_resource_prove.nx

nx_resource_prove.nx

buildroot/runtime/_hdl_build/nx_resource_prove.nx

5968 B92 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind tooltopic resource
docsdependenciesstructsconstsfunctions

about

nx_resource_prove.nx -- PROVE-NOT-ASSERT that the polite resource governor is REAL: read THIS host live (nx_sysload over /proc) and show the governor's actual decision (nx_resource_governor), then demonstrate the "sensor -> supercomputer, any hardware" scaling by computing the polite budget for hypothetical core counts at the SAME live load. Read-only (no side effects, no work fired). Composes the shipped organs (Cardinal 15). Operator: "resource polite -- run in low-resource periods, step back when high; intelligent SOTA management on any hardware dynamically, in conjunction with other parallel systems." This proves that capability EXISTS and WORKS on the real machine, rather than asserting it. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_sysload.nx nx_resource_governor.nx nx_resource_prove.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_sysload.nxnx_resource_governor.nx

imported by: nobody (leaf or entry point)

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

main rp_puts sys_write sl_loadavg_milli sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sl_ncpu sys_mmap ↻ sys_read_file ↻ sl_count_substr sl_freemem_mb sys_mmap ↻ sys_read_file ↻ sl_active_conns_8443 sys_mmap ↻ sys_read_file ↻ sl_count_substr ↻ rp_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap rg_serve_first rp_decide rg_hw_class_reserve rg_hw_budget rg_worker_budget rg_hw_class_reserve ↻ rg_should_backoff rg_memory_ok rp_puts ↻ rp_putn ↻ rg_nice

structs

none

consts

none

functions

14func rp_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 2: rp_decidemain calls 1: sys_write
19func rp_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 2: rp_decidemain calls 1: nxi_out
22func rp_decide(label: *u8, ncpu: i64, load_milli: i64, free_mb: i64) -> i64
37func main() -> i64