code wiki / (root) / nx_png_dynamic_huffman_test.nx

nx_png_dynamic_huffman_test.nx

buildroot/runtime/nx_png_dynamic_huffman_test.nx

5231 B166 linesdepth 8pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic png
docsdependenciesstructsconstsfunctions

about

nx_png_dynamic_huffman_test.nx -- regression smoke proving nx_png_decode can consume a real-world dynamic-Huffman zlib stream (the format every gen-img PNG uses). SURFACED 2026-05-18 via empirical run: nx_image_grade_cli reports IGV2_ERR_DECODER=3 on any real PNG. The companion smoke nx_deflate_huffman_test.nx proved nx_deflate_inflate handles the SAME 61-byte raw DEFLATE bytes when called directly. So the bug is in nx_png_decode (or in how it hands IDAT bytes to nx_zlib_inflate). Fixture: 124-byte PNG built by python zlib.compress(raw, 6) where raw = 50 scanlines of "0x00 [200,170,150]*50". IDAT inner zlib stream = 67 bytes (0x78 0x9c header + 61 raw DEFLATE + 4 adler). Expected decode: width=50, height=50, pixels_size = 50*50*3 = 7500.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_runtime.nx nx_png_decoder.nx nx_png_dynamic_huffman_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_png_decoder.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main 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 ↻ nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32 nx_crc32_update nx_crc32_init nx_crc32_table_at _png_n_channels _png_bytes_per_pixel _png_n_channels ↻ _png_a7_expected _png_a7_col0 _png_a7_coli _png_a7_row0 _png_a7_rowi _png_a7_deinterlace _png_a7_col0 ↻ _png_a7_row0 ↻ _png_a7_coli ↻ _png_a7_rowi ↻ sys_mmap ↻ _png_unfilter_scanline _png_paeth

structs

none

consts

none

functions

20func main() -> nx_int