code wiki / _hdl_build / nx_ciaaw_gate.nx
nx_ciaaw_gate.nx
buildroot/runtime/_hdl_build/nx_ciaaw_gate.nx
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
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
structs
| none |
consts
| 14 | const CG_STORE: *u8 = "knowledge/store/ciaaw-atw-" |
| 15 | const CG_LOG: *u8 = "knowledge/status/ciaaw_gate.log" |
functions
| 17 | func 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 } |
| 18 | func 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 } |
| 19 | func 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 |
| 20 | func 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 } |
| 21 | func 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 |
| 24 | func cg_ref(z: i64, val_out: *i64, unc_out: *i64) -> i64 |
| 45 | func main() -> i64 |