code wiki / _hdl_build / nx_phys_constants.nx
nx_phys_constants.nx
buildroot/runtime/_hdl_build/nx_phys_constants.nx
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
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
structs
| none |
consts
| 21 | const PC_MAGIC_65536: i64 = 65536 |
| 23 | const PC_REF: *u8 = "knowledge/registry/sci_constants.tsv" |
| 24 | const PU_REF: *u8 = "knowledge/registry/sci_units.tsv" |
| 25 | const PC_LOG: *u8 = "knowledge/status/phys_constants.log" |
functions
| 27 | func 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 } |
| 28 | func 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 } |
| 29 | func 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 |
| 31 | func pc_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 41 | func pc_field(buf: *u8, ls: i64, le: i64, f: i64, dst: *u8, cap: i64) -> i64 |
| 54 | func pc_atoi(s: *u8, len: i64) -> i64 |
| 62 | func pc_streq(a: *u8, b: *u8) -> i64 |
| 69 | func 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 |
| 72 | func pc_const_lookup(cbuf: *u8, cn: i64, sym: *u8, val: *u8, si_ptr: *i64, dim: *i64) -> i64 |
| 104 | func pc_unit_dim(ubuf: *u8, un: i64, name: *u8, dim: *i64) -> i64 |
| 129 | func pc_count(cbuf: *u8, cn: i64, si_ptr: *i64, tot_ptr: *i64) -> i64 |
| 157 | func main() -> i64 |