nx_img_to_rgb_gate.nx
buildroot/runtime/nx_img_to_rgb_gate.nx
about
nx_img_to_rgb_gate.nx -- referee for the RGB decode path (nx_img_to_rgb) AND the color descriptors
running on REAL decoded pixels (not just synthetic buffers). Builds genuine RGB PNGs at runtime
(stored-zlib, 8-bit RGB -- the same format the image-search e2e gate uses), decodes them through the
REAL nx_img_to_rgb, and checks:
row1 dims -- decoded width/height match.
row2 left=RED -- top-left pixel decodes to red (R high, G/B low).
row3 right=GREEN -- top-right pixel decodes to green (G high, R/B low).
row4 graceful -- a non-PNG file returns 0 (skip), never crashes.
row5 REAL-PIPE color -- a red PNG and a luma-matched green PNG, BOTH decoded via nx_img_to_rgb:
grayscale dHash Hamming == 0 (the gray engine collapses them) yet colordesc L1 is large
(color distinguishes) -- the colordesc headline reproduced end-to-end through the real decoder.
GREEN iff 5/5. Durable verdict -> knowledge/status/img_to_rgb_gate.log. license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_img_to_rgb.nxnx_colordesc.nxnx_phash.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
| 19 | 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 |
| 20 | 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 |
| 21 | 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 |
| 22 | 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 |
| 24 | 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 } |
| 27 | 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_lr |
| 28 | func gp_build_lr(out: *u8, w: i64, h: i64, r1: i64, g1: i64, b1: i64, r2: i64, g2: i64, b2: i64) -> i64 |
| 73 | func g_rgb_to_gray(rgb: *u8, gray: *u8, w: i64, h: i64) -> i64 called by 1: main |
| 88 | func main() -> i64 |