nx_uxf_tsv_migrate.nx
buildroot/runtime/nx_uxf_tsv_migrate.nx
about
nx_uxf_tsv_migrate.nx -- UXF arc R2: the ORIGINAL crash goal made real -- REPLACE A TSV.
Reads a real registry TSV, turns EACH data row into a canonical content-addressed record
(keys = positional column ids c0..cN, vals = the row's tab-separated fields), and stamps a
profiled CID (UXF_DATA). General over ANY TSV (no per-file schema): skip '#' comment lines,
split rows on TAB, positional keys. Proves on real data (Rule 7):
T1 parsed real rows ; T2 row0 round-trips through nx_uxf_decode to the SAME CID ;
T3 DEDUP -- the CID is field-ORDER-INDEPENDENT (canonicalization => same logical row =>
one CID, regardless of how the fields were ordered) ; T4 distinct rows => distinct CIDs.
Composes the proven envelope: canon_encode + uxf_cid_profiled + canon_decode. No hardware
writes (Rule 26). First corpus = sci_units.tsv (small/structured per the substrate spec).
expect_exit: 0 license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_canon_cid.nxnx_uxf_cid.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
| 16 | const K_MAGIC_65536: i64 = 65536 |
functions
| 18 | func mg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 19 | func mg_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) } let t: *u8 = sys_mmap(28); 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 { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 } |
| 21 | func mg_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 32 | func mg_keyname(idx: i64, dst: *u8) -> i64 |
| 45 | func mg_cpcid(src: *u8, dst: *u8) -> i64 { var i: i64 = 0; while i < 73 { dst[i] = src[i]; i = i + 1 } return 0 } called by 1: main |
| 47 | func main() -> i64 |