code wiki / (root) / nx_visdesc_gate.nx

nx_visdesc_gate.nx

buildroot/runtime/nx_visdesc_gate.nx

9050 B191 linesdepth 6pulls 12 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_visdesc_gate.nx -- referee for the Google-lite visual-similarity descriptor (nx_visdesc). PROVES, in-process (no external elf, no shell), the capability dHash STRUCTURALLY lacks -- finding images that LOOK ALIKE rather than only exact copies. Corpus = 4 visual classes (horizontal stripes / vertical stripes / diagonal stripes / checker), 4 instances each, instances varying period + phase + brightness + deterministic noise (so they are genuinely DIFFERENT images, not copies). row1 DISCRIMINATION: every image's visdesc nearest-neighbour is its OWN class (16/16). row2 BEYOND-dHash (headline exceed): same-class instances have a LARGE average dHash Hamming (>10 -> dHash classes them as different images / non-copies) -- the gap visdesc fills. row3 BRIGHTNESS INVARIANCE: +brightness leaves the descriptor ~unchanged (small L1). row4 DETERMINISM: extracting the same image twice -> identical descriptor (L1 == 0). row5 SEPARATION: average cross-class L1 >> average same-class L1 (no descriptor collapse). GREEN iff 5/5. Durable verdict -> knowledge/status/visdesc_gate.log. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_visdesc.nx nx_phash.nx nx_visdesc_gate.nx

imports: nx_visdesc.nxnx_phash.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 g_synth nx_visdesc_extract vd_wrap_gray nx_image_alloc sys_mmap nx_image_set nx_image_sobel_x sys_mmap ↻ nx_image_convolve_3x3 nx_image_s64_alloc sys_mmap ↻ nx_image_get nx_image_s64_set nx_image_sobel_y sys_mmap ↻ nx_image_convolve_3x3 ↻ nx_image_s64_get vd_orient_bin nx_phash_dhash nx_phash_downscale nx_visdesc_l1 g_num nx_simhash_hamming nx_bits_popcount64_soft sys_openat_append g_w g_wn

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
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 }
called by 1: main
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 }
called by 1: main
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 }
called by 1: main
23func g_synth(buf: *u8, w: i64, h: i64, cls: i64, p: i64, phase: i64, bright: i64) -> i64
called by 1: main
47func main() -> i64