This release significantly improves the existing native Zstandard implementation introduced in v0.0.2, completing the remaining compression and decompression functionality, improving compression efficiency, and covering previously missing edge cases.
The implementation continues to be pure Zig with zero C dependencies, with expanded support for the Zstandard 1.6.0 specification.
Compression Improvements
- Improved the existing native LZ77 compression implementation.
- Added FSE sequence encoding and improved sequence bitstream generation.
- Added repeat-offset sequence encoding with complete three-entry repeat-offset history tracking.
- Improved compression of repetitive and structured data.
- Added repeat-offset handling for distances 1–3.
- Added raw and RLE block fallback when compression does not provide a benefit.
- Added RLE detection.
- Improved compression-level support for levels 1–22 and negative levels.
- Expanded configurable compression parameters including strategy, window size, hash/chain depth, search length, minimum match length, and target length.
Decompression Improvements
- Completed compressed-block decoding functionality.
- Added Huffman literal decoding for single-stream and 4-stream modes.
- Added FSE sequence decoding for predefined, RLE, compressed, and repeat modes.
- Added compact normalized-counter header parsing with run-length zero coding.
- Improved repeat-offset semantics, including
litLength == 0edge cases. - Preserved entropy tables and repeat-offset history correctly across blocks.
- Added XXH64 checksum validation.
- Added content-size verification.
- Added dictionary ID handling.
- Added skippable-frame support.
- Added reserved frame-header descriptor validation.
Streaming Improvements
- Improved streaming decompression for fragmented frame headers.
- Frame-header parsing now determines the exact required header length before parsing.
- Incomplete headers correctly wait for additional input instead of failing.
- Improved handling of very small streaming chunks.
Edge-Case Coverage
Expanded coverage for previously missing and difficult cases, including:
- Empty inputs and frames.
- Input lengths from 0–300 bytes.
- Maximum single-block input.
- Multi-block frames.
- Checksum corruption.
- Mid-stream corruption.
- Skippable frames and all supported skippable magic variants.
- Skippable frames interleaved with data frames.
- Reserved frame-header bits.
- Content-size mismatches.
- Dictionary ID propagation.
- Streaming chunk boundaries.
- Empty final streaming chunks.
- Compression-level bounds.
compressBound()behavior.- Repeat-offset and literal-length-zero edge cases.
Versioning
Library and specification versions are now tracked separately:
- Library version: 0.0.3
- Zstandard specification: 1.6.0
- Specification version number: 10600
New specification-version accessors have also been added.
Documentation & Project Cleanup
- Updated documentation to explicitly describe Zstandard 1.6.0 support.
- Updated API documentation with separate library and specification versions.
- Added documentation for all 12 examples.
- Refreshed example outputs.
- Added
SECURITY.md. - Removed obsolete placeholder modules.
- Removed the old external test structure in favor of inline module tests.
- Removed the temporary reference C implementation after development and verification.