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)

structs

none

consts

none

functions

32func g_puts(s: *u8) -> i64
39func g_putn(v: i64) -> i64
53func main() -> i64