Repository navigation
Releases
Releases · seb3773/lz0
v0.2.0 - Dual-Engine FAST Assembly Decompressors
Lightweight, asymmetric LZ compressor designed around an extremely simple, memory-free (0-alloc) decoder.
Dual-Engine FAST Assembly Decompressors (x86-64 SSE2 & ARM64 NEON)
- x86-64 (
lz0dec_fast_x86_64.s): Reaches 520 – 840 MB/s on text/code and up to 1.33 GB/s on repetitive structured files (e.g.kennedy.xls), with fully inlined subroutines. - ARM64 (
lz0dec_fast_arm64.s): Pure leaf function (0 bytes on stack, pure register execution viax0..x17andv0), delivering a 4× to 7× speedup over standard portable C. - Dual-Engine Architecture (FAST vs. SAFE): 16-byte SIMD vector wildcopies (
movdqu/ldr q/str q) for bulk decompression paired with a sentinel bit-reader tail engine guaranteeing zero out-of-bounds reads/writes. - Segment Window & Branch-Free Elias Decoding: Groups control bits into 64-bit refill windows to eliminate branch mispredictions, decoding Elias Gamma lengths and offsets via direct bit detection (
bsr/clz) and a 256-byte LUT with zero branches.
Choice of Decompression Engines
LZ0 provides 3 complementary decompression engines:
- fast (default on x86-64 & ARM64): Maximum throughput SIMD/vector assembly (~1 GB/s, up to 1.33 GB/s).
- compact: Tiny hand-crafted assembly engine (~300 bytes of code, 0 KB state/LUT, 250–700 MB/s).
- min: Minimal standalone portable C routine (~75 lines, 0-malloc, clean fallback).
CLI Tools
- lz0 / lz0.exe: Complete compressor and decompressor CLI.
- lz0dec / lz0dec.exe: Standalone decompressor CLI designed for verification, engine comparison, and live throughput benchmarks.
Key Highlights
- High Throughput: 10× to 100× faster decompression than adaptive entropy LZ compressors.
- Strict Safety: Zero dynamic allocations (0-malloc), strict bounds checking on reads and writes, crash-proof on malformed inputs (240k+ guard-page tests passed, ASan/UBSan & Valgrind clean).
- Specifications & Documentation: Normative bitstream format (
LZ0_FORMAT.md), decoder procedure (LZ0_DECODER_SPEC.md), encoder details (LZ0_ENCODER.md), and benchmarks (BENCHMARKS.md). - MIT Licensed.
Packages
- Linux x86_64:
lz0-v0.2.0-linux-x86_64.tar.gz - Linux ARM64:
lz0-v0.2.0-linux-arm64.tar.gz - Windows x86_64:
lz0-v0.2.0-windows-x86_64.zip
v0.1.0 - Initial Release
LZ0 v0.1.0 - Initial Release
LZ0 is a lightweight, asymmetric LZ compressor designed around an extremely simple, memory-free (0-alloc) decoder.
What's Included in this Release
lz0/lz0.exe: Complete CLI compressor and decompressor.- Compression:
lz0 c [-1..-9] <input> <output.lz0> - Decompression:
lz0 d <input.lz0> <output>
- Compression:
lz0dec/lz0dec.exe: Standalone ultra-minimal decompressor CLI (powered by hand-crafted assembly on x86-64 & ARM64).- Decompression:
lz0dec <input.lz0> <output>
- Decompression:
- Specifications & Documentation:
docs/LZ0_FORMAT.md: Normative raw bitstream specification.docs/LZ0_DECODER_SPEC.md: Standalone decoder procedure and invariants.docs/LZ0_ENCODER.md: Production H2C8 pipeline details.docs/BENCHMARKS.md: Comprehensive benchmark results.
Key Highlights
- 5 Interoperable Decoders: C library (
lz0_decompress_to), reference C (lz0dec_ref), minimal C (lz0dec_min), hand-crafted x86-64 ASM (lz0dec_x86_64), and hand-crafted AArch64 ASM (lz0dec_arm64). - High Throughput: 250 – 750 MB/s decompression speed on x86-64; 10× to 100× faster decompression than adaptive entropy LZ compressors.
- Strict Safety: Zero dynamic allocations, memory-safe wildcopy transfers, crash-proof on malformed or truncated inputs.
- MIT Licensed.
Packages
- Linux x86_64:
lz0-v0.1.0-linux-x86_64.tar.gz - Linux ARM64 (AArch64):
lz0-v0.1.0-linux-arm64.tar.gz - Windows x86_64:
lz0-v0.1.0-windows-x86_64.zip