code wiki / _hdl_build / nx_self_model_regen.nx

nx_self_model_regen.nx

buildroot/runtime/_hdl_build/nx_self_model_regen.nx

1537 B25 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic self
docsdependenciesstructsconstsfunctions

about

nx_self_model_regen.nx -- the LIBRARIAN regenerates the self-model count FROM the registry (data), instead of Claude hand-editing a 229-cap inline main() that overruns the compiler's register allocator and segfaults (operator: "keep building the team and dont do the work yourself"). The registry is DATA (one CAPREG line per cap, written by nx_cap_register); this reader LOOPS over it -- a SMALL main, no reg pressure, scales to thousands. This is the fix for the fat-main crash AND removes Claude from self-model upkeep: the team registers caps -> the registry grows -> the Librarian regenerates the count. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_self_model_regen.nx nx_self_model_regen_test.nx

imports: nx_syscalls.nx

imported by: nx_self_model_regen_test.nx

structs

none

consts

none

functions

11func smr_count(buf: *u8, n: i64, mark: *u8) -> i64
23func smr_proven(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "status=2 " as *u8) }
called by 1: main calls 1: smr_count
24func smr_building(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "status=1 " as *u8) }
called by 1: main calls 1: smr_count
25func smr_total(buf: *u8, n: i64) -> i64 { return smr_count(buf, n, "CAPREG idx=" as *u8) }
called by 1: main calls 1: smr_count