code wiki / _hdl_build / nx_adopt.nx

nx_adopt.nx

buildroot/runtime/_hdl_build/nx_adopt.nx

22529 B408 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind tooltopic adopt
docsdependenciesstructsconstsfunctions

about

nx_adopt.nx -- THE ADOPTION CENSUS. Which capability primitives has nobody adopted? (operator priority) LAW: THE BOTTLENECK IS NOT BUILDING PRIMITIVES, IT IS ADOPTING THEM. Three proofs on 2026-07-30: cpu-feature-detect existed with a KAT, registered nowhere (seq1359) - ss_close: 133 openers, 1 closer (seq1347) - nx_hw_cpu_count: CORRECT (sched_getaffinity, cgroup-safe) with ZERO external callers in 19,823 files while nx_torrent_get hardcodes MAXP=32 (seq1410). A build-only 'done' is the cause. ==> A ZERO-CALLER CAPABILITY PRIMITIVE IS A RED DEFECT, NOT A COMPLETED FEATURE. SCALE: the naive census greps the corpus once per primitive = O(primitives x corpus). This walks the corpus TWICE total -- pass A hashes every definition, pass B counts every identifier against it with O(1) lookups -- so cost is O(corpus) regardless of how many primitives exist. SELF-REFERENCES DO NOT COUNT AS ADOPTION. nx_hw_cpu_count showed FIVE grep matches and looked alive; four were its own file. Definition-file hits are tallied SEPARATELY from external ones -- that is the entire difference between 'used' and 'looks used'. argv: <defs-dir> [callers-dir] exit 0 = ran, 2 = usage/unreadable. license_tier: ORIGINAL Read-only. No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_adopt_lib.nx nx_proc_ctl.nx nx_resmon_lib.nx nx_adopt.nx

imports: nx_adopt_lib.nxnx_proc_ctl.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_puts sys_write rm_slen ad_ends_nx ad_fnv ad_isid ad_slot ad_next ad_is_prooffile ad_has_sub ad_id_start ad_isid ↻ ad_name_eq ad_is_adopted ad_is_debt ad_is_adopted ↻ ad_is_public rm_num nxi_out nxi_fd 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 nxa_dump_sizes ccz_cat_num nxi_buf sys_write ↻ sys_munmap

structs

none

consts

22const AD_CAP: i64 = 65536
23const AD_TBL_BYTES: i64 = 524288
24const AD_NAMEBUF: i64 = 2097152
25const AD_FILECAP: i64 = 2097152
26const AD_DIRBUF: i64 = 262144
27const AD_MAXREPORT: i64 = 30
28const AD_PATHBUF: i64 = 1024
29const AD_PAREN: i64 = 40
30const AD_SLASH: i64 = 47
31const AD_NL: i64 = 10
32const AD_SP: i64 = 32
33const AD_F: i64 = 102
34const AD_U: i64 = 117
35const AD_N: i64 = 110
36const AD_C: i64 = 99
39const AD_SAVEFD: i64 = 9
41const AD_STAMPFD: i64 = 10
46const AD_STAMP: *u8 = "knowledge/status/adopt_census.stamp" as *u8

functions

56func ad_has_sub(nm: *u8, sub: *u8) -> i64
called by 1: ad_is_prooffile
74func ad_is_prooffile(nm: *u8) -> i64
called by 1: main calls 1: ad_has_sub
82func main(argc: i64, argv: *i64) -> i64