nx_imgquery_e2e_gate.nx
buildroot/runtime/nx_imgquery_e2e_gate.nx
about
nx_imgquery_e2e_gate.nx -- END-TO-END referee for hybrid reverse-image query on REAL decoded PNGs.
Builds a real RGB PNG corpus, decodes every image through nx_img_to_rgb (and luma for dHash), computes
each item's dHash + 112-dim imgsig, then runs the hybrid query (nx_imgquery copy + similar tiers).
corpus: A=red V-stripes, B=green V-stripes (same structure as A, different color),
C=red checker, D=green checker. queries built as separate PNGs and decoded the same way.
row1 COPY exact -- Q1 (a re-encoded copy of A) is found in the COPY tier at Hamming 0.
row2 dHash COLORBLIND-- dHash(A) ~ dHash(B): a red and a green image of the SAME structure are
indistinguishable to dHash (Hamming <= copy_thresh) -- the gap color fills.
row3 COLOR disambiguates -- imgsig nearest to Q1 is A, and imgsig(Q1,A) < imgsig(Q1,B): the hybrid
tells the TRUE copy from its different-color structural twin.
row4 LOOK-ALIKE -- Q2 (a red V-stripes image of a DIFFERENT period) is NOT a dHash copy of A
(Hamming > copy_thresh) yet imgsig nearest = A: a match the copy tier misses.
row5 HYBRID ORDERING -- imgsig(Q2,A) < imgsig(Q2,B) and < imgsig(Q2,C): structure AND color jointly
correct, on REAL decoded pixels.
GREEN iff 5/5. Durable verdict -> knowledge/status/imgquery_e2e_gate.log. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_imgquery.nxnx_img_to_rgb.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
structs
| none |
consts
| none |
functions
| 21 | func 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 |
| 22 | 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 } called by 1: main |
| 23 | func 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 } called by 1: main |
| 24 | func 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 } called by 1: main |
| 25 | func g_clamp255(v: i64) -> i64 { if v<0 { return 0 } if v>255 { return 255 } return v } |
| 26 | func 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 } |
| 30 | func g_synth_rgb_sc(rgb: *u8, w: i64, h: i64, structIdx: i64, colorIdx: i64, p: i64, phase: i64, dbright: i64) -> i64 |
| 58 | func 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_buf |
| 59 | func gp_build_buf(out: *u8, rgb: *u8, w: i64, h: i64) -> i64 |
| 101 | func g_rgb_to_gray(rgb: *u8, gray: *u8, w: i64, h: i64) -> i64 |
| 115 | func g_make_decode(path: *u8, pb: *u8, scratch: *u8, w: i64, h: i64, structIdx: i64, colorIdx: i64, p: i64, phase: i64, dbright: i64, wh: *i64) -> *u8 |
| 122 | func main() -> i64 |