code wiki / _hdl_build / nx_codata_ingest.nx
nx_codata_ingest.nx
buildroot/runtime/_hdl_build/nx_codata_ingest.nx
about
nx_codata_ingest.nx -- chemistry/physics external-reference loop, ingest stage. Reads the FOUNDATIONED
NIST CODATA table (knowledge/fetched/nist/codata_allascii.txt, CID'd + signed by nx_codata_foundation)
and MECHANICALLY extracts each of our constants' verbatim value, writing a content-addressed canonical
record per constant into the SOVEREIGN seg_store (prefix knowledge/store/codata-, key "codata:<sym>").
NO TSV: the symbol->NIST-quantity-NAME map (stable identifiers, never the drifting values) is INLINED
below, cited to the table; the only output is the sovereign content-addressed store.
Table column model: "<quantity name padded><value><2+ spaces><uncertainty>...". Single spaces inside a
value are digit-groupers; "..." marks truncation. Q4-style normalize = strip spaces + "...". Baked
self-test: store round-trips c -> "299792458" and m_e -> "9.1093837139e-31" (the 2022 value). license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nxnx_uxf_decode.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
| 15 | const CI_MAGIC_131072: i64 = 131072 |
| 17 | const CI_TABLE: *u8 = "knowledge/fetched/nist/codata_allascii.txt" |
| 18 | const CI_STORE: *u8 = "knowledge/store/codata-" |
functions
| 20 | func ci_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 } |
| 22 | func ci_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 31 | func ci_is_digit(c: u8) -> i64 { if c >= (48 as u8) { if c <= (57 as u8) { return 1 } } return 0 } called by 1: ci_lookup |
| 32 | func ci_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: main |
| 34 | func ci_prefix(buf: *u8, p: i64, le: i64, name: *u8) -> i64 called by 1: ci_lookup |
| 44 | func ci_value(buf: *u8, vs: i64, le: i64, dst: *u8, trunc_ptr: *i64) -> i64 called by 1: ci_lookup |
| 70 | func ci_lookup(tab: *u8, tn: i64, name: *u8, val: *u8, trunc_ptr: *i64) -> i64 |
| 91 | func main() -> i64 |