code wiki / _hdl_build / nx_costcal.nx

nx_costcal.nx

buildroot/runtime/_hdl_build/nx_costcal.nx

12205 B209 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_costcal.nx -- THE COST CALIBRATION CENSUS (2026-09-16): every board's declared rung cost (u) against the wall-clock its own journal recorded from the rung's first row to its last land row, written as the ledger the compare emitter and the ranker read to turn u into hours. nx_costcal [ledger-path] population = regen.list (published order, both trees); default ledger knowledge/status/costcal.ledger, truncate-written; verdict LAST exit 0 CALIBRATED | 1 UNCALIBRATED (fewer calibrated rungs than the distinct-rank floor) | 3 NO-POPULATION WHY. The plan's unit row says "estimates recalibrate as rungs land and PR7 actuals write back" and PR7 stayed _ABSENT_ since 2026-08-20, so every u on every board has been a declaration with no ratio to hours behind it. The record already holds the actuals: more than a thousand land rows across the boards (a grep of buildroot/knowledge/compare hit its 1 MiB capture on them, 2026-09-16). This organ reads them all, excludes by name what cannot be calibrated (a land row that is the rung's first row; a rung with no declared cost), and publishes the quantiles with their n. ONE grammar for the ledger line lives in nx_costest_lib, shared with every reader, so the writer and the readers cannot drift. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_barfresh_lib.nx nx_costest_lib.nx nx_costcal.nx

imports: nx_syscalls.nxnx_barfresh_lib.nxnx_costest_lib.nx

imported by: nobody (leaf or entry point)

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

main 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 ↻ ct_build_path ct_cat ct_first_published sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ct_second_published cc_w sys_write ↻ ces_slen cc_walk sys_mmap ↻ ces_line_end bf_read_plan sys_mmap ↻ ct_build_path ↻ sys_read_file ↻ ct_first_published ↻ ct_second_published ↻ ces_census_plan

structs

none

consts

20const CC_ARG_LEDGER: i64 = 1
21const CC_STDOUT: i64 = 1
22const CC_MODE_644: i64 = 420
23const CC_REGEN_DOM: *u8 = "regen"
24const CC_REGEN_SUFFIX: *u8 = ".list"
25const CC_LEDGER_DEFAULT: *u8 = "knowledge/status/costcal.ledger"
26const CC_EXIT_OK: i64 = 0
27const CC_EXIT_UNCAL: i64 = 1
28const CC_EXIT_NOPOP: i64 = 3
29const CC_NUM_CAP: i64 = 32
30const CC_HEADER_RESERVE: i64 = 2048
31const CC_WIP_STATUS: *u8 = "knowledge/status/wip.status" // EC57: ONE canonical WIP line, truncate-written, passed through verbatim by the boot digest
32const CC_WIP_SUFFIX: *u8 = ".wip" // a run against a non-default ledger writes its WIP line beside THAT ledger, never the production status
33const CC_SEC_PER_DAY: i64 = 86400
34const CC_CH_COMMA: i64 = 44

functions

36func cc_w(s: *u8) -> i64 { return sys_write(CC_STDOUT, s, ces_slen(s)) }
called by 2: cc_walkmain calls 2: sys_writeces_slen
37func cc_wn(v: i64) -> i64 { let b: *u8 = sys_mmap(CC_NUM_CAP); let o: i64 = ces_fmt_int(b, 0, v); return sys_write(CC_STDOUT, b, o) }
40func cc_beside(path: *u8, suffix: *u8) -> *u8
called by 1: main calls 3: sys_mmapces_slences_cat
48func cc_walk(lst: *u8, ln: i64, mode: i64, samples: *i64, scap: i64, sc: *i64, st: *i64, rows: *u8, rcap: i64, ro: *i64, bytes_out: *i64) -> i64
89func main(argc: i64, argv: *i64) -> i64