code wiki / _hdl_build / nx_cpuid.nx
nx_cpuid.nx
buildroot/runtime/_hdl_build/nx_cpuid.nx
about
nx_cpuid.nx -- THE R0 PRIMITIVE: what silicon are we actually on, and which code path may dispatch?
WHY THIS IS RUNG ZERO: nx_prim_gap reported cpu-feature-detect MISSING across all 256 registry
primitives. Without it NO organ can adapt to the machine it runs on, so no future hardware purchase
is visible to the ecosystem and every SIMD/prefetch/cache rung above is unbuildable. It is literally
the first bit up.
★THE GAP WAS DISCOVERY, NOT CAPABILITY: runtime/nx_cpu_features.nx already ran REAL cpuid via the
__cpuid_ebx intrinsic -- but exposed 3 bits (BMI2/ADX) out of a register that also carries AVX2, the
whole AVX-512 family, SHA, BMI1, RDSEED and CLFLUSHOPT, and it was registered nowhere. The data was
fetched and thrown away. LAW: a capability no registry can see is indistinguishable from one that
does not exist.
TRIANGULATION IS THE POINT (evidence law): every bit is read TWICE from independent sources -- our own
cpuid(7,0):EBX, and the kernel's own decode in /proc/cpuinfo. Agreement is evidence; a DISAGREEMENT is
reported as a defect and drives the exit code, never averaged or hidden. If our bit map is wrong we
want to fail loudly here, not silently dispatch an AVX-512 kernel onto a Zen 1.
Exit code = number of disagreements. 0 = both sources agree on every probed feature.
license_tier: ORIGINAL Read-only. No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_cpuid_lib.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
structs
| none |
consts
| 23 | const CI_CPUBUF: i64 = 8192 |
| 24 | const CI_LEAF: i64 = 7 |
| 25 | const CI_SUBLEAF: i64 = 0 |
functions
| 28 | func ci_row(name: *u8, ours: i64, buf: *u8, n: i64, tok: *u8) -> i64 |
| 43 | func main() -> i64 |