code wiki / _hdl_build / nx_isotope_gate.nx

nx_isotope_gate.nx

buildroot/runtime/_hdl_build/nx_isotope_gate.nx

6298 B108 linesdepth 9pulls 15 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_isotope_gate.nx -- chemistry external-reference loop, VERIFY + LIAR-KILL gate. Compares OUR periodic table's exact isotope masses (nx_chem_periodic nx_chem_atomic_data_table_118: iso_mass_q4 = exact mass of the most-abundant isotope * 10000) against the NIST Atomic Weights reference held in the SOVEREIGN seg_store (key "iso:<Z>:<A>", populated by nx_isotope_ingest from the foundationed NIST data) -- NOT a TSV. For each element we look up NIST's Relative Atomic Mass for OUR most-abundant isotope (Z, iso_a_q0) and assert iso_mass_q4 == NIST_q4 (exact integer; both are mass*10000 rounded). disagree>0 is a real finding (our value drifted from NIST). missing = our isotope not in this NIST subset = honestly UNVERIFIED (reported, never claimed verified). LIAR-KILL neg-control proves the lookup distinguishes known values + a missing key. GREEN iff neg-control OK AND disagree==0. Writes knowledge/status/isotope_gate.log. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_uxf_decode.nx nx_chem_periodic.nx nx_isotope_gate.nx

imports: nx_syscalls.nxnx_seg_store.nxnx_uxf_decode.nxnx_chem_periodic.nx

imported by: nobody (leaf or entry point)

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

main nx_chem_atomic_data_table_ ig_ref sys_mmap ig_itoa 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 ↻ ig_streq ig_atoi sys_mmap ↻ ig_itoa ↻ sys_openat_append ig_w sys_write ig_wn sys_mmap ↻ sys_write ↻ sys_write ↻ sys_close sys_exit

structs

none

consts

16const IG_STORE: *u8 = "knowledge/store/isotope-"
17const IG_LOG: *u8 = "knowledge/status/isotope_gate.log"

functions

19func ig_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
20func ig_wn(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(16); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} 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
21func ig_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: ig_ref
22func ig_itoa(v: i64, dst: *u8) -> i64 { var m: i64=v; let t: *u8=sys_mmap(24); 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{dst[i]=t[k-1-i];i=i+1} dst[k]=0 as u8; return k }
called by 2: ig_refmain calls 1: sys_mmap
23func ig_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ if s[i]>=(48 as u8){ if s[i]<=(57 as u8){ v=v*10+(s[i]-48) } } i=i+1 } return v }
called by 1: ig_ref
26func ig_ref(z: i64, a: i64) -> i64
43func main() -> i64