code wiki / _hdl_build / nx_codata_ingest.nx

nx_codata_ingest.nx

buildroot/runtime/_hdl_build/nx_codata_ingest.nx

8531 B161 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_uxf_decode.nx nx_codata_ingest.nx

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

main sys_mmap ci_read sys_openat_rd sys_read sys_close ci_w sys_write sys_exit ss_begin ss_begin_cap sys_mmap ↻ ci_lookup ci_prefix ci_is_digit ci_value canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap ss_add ss_add2 ss_w32 ss_len sys_now_ms sys_mmap ↻ sys_clock_gettime_mono ss_commit ss_segid_ok sys_mmap ↻ ss_cat ss_catn sys_mmap ↻ sys_write ↻ ss_write_seg ss_segid_ok ↻ sys_mmap ↻ ss_cat ↻

structs

none

consts

15const CI_MAGIC_131072: i64 = 131072
17const CI_TABLE: *u8 = "knowledge/fetched/nist/codata_allascii.txt"
18const CI_STORE: *u8 = "knowledge/store/codata-"

functions

20func 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 }
called by 1: main calls 1: sys_write
22func ci_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
31func 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
32func 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
34func ci_prefix(buf: *u8, p: i64, le: i64, name: *u8) -> i64
called by 1: ci_lookup
44func ci_value(buf: *u8, vs: i64, le: i64, dst: *u8, trunc_ptr: *i64) -> i64
called by 1: ci_lookup
70func ci_lookup(tab: *u8, tn: i64, name: *u8, val: *u8, trunc_ptr: *i64) -> i64
called by 1: main calls 3: ci_prefixci_is_digitci_value
91func main() -> i64