code wiki / _hdl_build / nx_compute_census.nx
nx_compute_census.nx
buildroot/runtime/_hdl_build/nx_compute_census.nx
about
nx_compute_census.nx -- the COMPUTE-DEVICE EXCEED census = "S-class exceed for ANY DEVICE" instrument
(operator 2026-06-20: "capabilities work on all hardware ... hardware rung up each rung"). The GPU/compute
analog of nx_portability_census: extends the HAL pattern (nx_hal: substrate primitives don't change, only
the per-target shim does) to COMPUTE DEVICES -- each device (CPU/NVIDIA/AMD/Intel/future-Nishi-silicon) is
a backend climbing the SAME gated rung ladder (R0 census -> R1 submit -> R2 memcpy -> R3 SIMD/scalar GEMM
-> R4 tensor-core RE -> R5 tensor-core GEMM -> R6 measured EXCEED), measured by the device-agnostic harness.
AUTHOR=ORGAN, measured (no-wave): reads compute_targets.tsv (device<TAB>cap<TAB>grade<TAB>evidence) and
LIAR-KILLS -- any non-ABSENT grade MUST cite REAL existing evidence (sys_openat_rd), else UNBACKED-LIAR -> RED.
Self-validating: pos control (a real gate file MUST exist), neg control (a fake path MUST NOT). Emits the
per-device exceed matrix + counts (EXCEEDS = the honest S-class wins so far). license_tier: ORIGINAL
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
| 13 | const CM_MAGIC_120000: i64 = 120000 |
| 14 | const CM_MAGIC_300000: i64 = 300000 |
| 16 | const CM_REF: *u8 = "knowledge/registry/compute_targets.tsv" |
| 17 | const CM_OUT: *u8 = "knowledge/registry/compute_census.tsv" |
| 18 | const CM_LOG: *u8 = "knowledge/status/compute_census.log" |
| 19 | const CM_MAXF: i64 = 512 |
functions
| 21 | func cm_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 22 | func cm_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48 as u8;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 23 | func cm_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 32 | func cm_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 33 | func cm_scan_to(buf: *u8, n: i64, start: i64, delim: i64) -> i64 { var i: i64 = start; var s: i64 = 1; while s == 1 { if i >= n { s = 0 } else { if buf[i] == (delim as u8) { s = 0 } else { i = i + 1 } } } return i } called by 1: main |
| 34 | func cm_app(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: main |
| 35 | func cm_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } called by 1: main |
| 37 | func main() -> i64 |