code wiki / (root) / nx_zstd_block_gate.nx

nx_zstd_block_gate.nx

buildroot/runtime/nx_zstd_block_gate.nx

9519 B204 linesdepth 6pulls 11 transitivereach 0 importersview sourcekind gate/prooftopic zstd
docsdependenciesstructsconstsfunctions

about

nx_zstd_block_gate.nx -- proves zstd compressed-block decompression. T3 is the payoff: a complete Compressed block with HUFFMAN-CODED literals, assembled byte by byte -- literals header, Huffman tree description, coded stream, sequences header -- decompressed to its exact bytes. Every layer below is exercised in one call: header parsing, weight decoding, weight completion, table build, backward reading, symbol decode. T5 pins the DISTINCT refusal codes. A block carrying sequences must NOT quietly emit its literals: that produces output of the right LENGTH and the wrong BYTES, which a length check passes. FSE sequences, FSE weights and four-stream literals each get their own code so a caller can tell 'unsupported' from 'corrupt' from 'wrong shape'. T4 pins that the tree description lives INSIDE compressed_size. Treating compressed_size as the stream alone over-reads by the description length and desynchronises the sequences section that follows -- which is why the sequences byte is asserted to land where it does. license_tier: ORIGINAL

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_zstd_fse.nx nx_zstd_bits.nx nx_zstd_huf.nx nx_zstd_lit.nx nx_zstd_seq.nx nx_zstd_fse_dec.nx nx_zstd_seqtab.nx nx_zstd_seqdec.nx nx_zstd_block.nx nx_zstd_block_gate.nx

imports: nx_syscalls.nxnx_zstd_fse.nxnx_zstd_bits.nxnx_zstd_huf.nxnx_zstd_lit.nxnx_zstd_seq.nxnx_zstd_fse_dec.nxnx_zstd_seqtab.nxnx_zstd_seqdec.nxnx_zstd_block.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_zstd_block_decompress sys_mmap ↻ nx_zstd_lit_header nx_lit_at nx_zstd_lit_raw nx_zstd_lit_rle nx_zstd_block_tree nx_blk_at sys_mmap ↻ nx_zstd_weights_direct nx_zb_at nx_zstd_weights_complete nx_zstd_weights_tablelog nx_zstd_huf_build sys_mmap ↻ nx_zstd_lit_huf nx_zstd_bits_init nx_zb_at ↻ nx_zb_highbit8 sys_mmap ↻ nx_zstd_huf_decode nx_zstd_bits_peek nx_zb_at ↻ nx_zstd_huf_symbol_at nx_zstd_huf_nbits_at nx_zstd_bits_skip nx_zstd_seq_header nx_seq_at nx_zstd_seqtab_ll_table sys_mmap ↻ nx_zstd_seqtab_ll nx_fse_build_dtable nx_fse_step sys_mmap ↻ nx_fse_highbit nx_zstd_seqtab_ml_table sys_mmap ↻ nx_zstd_seqtab_ml

structs

none

consts

none

functions

32func g_puts(s: *u8) -> i64
called by 2: g_putnmain calls 1: sys_write
39func g_putn(v: i64) -> i64
called by 1: main calls 3: sys_mmapg_putssys_write
53func main() -> i64