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
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
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
structs
| none |
consts
| none |
functions
| 10 | func 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 } |
| 11 | func 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 |
| 12 | func 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 } |
| 14 | func 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 |
| 16 | func make_cid(idv: i64, out: *u8) -> i64 |
| 23 | func make_path(idv: i64, out: *u8) -> i64 |
| 30 | func main() -> i64 |