code wiki / (root) / nx_galx_thumb_gate.nx

nx_galx_thumb_gate.nx

buildroot/runtime/nx_galx_thumb_gate.nx

7448 B139 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic galx
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_galx_thumb_gate.nx

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mkdir sys_unlinkat sys_mmap ↻ gt_write_bytes sys_openat_wr sys_write ↻ sys_close gt_run sys_mmap ↻ sys_pipe2 sys_fork sys_dup3 sys_close ↻ sys_execve sys_exit ↻ sys_read sys_wait4 gt_has gt_strlen gt_is_png

structs

none

consts

11const GT_ELF: *u8 = "nx_galx_thumb.elf"
12const GT_REALPNG:*u8 = "knowledge/compare/sample_front.png" // a stable checked-in PNG fixture
13const GT_DIR: *u8 = "/tmp/nx_galx_thumb_gate"
14const GT_PPM: *u8 = "/tmp/nx_galx_thumb_gate/in.ppm"
15const GT_BAD: *u8 = "/tmp/nx_galx_thumb_gate/bad.bin"
16const GT_OUT_PNG:*u8 = "/tmp/nx_galx_thumb_gate/out_png.png"
17const GT_OUT_PPM:*u8 = "/tmp/nx_galx_thumb_gate/out_ppm.png"
18const GT_OUT_BAD:*u8 = "/tmp/nx_galx_thumb_gate/out_bad.png"
19const GT_MODE: i64 = 0x1a4 // 0644 for fixture writes
20const GT_CAP: i64 = 4096

functions

22func 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
24func gt_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: gt_strlen
32func 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 }
35func gt_is_png(path: *u8) -> i64
50func gt_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, a5: *u8, out: *u8, cap: i64) -> i64
82func main() -> i64