Skip to content

Releases: hustcer/fzip

v0.8.7

Choose a tag to compare

@hustcer hustcer released this 08 Sep 01:24

v0.8.7 - 2026-09-08

Chores

  • Migrate module metadata from moon.mod.json to moon.mod.
  • Update MoonBit syntax to use explicit guard! assertions and StringBuilder() construction.
  • Apply current MoonBit formatting and regenerate package interfaces without changing the public API.

v0.8.6

Choose a tag to compare

@hustcer hustcer released this 15 Jul 05:45

v0.8.6 - 2026-07-15

Fixed

  • Encode and validate Zlib DICTID values in RFC 1950 network byte order, including when footer checksum verification is disabled.
  • Decode concatenated GZIP members with per-member CRC-32 and ISIZE validation, validate FHCRC headers, and enforce stream-wide size limits.
  • Restore the optimized single-member GZIP path and reuse caller-provided output buffers without an intermediate allocation.

Tooling

  • Add interleaved before/after benchmark capture with source-state validation and standardized result artifacts.

Single-member GZIP decompression has approximately 6% fixed overhead for 1 KiB inputs due to concatenated-
member detection and validation. Large-input throughput is unaffected in same-toolchain comparisons.

v0.8.5

Choose a tag to compare

@hustcer hustcer released this 20 Jun 12:59

v0.8.5 - 2026-06-20

Performance

  • Extend CRC-32 from slice-by-8 to slice-by-16 by adding crct8-crct15 lookup tables and processing 16 bytes per iteration, while keeping the existing slice-by-8 and byte-at-a-time tail paths for remaining bytes.
  • Isolated 100K CRC-32 improves from 59.98 us to 55.90 us on native (6.8% faster) and from 72.90 us to 66.11 us on wasm-gc (9.3% faster). The same CRC-backed optimization improves native 100K GZIP decompression from 69.71 us to 65.22 us (6.4% faster).

Changed

  • No public API, checksum value, compressed output, or output-size change; this release only changes the internal CRC-32 implementation and adds eight extra static CRC lookup tables.

v0.8.3

Choose a tag to compare

@hustcer hustcer released this 17 Jun 08:14

v0.8.3 - 2026-06-17

Changed

  • Increase the inflate initial output estimate for 512-2047 byte compressed inputs from 96x to 160x, avoiding a realloc/copy for highly compressible small streams such as the 100K periodic output produced by fzip's two-block encoder. No public API change.

Performance

  • Isolated native 100K periodic raw DEFLATE decompression improves from 15.17 us to 12.91 us (14.9% faster).

v0.8.2

Choose a tag to compare

@hustcer hustcer released this 15 Jun 02:36

v0.8.2 - 2026-06-15

  • Reduce output size for large periodic DEFLATE inputs by splitting the seed and bulk encoding blocks, cutting 100K sequential raw DEFLATE, GZIP, and Zlib output by about 42% with no public API change.

v0.8.1

Choose a tag to compare

@hustcer hustcer released this 12 Jun 08:33

v0.8.1 - 2026-06-12

  • Replace deprecated MoonBit try? usage for moonc v0.10.0

v0.8.0

Choose a tag to compare

@hustcer hustcer released this 20 May 09:57

v0.8.0 - 2026-05-20

Added

  • ZIP64 metadata support for zip_sync, unzip_sync, and unzip_list when archives and entries still fit the current in-memory sync API limits.
  • ZIP writer emission of ZIP64 extra fields, ZIP64 EOCD records, and ZIP64 EOCD locators when classic ZIP fields need sentinel values.
  • zip_sync_checked(files, opts?), a raising variant of zip_sync for recoverable ZIP writer validation errors.
  • UnzipOptions with verify_checksum for callers that want ZIP entry CRC-32 validation during extraction.
  • FzipErrorCode::Zip64ValueTooLarge for ZIP64 values that are valid metadata but cannot be represented safely by the current Int/FixedArray sync APIs.
  • zip64_eocd_signature and zip64_locator_signature; the old zip64_eocd_locator_signature name remains as a deprecated alias.
  • ZIP data-descriptor entry support for the sync reader, using central-directory sizes and CRC-32.

Changed

  • ZIP reading now validates central-directory and local-header bounds before extraction, including EOCD comment length, ZIP64/classic EOCD consistency, extra-field length, local-header signature, and entry data range.
  • ZIP extraction can verify each stored or deflated entry against the central-directory CRC-32 when verify_checksum is enabled, and now caps total sync output and entry fan-out.
  • str_from_u8 now rejects malformed UTF-8 according to RFC 3629 instead of accepting continuation-byte starts, bad continuation bytes, overlong encodings, surrogates, and out-of-range code points.
  • gunzip_sync now validates reserved GZIP flags, FEXTRA bounds, ISIZE range, ISIZE versus max_output_size, and final output length.
  • zip_sync now writes ZIP metadata with fixed-width little-endian helpers and removes user-provided extra fields with header id 0x0001 before emitting its own ZIP64 extra field.

Fixed

  • Fixed ZIP reader integer-overflow risks in central-directory, local-header, compression-ratio, and ZIP32 field handling.
  • Fixed ZIP64 EOCD locator detection and conditional ZIP64 extended-information extra-field parsing.
  • Fixed DEFLATE inflate handling for dictionary-backed LZ77 back-references that were fully satisfied by the dictionary.
  • Fixed malformed dynamic-Huffman handling by rejecting HLIT > 286, HDIST > 30, invalid repeat-16 placement, and code-length repeat overflows.
  • Fixed fixed-output-buffer inflate paths so undersized caller buffers return FzipError instead of writing past capacity.

Tests and docs

  • Added ZIP64 design documentation in docs/zip64.md.
  • Added embedded ZIP64 fixtures produced by Python zipfile and Info-ZIP, with generator scripts under tools/zip64-fixtures/.
  • Added regression tests for ZIP64 parsing/writing, ZIP bounds checks, GZIP header/ISIZE validation, DEFLATE malformed input handling, and strict UTF-8 decoding.

v0.7.0

Choose a tag to compare

@hustcer hustcer released this 16 May 00:01

v0.7.0 - 2026-05-16

Performance

  • Periodic DEFLATE fast path: Detect periodic inputs and emit specialized LZ77 streams. In the feature/bench v0.7.0 benchmark diff, sequential fzip compression improves across raw DEFLATE 7.89 µs -> 4.59 µs (41.83% faster) for 1K and 138.26 µs -> 84.96 µs (38.55% faster) for 100K; GZIP 8.71 µs -> 5.28 µs (39.38% faster) for 1K and 211.66 µs -> 156.19 µs (26.21% faster) for 100K; Zlib 8.36 µs -> 4.95 µs (40.79% faster) for 1K and 177.20 µs -> 124.35 µs (29.83% faster) for 100K.
  • Inflate-friendly large periodic output: Large periodic streams now use fixed-Huffman, non-overlapping matches to avoid the decompression regression from the initial fast path. The same benchmark diff shows 100K fzip decompression improvements for raw DEFLATE 20.70 µs -> 16.22 µs (21.64% faster), GZIP 90.55 µs -> 84.13 µs (7.09% faster), Zlib 59.50 µs -> 55.36 µs (6.96% faster), and auto-detect 88.36 µs -> 83.16 µs (5.89% faster).
  • Compression-size tradeoff: The fixed-Huffman large-periodic path improves runtime while increasing 100K sequential output size from 1127 -> 1263 bytes for raw DEFLATE, 1145 -> 1281 bytes for GZIP, and 1133 -> 1269 bytes for Zlib.

v0.6.3

Choose a tag to compare

@hustcer hustcer released this 13 May 12:38

v0.6.3 - 2026-05-13

Performance

  • RLE fast path for single-byte runs: Detect all-same-byte inputs before LZ77 hashing and emit a dedicated RLE block (dflt_rle_block) that encodes the run as one literal plus repeated length/distance symbols, skipping the full hash-chain scan entirely. Yields a 74.1% compression speedup for single-byte run inputs.

Chores

  • Fix moon check for moon 0.9.2: Updated inflate_wbtest.mbt to resolve type-check errors introduced by changes in moon 0.9.2.

v0.6.2

Choose a tag to compare

@hustcer hustcer released this 11 May 13:35

v0.6.2 - 2026-05-11

Performance

  • Speed up small DEFLATE blocks: For blocks up to 1024 bytes, skip dynamic Huffman tree construction and use the smaller of stored or fixed-Huffman encoding, yielding a 48.1% compression speedup for small fixed-block cases.