code wiki / _hdl_build / nx_cpuid.nx

nx_cpuid.nx

buildroot/runtime/_hdl_build/nx_cpuid.nx

4332 B75 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_cpuid_lib.nx nx_resmon_lib.nx nx_cpuid.nx

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

main rm_read sys_openat_rd sys_read sys_close rm_puts sys_write rm_slen 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 ci_row cf_flag cf_isdelim rm_puts ↻ rm_num ↻ cf_avx2 cf_bit cf_bmi1 cf_bit ↻ cf_bmi2 cf_bit ↻ cf_adx

structs

none

consts

23const CI_CPUBUF: i64 = 8192
24const CI_LEAF: i64 = 7
25const CI_SUBLEAF: i64 = 0

functions

28func ci_row(name: *u8, ours: i64, buf: *u8, n: i64, tok: *u8) -> i64
called by 1: main calls 3: cf_flagrm_putsrm_num
43func main() -> i64