code wiki / _hdl_build / nx_galx_cid_index_gate.nx

nx_galx_cid_index_gate.nx

buildroot/runtime/_hdl_build/nx_galx_cid_index_gate.nx

4606 B77 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic galx
docsdependenciesstructsconstsfunctions

about

nx_galx_cid_index_gate.nx -- SOVEREIGN gate for the O(1) cid->path store. Builds a synthetic cid_paths.tsv (N unique cids -> paths), builds the index+blob, then verifies EVERY cid resolves to its exact path (build + open-addressing + blob offsets all correct) and a non-existent cid is a clean miss. Every number printed. GREEN iff all N resolve correctly AND the miss is rejected. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_g_puts_lib.nx nx_galx_cid_index.nx nx_galx_cid_index_gate.nx

imports: nx_syscalls.nxnx_g_puts_lib.nxnx_galx_cid_index.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write sys_mmap make_cid to_hex16 make_path g_itoa sys_mmap ↻ sys_openat_wr sys_write ↻ sys_close g_num sys_mmap ↻ sys_write ↻ gs_cidindex_build sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ cidx_fnv1a sys_openat_wr ↻ sys_write ↻ sys_close ↻ sys_read_file ↻ cidx_rd64 gs_cidindex_lookup cidx_fnv1a ↻ cidx_rd64 ↻ g_streq sys_exit

structs

none

consts

none

functions

10func g_num(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 }
called by 1: main calls 2: sys_mmapsys_write
11func g_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
12func g_itoa(v: i64, out: *u8) -> i64 { if v==0 { out[0]=48 as u8; return 1 } let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; while m>0{t[k]=((48+(m%10)) as u8);m=m/10;k=k+1}; var i: i64=0; while i<k{out[i]=t[k-1-i];i=i+1}; return k }
called by 1: make_path calls 1: sys_mmap
14func to_hex16(v: i64, out: *u8) -> i64 { let hx: *u8="0123456789abcdef" as *u8; var i: i64=0; while i<16 { let sh: i64=(15-i)*4; out[i]=hx[(v>>sh)&15]; i=i+1 } return 0 }
called by 1: make_cid
16func make_cid(idv: i64, out: *u8) -> i64
called by 1: main calls 1: to_hex16
23func make_path(idv: i64, out: *u8) -> i64
called by 1: main calls 1: g_itoa
30func main() -> i64