code wiki / (root) / nx_png_dynamic_huffman_test.nx

nx_png_dynamic_huffman_test.nx

buildroot/runtime/nx_png_dynamic_huffman_test.nx

5225 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 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 nx_zlib_inflate sys_mmap ↻ nx_deflate_inflate sys_mmap ↻ nx_bitstream_alloc sys_mmap ↻ _deflate_inflate_block nx_bitstream_read_lsb nx_bitstream_bits_remainin _bs_peek_byte nx_bitstream_byte_align nx_bitstream_read_byte_ali nx_bitstream_byte_align ↻ _deflate_build_static_litl sys_mmap ↻ nx_huffman_build _deflate_build_static_dist sys_mmap ↻ nx_huffman_build ↻ _deflate_decode_huffman_bl nx_huffman_decode_lsb _deflate_length_base

structs

none

consts

none

functions

20func main() -> nx_int