code wiki / _hdl_build / nx_portability_census.nx

nx_portability_census.nx

buildroot/runtime/_hdl_build/nx_portability_census.nx

6736 B143 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic portability
docsdependenciesstructsconstsfunctions

about

nx_portability_census.nx -- the HARDWARE-ABSTRACTION-LAYER reach census (operator 2026-06-13: "translate our work across all hardware as a layer while keeping S-class-exceed performance, as foundation work"). AUTHOR=ORGAN, measured (no-wave): reads portability_targets.tsv (the ISAs Nishi should reach) and COMPUTES PRESENT/ABSENT per target from REAL evidence -- does the codegen backend file actually exist (= nxc2 can emit NATIVE code for that ISA)? -- via sys_openat_rd, NOT asserted. The bottom HAL = these compile-time native backends (zero-cost portability: native per arch, no runtime VM). Writes portability_census.tsv + an honest bm_verdict. Self-validating: pos control x86_64.c MUST exist, neg control MUST NOT. Composes nx_benchmark (honest verdict, refuses cherry-pick). The remaining foundation work (ABSENT targets + making the rv64-only kernel emitters ride these backends) is the build-to-portability backlog. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_benchmark.nx nx_portability_census.nx

imports: nx_syscalls.nxnx_benchmark.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap kp_read_file sys_openat_rd sys_read sys_close kp_w sys_write kp_scan_to kp_app kp_exists sys_openat_rd ↻ sys_close ↻ sys_openat_wr sys_write ↻ sys_close ↻ bm_is_valid bm_completeness bm_verdict kp_emit kp_w ↻ kp_wn sys_mmap ↻ sys_write ↻ kp_vstr sys_openat_append

structs

none

consts

15const KP_MAGIC_80000: i64 = 80000
16const KP_MAGIC_200000: i64 = 200000
18const KP_REF: *u8 = "knowledge/registry/portability_targets.tsv"
19const KP_OUT: *u8 = "knowledge/registry/portability_census.tsv"
20const KP_LOG: *u8 = "knowledge/status/portability_census.log"
21const KP_MAXF: i64 = 256

functions

23func kp_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 }
called by 2: kp_emitmain calls 1: sys_write
24func kp_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;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 }
called by 1: kp_emit calls 2: sys_mmapsys_write
26func kp_read_file(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
41func kp_exists(path: *u8) -> i64
called by 1: main calls 2: sys_openat_rdsys_close
48func kp_scan_to(buf: *u8, n: i64, start: i64, delim: i64) -> i64
called by 1: main
55func kp_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
57func kp_vstr(v: i64) -> *u8
called by 1: kp_emit
65func kp_emit(fd: i64, nf: i64, present: i64, cpos: i64, cneg: i64, cov: i64, verdict: i64, ok: i64) -> i64
called by 1: main calls 3: kp_wkp_wnkp_vstr
77func main() -> i64