Skip to content

v0.2.0 release

Choose a tag to compare

@homer6 homer6 released this 18 Feb 03:42
· 68 commits to main since this release

automerge-cpp v0.2.0

This release marks the completion of Phase 8, introducing a new columnar binary format that is compatible with the upstream Rust Automerge implementation. It includes significant upgrades to storage efficiency, integrity validation, and architectural performance.


Core Storage Upgrades

  • Columnar Binary Format: Replaced the previous row-based binary format (v1) with an upstream-compatible columnar encoding. This reorganization groups similar data types together, significantly improving compression ratios and read performance.
  • Raw DEFLATE Compression: Integrated raw DEFLATE compression (no zlib/gzip headers, windowBits=-15) for individual columns. Compression is automatically applied to any column exceeding a 256-byte threshold to minimize the document footprint.
  • SHA-256 Integrity Validation: Implemented a new chunk-based envelope system. Each data chunk is now prefixed with a SHA-256 checksum, ensuring the integrity of the document during storage and transmission.
  • Backward Compatibility: Added automatic format detection to Document::load(). The library can now seamlessly detect and load legacy v1 (row-based) documents, migrating them to the modern format during the next save operation.

New Codecs and Primitives

  • RLE (Run-Length Encoding): Added high-performance encoders and decoders for runs of identical values, literal sequences, and null runs.
  • Delta Encoding: Implemented delta encoders to efficiently store monotonic sequences and consecutive differences.
  • Boolean Codec: Added an alternating run-length encoder specifically optimized for boolean sequences.
  • SHA-256 Primitive: Integrated a FIPS 180-4 compliant SHA-256 implementation for change hashing and chunk verification.

CI and Platform Support

  • Platform Specific Fixes: Optimized the FreeBSD CI pipeline by utilizing the system-provided zlib instead of attempting a redundant package installation.
  • Windows Builds: Updated Windows CI to utilize vcpkg for zlib dependency management.
  • Development Rules: Added a strict requirement to the development workflow (CLAUDE.md) ensuring all tests pass before any commit.

Architecture and Refinement

  • Value Metadata Optimization: Refined the internal ULEB128 encoding of value metadata to properly support arbitrary value sizes by placing type tags in the low 4 bits and byte lengths in the upper bits.
  • Heads Recomputation: Fixed a bug in legacy format migration where concurrent heads from merged documents were not properly preserved during SHA-256 recomputation.
  • Actor Lookup: Added robust assertions for actor indexing during serialization to prevent document corruption.

Project Statistics

  • Test Coverage: Expanded the test suite to 274 passing tests across 13 test files, including exhaustive round-trip validation for all new columnar codecs and op types.
  • Build Requirements: CMake 3.28+ and zlib are now required for building the library.