code wiki / (root) / nx_image_e2e_gate.nx

nx_image_e2e_gate.nx

buildroot/runtime/nx_image_e2e_gate.nx

11825 B199 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic image
docsdependenciesstructsconstsfunctions

about

nx_image_e2e_gate.nx -- END-TO-END referee for search-by-image on REAL images. Closes the loop R1a (query logic) + R1b (real-PNG ingest) could only prove separately: it builds a REAL PNG corpus, runs the REAL ingestor (/tmp/nx_image_index.sov.elf) to fingerprint it into an index, then runs the REAL query client (/tmp/nx_image_search.sov.elf) with a REAL PNG query and checks the ranked match. "Real image in -> correct image out", fully sovereign, no production touched. corpus = {/E/up (grad-up), /E/down (grad-down), /E/mid (stripes)} (real .png files) query 1 = up RE-EXPOSED (+40 brightness, a real .png) -> must match /E/up at rank 1, Hamming 0, and matches=1 (down @64 and mid @24 correctly excluded by the threshold) [the headline] query 2 = grad-down .png -> must match /E/down at rank 1 query 3 = stripes .png -> must match /E/mid at rank 1, Hamming 0 GREEN iff 6/6. Durable verdict -> knowledge/status/image_e2e_gate.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_crc32.nx nx_adler32.nx nx_image_e2e_gate.nx

imports: nx_syscalls.nxnx_crc32.nxnx_adler32.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 gp_build gp_wbe nx_crc32 nx_crc32_update nx_crc32_init nx_crc32_table_at gp_val adler32 g_write_bytes sys_openat_wr sys_write ↻ sys_close g_write_file g_write_bytes ↻ g_strlen

structs

none

consts

none

functions

16func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
17func 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 }
18func g_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 }
calls 1: sys_write
19func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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(fd,bb,k); return 0 }
20func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: g_write_fileg_find
22func g_write_bytes(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64=sys_openat_wr(path, 0x1a4); if fd<0 { return 0-1 } sys_write(fd, buf, n); sys_close(fd); return 0 }
23func g_write_file(path: *u8, data: *u8) -> i64 { return g_write_bytes(path, data, g_strlen(data)) }
called by 1: main calls 2: g_write_bytesg_strlen
24func g_read_small(path: *u8, buf: *u8, cap: i64) -> i64
33func g_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 2: g_containsg_rank_of calls 1: g_strlen
45func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 { if g_find(hay,n,needle)>=0 { return 1 } return 0 }
calls 1: g_find
46func g_rank_of(buf: *u8, n: i64, expected: *u8) -> i64
calls 1: g_find
61func gp_wbe(buf: *u8, off: i64, val: i64) -> i64 { buf[off]=((val>>24)&255) as u8; buf[off+1]=((val>>16)&255) as u8; buf[off+2]=((val>>8)&255) as u8; buf[off+3]=(val&255) as u8; return 0 }
called by 1: gp_build
62func gp_val(kind: i64, x: i64, w: i64, bright: i64) -> i64 { var v: i64=0; if kind==0 { v=x*4 } if kind==1 { v=(w-1-x)*4 } if kind==3 { v=(x&2)*30 } v=v+bright; if v<0 { v=0 } if v>255 { v=255 } return v }
called by 1: gp_build
63func gp_build(out: *u8, w: i64, h: i64, kind: i64, bright: i64) -> i64
called by 1: main calls 4: gp_wbenx_crc32gp_valadler32
101func g_run_index(corpus: *u8, outidx: *u8, outcap: *u8) -> i64
129func main() -> i64