nx_galx_thumb_gate.nx
buildroot/runtime/nx_galx_thumb_gate.nx
about
nx_galx_thumb_gate.nx -- referee for /compare/mediaingest R3 (th_decode_any). Forks the LIVE nx_galx_thumb.elf
end to end over a fixture per capability class and asserts a valid thumbnail comes out. The per-format decode
correctness (JPEG baseline+progressive, GIF, WebP-lossless, BMP, TIFF, TGA, PCX, ICO, PNM, PNG all colour types)
is ALREADY gate-proven inside nx_img_bytes_to_rgb (2026-08-05), which th_decode_any composes rather than
reimplements -- so this gate proves the WIRING: PNG still thumbnails (regression), a NON-PNG format now
thumbnails through th_decode_any (the R3 capability), and garbage is refused (never a wrong image).
Scratch lives in /tmp so no production fixture is shared with a beat. license_tier: ORIGINAL No hw writes.
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.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
| 11 | const GT_ELF: *u8 = "nx_galx_thumb.elf" |
| 12 | const GT_REALPNG:*u8 = "knowledge/compare/sample_front.png" // a stable checked-in PNG fixture |
| 13 | const GT_DIR: *u8 = "/tmp/nx_galx_thumb_gate" |
| 14 | const GT_PPM: *u8 = "/tmp/nx_galx_thumb_gate/in.ppm" |
| 15 | const GT_BAD: *u8 = "/tmp/nx_galx_thumb_gate/bad.bin" |
| 16 | const GT_OUT_PNG:*u8 = "/tmp/nx_galx_thumb_gate/out_png.png" |
| 17 | const GT_OUT_PPM:*u8 = "/tmp/nx_galx_thumb_gate/out_ppm.png" |
| 18 | const GT_OUT_BAD:*u8 = "/tmp/nx_galx_thumb_gate/out_bad.png" |
| 19 | const GT_MODE: i64 = 0x1a4 // 0644 for fixture writes |
| 20 | const GT_CAP: i64 = 4096 |
functions
| 22 | func gt_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: gt_has |
| 24 | func gt_has(hay: *u8, hn: i64, needle: *u8) -> i64 |
| 32 | func gt_write_bytes(path: *u8, buf: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, GT_MODE); if fd < 0 { return 0 - 1 } sys_write(fd, buf, n); sys_close(fd); return 0 } |
| 35 | func gt_is_png(path: *u8) -> i64 |
| 50 | func gt_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, out: *u8, cap: i64) -> i64 |
| 82 | func main() -> i64 |