block-independent-compression · shipping · also Independent compressed blocks

Block-independent compression

Block-independent compression encodes each block without requiring decoded history from preceding blocks.

Related Observatory article: Read on hesela.com

LZ4 independent blocks can still share an external dictionary. Independence removes preceding-block history, not dictionary, boundary or size requirements. A raw block interface needs surrounding metadata to supply decoding bounds. [1] [2]

Random access also requires locating the requested block and deciding what integrity checks cover a partial read. A whole-frame content check cannot be completed from only one selected block. Reordering independently decodable blocks can change the restored object while each block checksum still passes. [3]

The liblz4 1.9.4 dictionary decompression API uses dictionary memory in place. Keep that buffer accessible throughout frame decoding; compression-side CDict creation instead copies the supplied content. This lifetime contract is separate from block independence and dictionary selection. The dictionary controls test supplied-byte identity, not use-after-free or parallel random access. [4] [3]

The raw LZ4 partial decoder returns a requested prefix, not proof of whole-block validity. In Hesela's liblz4 1.9.4 control, it restores all 96 expected bytes from a block with an extra trailing byte while full decoding rejects that input. A shortened literal sequence can instead return fewer bytes without an error. Keep prefix length, input boundaries and object identity separate. [5] [3]

By contrast, DEFLATE permits references into prior blocks; block-local Huffman coding does not establish history independence. [6]

Relations

related
LZ4 frame, Compression dictionary, Read amplification, Checksum, DEFLATE

Citations

  1. LZ4 Frame Format 1.6.4, pinned to v1.10.0: block independence, checksums and dictionaries (accessed 2026-10-18)
  2. LZ4 v1.9.4 block format: out-of-band metadata and decoding bounds (accessed 2026-10-18)
  3. Hesela: LZ4 frame checks, block order and completion (accessed 2026-10-18)
  4. LZ4 v1.9.4 frame API: compression dictionary copy and decoding buffer lifetime (accessed 2026-10-22)
  5. LZ4 v1.9.4 raw-block API: LZ4_decompress_safe_partial bounds and return contract (accessed 2026-10-22)
  6. RFC 1951: DEFLATE format, sections 2 and 3.2-3.3 (Informational, May 1996) (accessed 2026-11-11)

JSON: /data/terms/block-independent-compression.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Block-independent compression. Hesela. 2026-11-11. https://hesela.dev/terms/block-independent-compression/