code wiki / _hdl_build / nx_ciaaw_gate.nx

nx_ciaaw_gate.nx

buildroot/runtime/_hdl_build/nx_ciaaw_gate.nx

6144 B107 linesdepth 9pulls 15 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_ciaaw_gate.nx -- VERIFY + LIAR-KILL gate for the CIAAW (international, upstream-of-NIST) external- reference loop. Standard atomic weights are UNCERTAIN quantities (intervals/uncertainties), NOT exact values like isotope masses -- so the correct test is agreement WITHIN CIAAW's stated +/- uncertainty, not exact equality. Compares OUR Element.mass_q3 against the IUPAC/CIAAW abridged value+uncertainty in the SOVEREIGN seg_store (key "atw:<Z>", fields mass_q3 + unc_q3, populated by nx_ciaaw_ingest via nx_html_table): AGREE iff |ours - ciaaw| <= ciaaw_uncertainty. disagree = our value is OUTSIDE the international uncertainty (a real drift). missing = no CIAAW standard weight (radioactive/synthetic). GREEN iff negctrl OK AND disagree==0. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_seg_store.nx nx_uxf_decode.nx nx_chem_periodic.nx nx_ciaaw_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_periodic_table_118 sys_mmap cg_ref sys_mmap ↻ cg_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 ↻ cg_streq cg_atoi cg_itoa ↻ sys_openat_append cg_w sys_write cg_wn sys_mmap ↻ sys_write ↻ sys_write ↻ sys_close sys_exit

structs

none

consts

14const CG_STORE: *u8 = "knowledge/store/ciaaw-atw-"
15const CG_LOG: *u8 = "knowledge/status/ciaaw_gate.log"

functions

17func cg_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
18func cg_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
19func cg_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: cg_ref
20func cg_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: cg_refmain calls 1: sys_mmap
21func cg_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: cg_ref
24func cg_ref(z: i64, val_out: *i64, unc_out: *i64) -> i64
45func main() -> i64