nx_capcensus.nx
buildroot/runtime/nx_capcensus.nx
about
nx_capcensus.nx -- THE PICKED-CAP CENSUS: is a capacity bound DERIVED, or PICKED by an author?
WHY THIS EXISTS, AND WHY IT IS NOT A DUPLICATE (measured 2026-08-23).
The same defect class was found FOUR times in ONE session:
nx_skeleton.nx SK_MAXB=32 bones / SK_MAXV=2048 verts against a corpus of 104-370 joints and
14,164-423,919 verts -- an 11.6x bone / 207x vertex overflow that made EVERY
real character un-riggable, so the served worlds drew bind pose.
nx_nxa_skin cluster cap 512 -> 8192, and the CAP IMPERSONATED A COUNT TWICE (clusters=510,
then =2046): a saturated buffer read back as if it were a measurement.
MG_CAP a SILENT input cap in the mesh path -- an oversized asset reads truncated with
no announcement.
nx_cron_reconcile one sys_read of 16,383 B against a 24,356 B registry: 11 production jobs
silently inert, and it printed declared=55 as if that were the population.
***NAMING A MAGIC NUMBER DOES NOT MAKE IT DERIVED.*** nx_magic is the rule-11 fixer: it hoists an
INLINE literal into a NAMED const, and it SKIPS const/static declaration lines BY CONSTRUCTION
(its own header says so). So `const SK_MAXB: i64 = 32` is structurally invisible to it and every
magic-number detector calls the file clean. Worse, its remedy MANUFACTURES this artifact: the
auto-generated K_MAGIC_<value> / <PFX>_MAGIC_<value> names found in the wild (K_MAGIC_262144,
K_MAGIC_65536, DC_MAGIC_131072) are picked caps wearing a constant's clothes -- THE NAME ENCODES
THE VALUE, so it carries no purpose at all. That is not a defect in nx_magic (its neutrality is
provable and its purpose is different); it is exactly why a SECOND, ORTHOGONAL instrument is
needed. nx_magic asks "is this literal inline?". This organ asks "is this bound DERIVED or PICKED?".
nx_capcliff is NOT the incumbent either: it forecasts RUNTIME growth of rostered append-only
ledgers against a known reader cap. This is a STATIC census of bounds declared in source.
nx_capcensus scan <dir> -> recursive classified census over every .nx under <dir>
nx_capcensus selftest
CLASSES (the partition MUST sum to the population, and the sum is printed):
DERIVED value computed from an input size / another identifier / an expression. Healthy.
PICKED a literal ceiling on data whose real size is knowable at runtime. THE WORKLIST.
STRUCTURAL fixed by an external contract (syscall number, mode bits, seek whence, exit code).
PROTECTIVE a bound NAMED for bounding unknowable input. See the declared limit below.
UNKNOWN could not classify. Reported, NEVER folded into a known bucket.
DECLARED LIMIT, so nobody reads this census as more than it is: PROTECTIVE IS UNDER-DETECTED BY
CONSTRUCTION. Proving that a bound's truncation ANNOUNCES requires call-site analysis this organ
does not perform; it recognises only bounds NAMED for that purpose (WINDOW/WIN/BUDGET/DEADLINE/
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 58 | const CE_DIRWIN: i64 = 262144 |
| 59 | const CE_PATHW: i64 = 4096 |
| 61 | const CE_QSEED: i64 = 64 |
| 63 | const CE_SKIP: i64 = 0 |
| 64 | const CE_DERIVED: i64 = 1 |
| 65 | const CE_PICKED: i64 = 2 |
| 66 | const CE_STRUCTURAL: i64 = 3 |
| 67 | const CE_PROTECTIVE: i64 = 4 |
| 68 | const CE_UNKNOWN: i64 = 5 |
| 70 | const CE_DT_DIR: i64 = 4 |
| 71 | const CE_EXIT_USAGE: i64 = 2 |
| 72 | const CE_EXIT_SELFTEST: i64 = 3 |
| 73 | const CE_EXIT_PICKED: i64 = 1 |
| 76 | const CE_EXIT_UNREADABLE: i64 = 3 |
| 77 | const CE_WORKLIST_SHOWN: i64 = 60 |
| 78 | const CE_POW2_FLOOR: i64 = 4096 |
| 80 | const CE_C_SEEN: i64 = 0 |
| 81 | const CE_C_POP: i64 = 1 |
| 82 | const CE_C_DER: i64 = 2 |
| 83 | const CE_C_PICK: i64 = 3 |
| 84 | const CE_C_STR: i64 = 4 |
| 85 | const CE_C_PRO: i64 = 5 |
| 86 | const CE_C_UNK: i64 = 6 |
| 87 | const CE_C_AH: i64 = 7 |
| 88 | const CE_C_P2: i64 = 8 |
| 89 | const CE_C_SHOWN: i64 = 9 |
| 90 | const CE_C_MMAPLIT: i64 = 10 |
| 96 | const CE_C_UNNAMED: i64 = 11 |
| 107 | const CE_C_SHOWMAX: i64 = 12 |
| 108 | const CE_C_RESOLVED: i64 = 13 |
| 109 | const CE_C_EXCEEDED: i64 = 14 |
| 110 | const CE_C_NEAR: i64 = 15 |
| 111 | const CE_C_OKB: i64 = 16 |
| 112 | const CE_C_MISSING: i64 = 17 |
| 124 | const CE_C_TAILANCH: i64 = 18 |
| 125 | const CE_C_FIXTURE: i64 = 19 |
| 126 | const CE_NCTR: i64 = 24 |
functions
| 128 | func ce_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 129 | func ce_wspan(b: *u8, s: i64, e: i64) -> i64 { if e > s { sys_write(1, ((b as i64) + s) as *u8, e - s) } return 0 } |
| 130 | func ce_wn(v: i64) -> i64 |
| 145 | func ce_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 146 | func ce_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 160 | func ce_has(b: *u8, s: i64, e: i64, ned: *u8) -> i64 called by 6: ce_capshapedce_structuralce_protectivece_autohoistce_scan_filece_subjects_file calls 1: ce_slen |
| 179 | func ce_isdig(c: i64) -> i64 { if c >= 48 { if c <= 57 { return 1 } } return 0 } |
| 182 | func ce_all_digits(b: *u8, s: i64, e: i64) -> i64 |
| 197 | func ce_atoi_span(b: *u8, s: i64, e: i64) -> i64 |
| 210 | func ce_pow2_big(v: i64) -> i64 called by 1: ce_scan_line |
| 218 | func ce_capshaped(b: *u8, s: i64, e: i64) -> i64 |
| 232 | func ce_structural(b: *u8, s: i64, e: i64) -> i64 |
| 246 | func ce_protective(b: *u8, s: i64, e: i64) -> i64 |
| 257 | func ce_autohoist(b: *u8, s: i64, e: i64) -> i64 |
| 263 | func ce_scan_line(b: *u8, s: i64, e: i64, path: *u8, lineno: i64, ctr: *i64) -> i64 called by 1: ce_scan_file calls 10: ce_autohoistce_capshapedce_all_digitsce_structuralce_protectivece_atoi_span+4 |
| 380 | func ce_scan_file(fb: *u8, flen: i64, path: *u8, ctr: *i64) -> i64 |
| 430 | func ce_path_size(p: *u8) -> i64 |
| 439 | func ce_span_in(b: *u8, s: i64, e: i64, nb: *u8, ns: i64, ne: i64) -> i64 called by 1: ce_subjects_file |
| 456 | func ce_subjects_file(fb: *u8, flen: i64, path: *u8, ctr: *i64) -> i64 |
| 607 | func main(argc: i64, argv: *i64) -> i64 |