Skip to content

v0.3.0 - RISC-V 64 Support & Advanced Ratio Optimizations

Choose a tag to compare

@seb3773 seb3773 released this 20 Nov 20:49
· 55 commits to main since this release

Lightweight, asymmetric LZ compressor designed around an extremely simple, memory-free (0-alloc) decoder.

About LZ0

LZ0 is an asymmetric lossless compression format that deliberately shifts complexity from the decompressor to the compressor. The encoder uses a sophisticated pipeline (Hash3 chain + O(N) SA-IS suffix array + sparse dynamic programming parser) to produce a dense stream that can be decompressed at hundreds of megabytes per second by an ultra-compact routine requiring 0 bytes of dynamic memory (malloc).


What's New in v0.3.0

1. Native RISC-V 64-bit (RV64GC) Hand-Crafted Assembly Decoders

  • Two new native assembly decoders:
    • lz0dec_riscv64.s (Compact, ~1.1 KiB): Pure leaf function (0-stack frame, 0 function calls), executing 100% within caller-saved registers a0..a7 and t0..t6.
    • lz0dec_fast_riscv64.s (FAST, ~1.3 KiB): 16-byte unrolled wildcopy loops (2x ld / 2x sd), 32-byte broadcast fills (4x sd), and predictive branch layout for short literals and length-1 matches.
  • Arithmetic broadcast: Run expansion for offset == 1 via 64-bit arithmetic multiplication (mul by 0x0101010101010101).
  • High throughput: 4× to 6× faster decompression (+340% to +490%) compared to compiled C.
  • New Linux RISC-V release package: lz0-v0.3.0-linux-riscv64.tar.gz with a standalone static decompressor binary of only 42 KiB.

2. Advanced Compression Ratio Optimizations

  • MRU Cache Bridge Matching: Seamless match-offset continuity across disparate file boundaries in multi-resource concatenated blobs.
  • Structured Container Detection: Heuristic detection for TAR archives (512-byte block alignment) and SQLite database files (page size detection from 512b to 64 KiB).
  • Extended Large Strides (2048 to 8192 bytes): Autocorrelation window extended to capture large columnar datasets, high-resolution textures, and structured binary dumps.
  • Zero Ratio Regressions: Net gain of > 4.1 KB saved across standard corpus and multi-file blobs with 100% bit-exact validation.

3. Cross-Platform Hardening & Verification

  • All test suites (golden test vectors, boundary limits, malformed stream rejection, ASan/UBSan, Valgrind, and fuzzing) validated 100% clean and bit-identical across x86-64, ARM64 (AArch64), and RISC-V 64.

Release Packages

  • Linux x86_64: lz0-v0.3.0-linux-x86_64.tar.gz
  • Linux ARM64: lz0-v0.3.0-linux-arm64.tar.gz
  • Linux RISC-V 64: lz0-v0.3.0-linux-riscv64.tar.gz
  • Windows x86_64: lz0-v0.3.0-windows-x86_64.zip