code wiki / _hdl_build / nx_phys_constants.nx

nx_phys_constants.nx

buildroot/runtime/_hdl_build/nx_phys_constants.nx

8962 B215 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_phys_constants.nx -- the SOVEREIGN EXACT physical-constants registry (science-exceed arc, rung PHYS-CONSTANTS). COMPOSES nx_phys_units: every constant carries its dimension in the SAME 7-SI-base integer basis [L,M,T,I,TH,N,J], and the gate cross-checks a constant's dimension against the units registry (sci_units.tsv). DATA-driven: knowledge/registry/sci_constants.tsv. EXCEED vs Mathematica Quantity (float magnitudes, cloud-tethered): the 2019 SI redefinition FIXED c, dnu_Cs, h, e, k, N_A (=> R) EXACTLY by definition. Nishi stores those si_exact=1 constants as their EXACT defining decimals -- sovereign, offline, attestable, no float approximation. Honest scope: this is an exact-VALUE registry (not yet a bignum calculator); CODATA-measured constants (si_exact=0) carry the best-known value. BAKED GATE (runs + asserts before verdict=GREEN): c's value == its exact SI definition; c & N_A are si_exact while G is measured; c's dimension == the "velocity" unit's dimension (COMPOSE check vs nx_phys_units' registry); an unknown symbol is rejected; >=7 constants are SI-exact. module: nishi-core.science.phys_constants depends: nishi-core.sys.syscalls capability: SOVEREIGN_EXACT_PHYSICAL_CONSTANTS license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_phys_constants.nx

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

main sys_mmap pc_read sys_openat_rd sys_read sys_close pc_w sys_write sys_exit pc_const_lookup sys_mmap ↻ pc_field pc_streq pc_atoi pc_unit_dim sys_mmap ↻ pc_field ↻ pc_streq ↻ pc_atoi ↻ pc_count sys_mmap ↻ pc_field ↻ pc_len pc_atoi ↻ pc_streq ↻ pc_eq7 sys_openat_append pc_wn sys_mmap ↻ sys_write ↻ sys_close ↻

structs

none

consts

21const PC_MAGIC_65536: i64 = 65536
23const PC_REF: *u8 = "knowledge/registry/sci_constants.tsv"
24const PU_REF: *u8 = "knowledge/registry/sci_units.tsv"
25const PC_LOG: *u8 = "knowledge/status/phys_constants.log"

functions

27func 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 }
called by 1: main calls 1: sys_write
28func 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 }
called by 1: main calls 2: sys_mmapsys_write
29func pc_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: pc_count
31func pc_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
41func pc_field(buf: *u8, ls: i64, le: i64, f: i64, dst: *u8, cap: i64) -> i64
54func pc_atoi(s: *u8, len: i64) -> i64
62func pc_streq(a: *u8, b: *u8) -> i64
69func pc_eq7(a: *i64, b: *i64) -> i64 { var k: i64=0; while k<7 { if a[k]!=b[k] { return 0 } k=k+1 } return 1 }
called by 1: main
72func pc_const_lookup(cbuf: *u8, cn: i64, sym: *u8, val: *u8, si_ptr: *i64, dim: *i64) -> i64
104func pc_unit_dim(ubuf: *u8, un: i64, name: *u8, dim: *i64) -> i64
129func pc_count(cbuf: *u8, cn: i64, si_ptr: *i64, tot_ptr: *i64) -> i64
called by 1: main calls 4: sys_mmappc_fieldpc_lenpc_atoi
157func main() -> i64