code wiki / _hdl_build / nx_codata_gate.nx

nx_codata_gate.nx

buildroot/runtime/_hdl_build/nx_codata_gate.nx

8125 B151 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_codata_gate.nx -- R2+R3 of the NIST CODATA external-reference loop: the VERIFY + LIAR-KILL gate that closes it. Reads our registry (sci_constants.tsv) and, for the NIST reference, the SOVEREIGN content- addressed store (nx_seg_store, populated by nx_codata_ingest) -- NOT a TSV. Asserts EVERY constant agrees with NIST. The grade is COMPUTED here, never self-asserted. Reference read: ss_get("knowledge/store/codata-", "codata:<sym>") -> canonical record bytes -> canon_decode -> {value, trunc}. Comparison (robust): split each value into significand + exponent at 'e'. Exponents must match exactly. Significands: if NIST truncated (trunc=1, e.g. reduced Planck / molar gas), our value must START WITH NIST's shown digits; else it must EQUAL them. Honest scope -- parity on the numbers: matching NIST IS the achievement; we never claim to beat the reference. EXCEED is only on the sovereign meta-axes. LIAR-KILL: a baked neg-control proves the comparator can tell a wrong value from a right one BEFORE any verdict. Writes knowledge/status/codata_gate.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_uxf_decode.nx nx_codata_gate.nx

imports: nx_syscalls.nxnx_seg_store.nxnx_uxf_decode.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 gt_read sys_openat_rd sys_read sys_close gt_w sys_write sys_exit gt_cmp sys_mmap ↻ gt_split gt_streq gt_startswith gt_field gt_ref sys_mmap ↻ ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻ ss_cat ss_readall sys_munmap ss_scan_seglist ss_len sys_mmap ↻ ss_cat ↻ ss_readall ↻ ss_r32 canon_decode ud_r32 sys_mmap ↻ gt_streq ↻ sys_openat_append gt_wn sys_mmap ↻

structs

none

consts

18const G_OURS: *u8 = "knowledge/registry/sci_constants.tsv"
19const G_STORE: *u8 = "knowledge/store/codata-"
20const G_LOG: *u8 = "knowledge/status/codata_gate.log"

functions

22func gt_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
31func gt_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 2: gt_cmpgt_ref
32func gt_startswith(a: *u8, b: *u8) -> i64 { var i: i64=0; while b[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } return 1 }
called by 1: gt_cmp
34func gt_field(buf: *u8, ls: i64, le: i64, col: i64, dst: *u8) -> i64
called by 1: main
45func gt_split(v: *u8, sig: *u8, exp: *u8) -> i64
called by 1: gt_cmp
52func gt_cmp(our: *u8, nist: *u8, trunc: i64) -> i64
61func gt_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 1: main calls 1: sys_write
62func gt_wn(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(16); var m: i64=v; let t: *u8=sys_mmap(16); 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{b[i]=t[k-1-i];i=i+1}; sys_write(fd,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
65func gt_ref(sym: *u8, nistv: *u8, trunc_ptr: *i64) -> i64
85func main() -> i64