Skip to content

Releases

v0.2.10

Choose a tag to compare

@Mnwa Mnwa released this 06 Dec 14:35
aaefe7e

Changes

  • New opt-in serde feature (implies framed): framing::serde stores
    serde values and row streams in framed containers, column by column.
    Importing the sealed SerdeCompress and SerdeDecompress traits adds
    compress_value, compress_rows and rows_writer to FramedCompressor
    and decompress_value, decompress_rows and rows_reader to
    FramedDecompressor. Every site of a value (a struct field, a sequence's
    elements, an enum's variant index, an Option's flag) becomes one typed
    input: numbers numeric, strings and bytes string, u128/i128 16-byte
    struct; lengths and variant indices are narrowed per block. Rows are cut
    into blocks of about BlockSize raw bytes (1 MiB by default), one
    self-contained resource each, with a layout descriptor in metadata SD.
    Each resource's frame equals the reference's compress_generic frame of
    the same columns. The descriptor stores the block's schema (field and
    variant names, the kind of every column), so the format describes itself:
    fields are matched by name, a place may change shape between visits (a
    one-byte state column records which shape, or that a field was skipped),
    and deserialize_any reports the stored value. skip_serializing_if,
    #[serde(skip)], added and removed fields, untagged, internally and
    adjacently tagged enums, flatten and serde_json::Value round-trip, and
    numbers convert as serde's visitors allow (widening yes, lossy or
    float/integer reinterpretation no). Maps whose keys are names (strings,
    unit variants, newtypes of them) are stored as records: each distinct key
    gets its own columns, and a key column keeps entry order and repeats; a
    map names at most 256 keys per block and stores the rest as values. On
    100k JSON log lines as serde_json::Value the container is 15.12x smaller
    than the JSON text (8.76x for the text through serial OpenZL; 9.92x with
    keys stored as values). On benches/framed_serde.rs the
    container is 9.51x smaller than 100k structured log rows in a row-major
    layout (5.69x for that layout through serial OpenZL) and 11.50x for 200k
    numeric samples (3.96x). Rows decode at 350-650 MiB/s of row-major size;
    the columns themselves decode at C speed and rebuilding rows dominates.
  • framing::serde::columns, an attribute macro from the new
    mopenzl-macros crate (pulled in by serde), placed above the serde
    derives. #[column(id = N)] stores a named field by number instead of by
    name, like protobuf: the block schema drops the name, a renamed field keeps
    reading earlier rows, and the field also accepts the key "#N", so
    numbered structs read through untagged and internally tagged enums,
    flatten and serde_json::Value. #[column(codec = "graph")] compresses
    the columns of the field's values with the compressor's graph of that name
    (a standard graph, or one registered with GraphParams::with_name); a
    block with such columns is compressed with a router graph that sends each
    marked column to its graph, converting it to serial bytes for serial-only
    graphs, and the other columns together to the compressor's start graph.
    Blocks without codecs are unchanged, the decoder needs no configuration,
    and the C library decodes the routed frames. Other formats see marked
    types unchanged. A codec that cannot be used is the new
    SerdeError::Codec. Field names are now limited to 65534 bytes.
  • #[column] keeps a field's own with or serialize_with in generic types:
    the expansion declares a wrapper next to the item over the parameters the
    field's type mentions and the bounds on them.
  • The workspace shares one version: [workspace.package] holds the version,
    edition, minimum Rust, license and links that mopenzl, mopenzl-macros
    and openzl-ffi inherit (openzl-ffi moves from 0.1.0 to the crate
    version), and [workspace.dependencies] pins mopenzl-macros to the same
    exact version. The release workflow publishes both crates with
    cargo publish --workspace.
  • README, crate documentation and the book introduce the serde feature as a
    compressed serialization format for any Rust type, with examples and the
    measured ratios; serde is a crate keyword.

v0.2.9

Choose a tag to compare

@Mnwa Mnwa released this 06 Dec 10:48
c30bf07

Changes

  • Decompressor::decompress_typed_into decodes a typed or multi-output frame
    into a caller's Vec<TypedOutput>, refilling the outputs of an earlier call
    instead of allocating new ones. An output still takes its stream's buffer
    without a copy; the stream now gets the output's former buffer in exchange,
    so for frames of a steady shape the same buffers alternate between caller
    and decoder. Where the allocator returns large blocks to the system
    (MALLOC_MMAP_THRESHOLD_=1048576), decompress-typed/series decodes 27 MiB
    in 7.9 ms instead of 11.1 ms and 4.5 MiB in 0.91 ms instead of 1.43 ms; with
    glibc's default recycling it is level with decompress_typed on 27 MiB
    (8.27 ms against 8.37 ms) and 2-8% slower on 4.5 MiB, where the
    alternating buffer is less cache-hot than the block glibc just freed.
    decompress_typed is unchanged. The decoder keeps the outputs' former
    buffers between calls, so the caller and the decoder together hold about
    twice the outputs' size, and under RetentionPolicy::Bounded the spares
    count toward the bound.
  • hotpath 0.33.1 for the profiling features, the Criterion benches and
    benchmarks/comparison (which was still on 0.31 and so locked a second
    hotpath beside the library's). 0.33.1 is the floor: hotpath-macros
    0.33.1 calls a builder method that hotpath 0.33.0 lacks.
  • The fuzz targets build with afl 0.19 and CI installs cargo-afl 0.19.0
    (AFL++ 5.03c). Dependabot now leaves afl's minor updates in
    /fuzz/libfuzzer to the same by-hand bump as /fuzz/afl.
  • Cargo.lock takes cookie 0.18.3 (GHSA-8wcq-xq25-7fhm, private cookie
    nonces repeating after fork). It arrives only through hotpath's
    ureq cookie store, which uses no private cookies, so the library was
    not exposed; the bump clears the Dependabot alert.

Fixes

  • The fse_ncount codec reads count headers exactly as the reference's
    FSE_readNCount does near the end of the buffer: its 4-byte window stops
    at the last word and the bit offset wraps, so a header that runs off its
    end re-reads bits of that word instead of failing. Such headers decoded in
    C but were rejected here as CodecStream. ClusterFuzzLite found it
    (decompress, run 46262875131). openzl-ffi gains
    entropy::fse_read_ncount (shim/entropy.c) for the differential test.

v0.2.8

Choose a tag to compare

@Mnwa Mnwa released this 26 Nov 20:02
bff3c40

Changes

  • Reference updated to zstd 1.6.0. openzl-ffi's zstd submodule moves
    from 1.5.7 (the version OpenZL v0.3.0 vendors) to 1.6.0, and mzstd to
    0.2.17, whose encoder is byte-identical to 1.6.0. Frames change where
    1.6.0's do (long distance matching, btopt-and-above dictionaries, block
    splitting), and the zstd codec rejects matches into a Zstandard-format
    dictionary's header and tables, as 1.6.0's ZSTD_DDict does.

Fixes

  • The zstd codec decodes frames declaring a window of exponent 31 with any
    mantissa, up to 3.75 GiB, as the reference's one-shot
    ZSTD_decompress_usingDDict does (mzstd's
    DecodeLimits::with_unbounded_window); 0.2.7 stopped at 2 GiB.

v0.2.7

Choose a tag to compare

@Mnwa Mnwa released this 26 Nov 18:24
898497e
  • The zstd codec decodes frames whose header declares a window above
    128 MiB (up to log 31), as the reference's one-shot
    ZSTD_decompress_usingDDict does; mzstd's default window limit is the
    streaming one, which the reference does not apply here. ClusterFuzzLite
    found it (decompress, run 45623880731).

v0.2.6

Choose a tag to compare

@Mnwa Mnwa released this 21 Nov 14:27
f529d85

Features

  • framing::FramedIndex, FramedDecompressor::framed_index and
    FramedDecompressor::read_indexed_resource give index-based random access
    to a framed container without a reader that borrows the decoder. The index
    owns the validated directory and the container's start position, so a
    caller can keep the decoder, the source and the index in one struct. It
    works with any decoder and any source holding the same bytes at the same
    positions; each read seeks itself and applies the reading decoder's limits.
    framed_seek_reader and FramedSeekReader are now built on these calls,
    with unchanged signatures and behaviour.

Fixes

  • Decompressor::decompress_typed and Decompressor::frame_info accept a
    one-output frame whose inputs token sets the type bits of an absent second
    output, as ZL_FrameInfo and the reference's typed decoder do. Only the
    byte-oriented paths still reject it, as the reference's
    ZL_getDecompressedSize does. ClusterFuzzLite found it
    (decompress_typed, run 44733372399).

v0.2.5

Choose a tag to compare

@Mnwa Mnwa released this 20 Nov 11:57
6a35e9a

Changes

  • Update hotpath to 0.32

Fixes

  • The bitunpack decoder now packs numbers wider than their field the way
    the reference's portable ZS_bitpackEncode kernels do, rather than masking
    them. Only damaged frames hold such numbers. Excess bits of 8- and 16-bit
    numbers spill into the next field, up to 64 one-bit fields of 32-bit
    numbers are summed with carries, other 32-bit fields go through the
    reference's 64-bit accumulator, and byte-aligned fields and 64-bit numbers
    stay masked. The CI fuzz run found it (decompress, run 44731741289).
  • openzl-ffi exposes enc_backends::bitpack_encode, the C
    ZS_bitpackEncode kernel, as a test oracle. It compiles OpenZL's
    common_bitpack_kernel.c through shim/bitpack_kernel.c with __BMI2__
    undefined, so the oracle runs the portable kernels on every host. Built
    with AVX2 and BMI2 (as cargo-afl's -Ctarget-cpu=native does on CI), the
    reference packs out-of-range numbers differently, and the decompress
    regression replay failed on the x86 runner.
  • The decoder now accepts three kinds of frame that the reference decodes
    and it rejected. ClusterFuzzLite found them (decompress,
    decompress_typed, run 43709071038).
    • Decompressor::decompress_typed decodes a frame without chunks to empty
      outputs when every declared size is 0, as
      ZL_DCtx_decompressMultiTBuffer does. It still reports
      InvalidData { EmptyFrame } when the frame ends less than five bytes
      after its inputs token. The byte-oriented decoders still reject every
      frame without chunks, as ZL_DCtx_decompress does.
    • A Zstandard stream may hold several magicless frames, which are decoded
      one after another as ZSTD_decompress_usingDDict does. Bytes after the
      first frame used to be rejected as CodecStream.
    • convert_serial_to_struct and splitn regenerating a chunk output
      concatenate their serial and struct inputs without checking them against
      the codec's signature, as the reference's
      ZL_AppendToOutputOptimization does. Such a frame used to be rejected
      as Graph.
  • The decompress_typed fuzz oracle accepts the reference's
    ZL_Type_unassigned for an empty struct or numeric output that no chunk
    wrote.
  • The C oracle (openzl-ffi) now compiles allocation.c with its 100 MiB
    allocation cap and bounds single and cumulative allocations during
    mzl_decompress and mzl_decode_typed through ZS2_malloc_should_fail, so
    damaged pivco_huffman and sparse_num frames that claim multi-gigabyte
    streams fail in ZL_malloc instead of exhausting memory under
    ClusterFuzzLite (decompress, decompress_typed, run 44520833376).
    Decompressor::decompress_typed also counts four bytes per declared string
    toward DecodeLimits::max_output_bytes.

v0.2.4

Choose a tag to compare

@Mnwa Mnwa released this 13 Nov 20:41
e7fddd7

Fixes

  • GraphBuilder::clustering and clustering_with_codecs no longer panic in
    debug builds, or wrap in release builds, on a ClusteringConfig decoded
    from CBOR whose successor or codec index is usize::MAX. The index is now
    rejected like any other out-of-range codec index. Found by ClusterFuzzLite
    (graph_configs).
  • ClusterFuzzLite now builds the C oracle without the image's
    -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION. With that define, the
    vendored OpenZL skips checksums and caps LZ match lengths at 1024, which
    produced false decompress, decompress_typed and node_roundtrip
    findings. openzl-ffi's build script now refuses to compile with the
    define.

Documentation

  • Reorganize the documentation website and the README for readers, matching
    the mbrotli and mzstd books. The sidebar has six parts in reading order
    (Start here, Graphs and codecs, Guides, Performance and correctness, How it
    works, Contributing) and folds nested chapters: the per-graph benchmark
    pages and the architecture specifications open under their parent.
    architecture/README.md groups its specifications into sections with
    reading paths and shorter scopes, and each section gets a generated landing
    page. The catch-all user guide is split into docs/configuration.md,
    docs/memory.md, docs/decompression.md and docs/streaming.md;
    docs/README.md becomes the API chooser, and output compatibility moves
    into docs/correctness.md. The landing page leads with a round trip, a
    typed-input example and a graph chooser. The theme has its own light and
    dark palette and a dialog that shows a Mermaid diagram at its natural size.
    The README drops from 528 to 387 lines: quick start first, then typed data
    and custom graphs, one API table, and links into the site. Its memory-reuse
    and Read/Write examples move to the memory and streaming guides; its
    dictionary example is dropped in favour of the dictionary guide.
    tests/docs_examples.rs is regenerated for the new pages (31 examples
    before, 30 after). The book build now also checks every README link into the
    published site. Documentation only; the crate is unchanged.

v0.2.3

Choose a tag to compare

@Mnwa Mnwa released this 11 Nov 12:38
9725918

Fixes

  • Create the AFL smoke findings parent directory on clean CI checkouts before
    AFL creates its per-target output directories.
  • Classify the opt-in framed feature in the CI consumer matrix and probe its
    metadata, direction-specific APIs and std transport adapters with framing
    enabled and disabled. Configure the AFL smoke runner before fuzzing so the
    Ubuntu core dump handler does not abort startup; archive findings so AFL's
    colon-containing filenames can be uploaded as artifacts.

Documentation

  • Migrate the complete user guide, architecture, benchmark charts and CSVs to
    mdBook on GitHub Pages, using the mbrotli book's chapter structure and build
    pipeline with mopenzl API recipes. Lead navigation with graphs, codecs and
    typed inputs; add getting-started, Sans I/O, std I/O, resource framing,
    parallel/Rayon, compatibility and publishing guides. Validate source coverage,
    HTML links/anchors and all user-guide Rust programs; update the package homepage.

Added

  • Opt-in framed feature and framing::{FramedCompressor, FramedDecompressor}:
    indexed containers of independent OpenZL frames, a separate graph per resource,
    serial/typed/multiple inputs, validated resource metadata, bounded native
    sessions, resource-oriented std reader/writer adapters with transport retries,
    and whole-resource random access through a checked seek directory. Inner frames
    keep ordinary OpenZL compatibility; the outer container is mopenzl-specific.
    Includes C interoperability tests, AFL/libFuzzer targets and Criterion cases.

v0.2.2

Choose a tag to compare

@Mnwa Mnwa released this 10 Nov 20:58
7acf8e5

Added

  • compressor::parallel::ParallelCompressor with the mbrotli caller-scheduled
    batch, task, source, staging, retention, streaming and I/O interfaces. Parallel
    segments form one OpenZL-compatible frame; reference byte identity is not a
    contract. Streaming retains compressed chunks until finish to announce the
    total input size. Includes C interoperability tests, AFL/libFuzzer coverage
    and Criterion comparisons with the C serial segmenter. List the parallel
    entry points in the crate documentation and README API chooser tables.
  • ParallelCompressor::builder(...).with_graph(...) and
    ParallelCompressorBuilder: serial-style graph/codec selection for every
    worker, source, fallback and streaming adapter. Preserve dictionary metadata
    during one-frame assembly and selected graphs across encoder reconfiguration;
    propagate graph/header failures with typed source errors.

Fixes

  • Reduce the Miri suite to focused SIMD-kernel and uninitialized-output tests
    to avoid CI timeouts. Keep exhaustive scalar codec tests in the native and
    AddressSanitizer suites, and validate exact Miri test names before running.
    Run three PivCo tests using unsupported Neon shifts in x86-64 Miri and
    ARM64 AddressSanitizer instead of ARM64 Miri.
  • Make parallel streaming examples validate round trips without codec features,
    and require size reduction only when Zstandard is enabled. Select enabled
    standard graphs at compile time in the parallel integration test so every
    CI feature configuration passes Clippy.

v0.2.1

Choose a tag to compare

@Mnwa Mnwa released this 10 Nov 12:28
28d1cf4

Added

  • Add hotpath CI profiles for the compressor and Criterion compression and
    decompression cases, merging native timing and allocations with Callgrind
    instruction counts. Pushes upload to hotpath-cloud using OIDC; pull requests
    publish artifacts for a separate relay workflow. Add hotpath-callgrind
    and hotpath-cloud features and a repeatable profile_compressor example.
  • custom-codec (enabled by default): CustomCodec, typed callback inputs,
    validated signatures and encoder/decoder contexts; graph-node registration
    and custom decoder registration by wire ID, including private headers,
    variable ports, parameterization and streaming. Unregistered custom IDs
    continue to return Unsupported. The user guide
    documents registration, supported stream types and feature selection.

Performance work across the codec families, measured on the whole Silesia
corpus against OpenZL v0.3.0 C (-O3). Frames are unchanged: every one of the
123 benchmarked graph/file pairs is byte-identical to C. Figures are medians of
per-file C time / Rust time, before → after
(results).

Performance

  • PivCo-Huffman:
    • Table-driven 16-byte merge and partition kernels, plus AVX-512
      expand/compress kernels.
    • SIMD flat leaves and packing, allocation-free trees.
    • Compress 0.09× → 1.05×, decompress 0.05× → 1.03×.
    • lz decoding, which uses it, went from 0.44× to 1.46×.
  • Huffman and FSE:
    • Huffman decodes through a pair table with sentinel refills, four lanes and
      several symbols per refill. FSE decodes four symbols per refill.
    • The Huffman encoder uses a top-aligned two-container writer like
      HUF_addBits. FSE and the Huffman weights use a 64-bit word writer.
    • Fixed-size tables and 8-byte histogram loads.
    • The four Huffman lanes decode in lockstep over output quarters with a
      stack-resident pair table filled in runs; 16-bit Huffman decodes its four
      blocks in lockstep.
    • FSE decodes through a shift-only loop when no cell reads zero bits, builds
      tables with the reference's fast spread, and encodes with states in
      locals into a fixed-size word buffer.
    • The Huffman encoder looks up scale-8 entry tables and adds codes in groups.
    • The Huffman lane loop looks up all four lanes before storing, writes
      through shrinking per-lane window slices and indexes a pair table of
      2^log cells by the top bits; it executes fewer instructions than C.
    • Huffman: compress 0.40× → 0.94×, decompress 0.20× → 0.78×. FSE: 0.44× →
      0.95×, 0.29× → 0.88×.
  • LZ4:
    • Short- and long-sequence fast paths with chunked copies in the decoder.
    • A const-generic HC chain walk with hoisted candidate reads and 8-byte
      count/count_back.
    • Fixed-size HC tables, an inlined HC match search, and single-compare
      bounds on its reads.
    • The decoder's fast loop checks one 288-byte input and 640-byte output
      window per sequence and keeps long-match copies out of line. Past the
      first 64 KiB of output, sequences run in one fixed-size window where
      every offset is valid, with C's 8+8+2-byte short-match copy.
    • Compress 0.78× → 0.95×, decompress 0.31× → 0.92×.
  • lz and field_lz:
    • 128-byte row-table rows with a fearless_simd tag compare and fused
      candidate scoring.
    • Parsers monomorphized per SIMD level and field width.
    • Chunked match copies in the decoders, and table-driven quantize.
    • The field_lz parse warms the rows it will probe with stores a few
      positions ahead, keeps rows on two cache lines, and fixes the hash length
      at compile time.
    • The field_lz decoder runs four tokens per group, resolves their repeat
      offsets from a 256-entry table (C's AVX2 shuffle, in scalar form) and
      copies short runs as fixed 16-byte blocks; it is at C's instruction count.
    • lz compress 0.49× → 0.83×, decompress 0.44× → 1.46×.
    • field_lz on 4-byte records: compress 0.60× → 0.83×, decompress 0.32× →
      0.76×.
  • bitpack, flatpack, transpose, tokenize, partition:
    • SIMD bit counting and grouped packing in bitpack.
    • 8-per-word packing and table-driven decode in flatpack.
    • A SIMD byte transpose (shared::byte_transpose).
    • Hashed tokenize and specialized gathers.
    • A 64-bit partition bit reader.
    • bitpack compress 0.08× → 1.77×. flatpack 0.73× → 1.47× (compress) and
      1.43× → 1.49× (decompress).
  • Engine:
    • The decoder hands the last regenerated stream to an empty Vec
      destination or TypedOutput instead of copying it.
    • A single typed output is checksummed in place.
    • compress and compress_inputs start their frame Vec at the compression
      bound instead of growing it.
  • Numeric graphs (16/32-bit numbers through the numeric selector): compress
    0.48–0.62× → 0.83–0.94×, decompress 0.27–0.37× → 0.71–0.83×.

Tooling

  • benchmarks/comparison: a harness that runs every standard graph on Silesia
    against C. It has verify, run and profile (callgrind/perf/hotpath)
    commands. report.py renders charts and tables into docs/benchmarks/.
  • openzl-ffi reads OPENZL_FFI_OPT_LEVEL to build the C library at -O3
    for benchmarks (tests keep -O2).
  • The SIMD level is plumbed to every codec: NodeCx::simd for encoders and
    State::simd for decoders.

Fixes

  • lz_common::count's padded fallback path is bounds-safe for runs that end
    past the data.