COOLJAPAN
← All posts

OxiArc 0.4.0 Released — The Decoder Stops Writing Every Byte Twice

OxiArc 0.4.0 rewrites the DEFLATE/zlib decode path for throughput: a two-level Huffman table, a register-resident BitCache, and an output-buffer-as-history design that stops writing every decoded byte twice. New zero-copy inflate_into/zlib_decompress_into APIs, no wire-format change. 2,468 tests passing, Pure Rust.

release oxiarc deflate zlib performance compression pure-rust archiving

The fastest way to decode a byte is to write it exactly once.

Today we released OxiArc 0.4.0 — a DEFLATE/zlib decoder performance rewrite. No archive or stream wire format changed, no public API was removed, and no other codec crate in the workspace was touched: existing callers of inflate, Inflater::new, and zlib_decompress get the same bytes back, just faster.

No C, no Fortran, no zlib, no libarchive, no external shared libraries. Just clean, memory-safe archiving and compression that compiles to a single static binary, targets WASM, and runs everywhere. OxiArc is the Pure Rust replacement for the zip, tar, gzip, zstd, and 7-zip tools — and for the Rust crates zip, flate2, zstd, bzip2, lz4, tar, snap, brotli, and miniz_oxide.

Why OxiArc 0.4.0 is a game changer

The old inflate path was correct — 0.3.6’s 75-item interop campaign had already proven that byte-for-byte against the reference implementation — but it left real throughput on the table:

OxiArc 0.4.0 ends all of that:

Technical Deep Dive: the inflate stack, layer by layer

  1. Bulk bit supply. BitReader::buffered(with_buffer_capacity) prefetches via 64-bit LE loads; BitCache keeps the accumulator register-resident across a decode loop instead of round-tripping it through memory per symbol.
  2. Two-level symbol decode. A 10-bit root Huffman table with sub-tables for longer codes, replacing the old flat 9-bit table — the same shape zlib and libdeflate converged on for a reason.
  3. Single-write history. InflateWindow treats the growing output Vec itself as the LZ77 back-reference window (Vec::extend_from_within), so a match copy is one write, not two.
  4. Zero-copy entry points. inflate_into(src, dst) and zlib::zlib_decompress_into decode straight into a caller-owned buffer — no intermediate Vec, no output-size guessing, and BufferTooSmall instead of silent truncation if the stream would overflow dst.

Every layer is covered by a new differential suite (oxiarc-deflate/tests/inflate_differential.rs) that proves the buffered fast path, the exact-mode path, and the _into APIs all agree byte-for-byte — across stored/fixed/dynamic blocks, maximum-distance (32 KiB) back-references, and hostile/truncated/corrupted input — plus an optional CPython zlib oracle comparison behind the pre-existing zlib-oracle feature, and a new fuzz_inflate_into target cross-checking the growable-Vec and slice-sink decode paths.

Getting Started

cargo add [email protected]
use oxiarc_deflate::{deflate, inflate_into};

let original = b"Hello, World! Hello, World!";
let compressed = deflate(original, 6)?;

// Decompress directly into a caller-supplied buffer -- no intermediate Vec,
// no output-size guessing. A stream that would overflow `out` returns
// BufferTooSmall instead of truncating silently.
let mut out = vec![0u8; original.len()];
let n = inflate_into(&compressed, &mut out)?;
assert_eq!(&out[..n], original);

zlib::zlib_decompress_into is the zlib-wrapped equivalent, additionally verifying the trailing Adler-32 checksum.

What’s New in 0.4.0

Only oxiarc-core and oxiarc-deflate changed source this cycle — the other 11 crates are unchanged from 0.3.6.

Tips

This is the foundation

A faster, still byte-identical DEFLATE/zlib decoder benefits everything downstream that reads gzip, zlib streams, or ZIP archives without changing a single call site. NumRS2, SciRS2, ToRSh, RusMES, FVRS, TrustFormers, SkLearS, OxiGeo, and OxiMedia all pin oxiarc-* crates for archive and compression I/O — none of them need a code change to pick up this release’s throughput, only a version bump.

Repository: https://github.com/cool-japan/oxiarc

Star the repo if you want a decoder that got faster without asking you to touch a single call site.

The era of decoding every byte twice is over. Pure Rust archiving that’s fast, safe, and sovereign — is here.

KitaSan at COOLJAPAN OÜ July 30, 2026

↑ Back to all posts