code wiki / _hdl_build / nx_portability_proof_census.nx
nx_portability_proof_census.nx
buildroot/runtime/_hdl_build/nx_portability_proof_census.nx
about
nx_portability_proof_census.nx -- the EMIT-PROVEN tier of the HAL reach census.
AUTHOR=ORGAN, measured, no-wave: nx_portability_census proves each backend FILE EXISTS (= reach,
16/16). This sibling proves the stronger claim that census header itself flags as the gap -- that
the backend actually EMITS CORRECT NATIVE code, KAT-verified -- by COMPUTING, per ISA, whether a
real GREEN gate-log / parity-stamp exists. It reads portability_proof_sources.tsv (WHERE the proof
lives + WHICH token = GREEN) and VERIFIES the token actually occurs in that file (does NOT trust
the map's say-so): a row whose token is absent reads UNPROVEN. proven_permil <= reach_permil by
construction; the delta IS the rv64-only kernel-emitter foundation gap, now a tracked number that
ratchets UP as per-ISA emit KATs land (twin of nx_hal_purity_audit's ratchet).
Self-validating: a POS control (real GREEN token) MUST read proven; a NEG control (bogus token in
the same real file) MUST read unproven -- so the census cannot rubber-stamp. Writes
portability_proof_census.tsv + an honest PROOFGATE verdict to the log. 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
| 15 | const PT_MAGIC_200000: i64 = 200000 |
| 16 | const PT_MAGIC_80000: i64 = 80000 |
| 17 | const PT_MAGIC_262144: i64 = 262144 |
| 19 | const PT_REF: *u8 = "knowledge/registry/portability_targets.tsv" |
| 20 | const PS_REF: *u8 = "knowledge/registry/portability_proof_sources.tsv" |
| 21 | const PC_OUT: *u8 = "knowledge/registry/portability_proof_census.tsv" |
| 22 | const PC_LOG: *u8 = "knowledge/status/portability_proof_census.log" |
| 23 | const PC_MAXF: i64 = 256 |
functions
| 25 | func pc_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 } |
| 26 | func pc_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 } |
| 28 | func pc_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 42 | func pc_scan_to(buf: *u8, n: i64, start: i64, delim: i64) -> i64 called by 1: pc_parse3 |
| 49 | func pc_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 |
| 51 | func pc_streq(a: *u8, b: *u8) -> i64 called by 1: pc_is_proven |
| 62 | func pc_contains(buf: *u8, n: i64, needle: *u8) -> i64 |
| 80 | func pc_parse3(buf: *u8, n: i64, c0: *i64, c1: *i64, c2: *i64) -> i64 |
| 102 | func pc_is_proven(isa: *u8, ns: i64, sisa: *i64, sevf: *i64, stok: *i64, evbuf: *u8, ev: *i64, tk: *i64) -> i64 |
| 119 | func pc_emit(fd: i64, nf: i64, proven: i64, cpos: i64, cneg: i64, cov: i64, ok: i64) -> i64 |
| 131 | func main() -> i64 |