code wiki / (root) / nx_webp_huff_gate.nx

nx_webp_huff_gate.nx

buildroot/runtime/nx_webp_huff_gate.nx

5085 B127 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic webp
docsdependenciesstructsconstsfunctions

about

nx_webp_huff_gate.nx -- proves the VP8L Huffman code-group reader. The property that matters most is T2/T3: a single-symbol tree must decode its symbol while consuming ZERO bits. Every other Huffman path in the tree consumes at least one bit per symbol, so if this collapses to an ordinary canonical table the bitstream desyncs one bit at a time and the image decodes to noise -- silently, with no error anywhere. Constant-alpha and constant-red images (most synthetic PNG-to-WebP conversions) hit this on the very first tree. NON-VACUITY: T8/T9/T10 are negative controls. An all-zero length vector, a null tree and an out-of-range simple symbol must each be REFUSED. If this gate cannot fail it is not measuring anything -- flipping the T8 expectation to == 0 must turn it RED. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_bitstream.nx nx_huffman.nx nx_webp_huff.nx nx_webp_huff_gate.nx

imports: nx_syscalls.nxnx_bitstream.nxnx_huffman.nxnx_webp_huff.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 wl_tree_from_lengths sys_mmap ↻ nx_huffman_build sys_mmap ↻ nx_bitstream_alloc sys_mmap ↻ wl_decode_symbol nx_huffman_decode_lsb nx_bitstream_read_lsb nx_bitstream_bits_remainin _bs_peek_byte wl_read_huffman_code sys_mmap ↻ nx_bitstream_read_lsb ↻ wl_read_simple nx_bitstream_read_lsb ↻ wl_read_normal sys_mmap ↻ wl_code_order nx_bitstream_read_lsb ↻ wl_tree_from_lengths ↻ wl_decode_symbol ↻ wl_repeat_extra_bits wl_repeat_offset wl_tree_from_lengths ↻ wl_code_order ↻ g_puts sys_write sys_exit

structs

none

consts

none

functions

22func g_puts(s: *u8) -> i64
called by 1: main calls 1: sys_write
29func main() -> i64