AyCode.Core/AyCode.Core/Compression
Loretta 17daf0fef2 Document AcBinary wire format, sync docs, update conventions
- Add BINARY_FORMAT.md: full AcBinary wire format spec (markers, encoding, options, protocol, interactions)
- Reference BINARY_FORMAT.md from GLOSSARY.md, Binaries/README.md, and Serializers/Binaries/README.md; add new glossary terms
- Clarify and expand config options tables to match new doc
- Add/clarify LLM maintenance rules: always sync .md files with code, auto-fix discrepancies
- Update root README.md: AyCode.Core targets .NET 9, not 10; stress doc/code sync
- Add code reuse and doc sync conventions to copilot-instructions.md and CONVENTIONS.md
- Add docs/ folder and BINARY_FORMAT.md to solution as Solution Items
- Minor clarifications and cross-links in ARCHITECTURE.md and other docs
2026-03-29 09:11:57 +02:00
..
BrotliHelper.cs Add Toon serializer: LLM-optimized format & rich metadata 2026-01-10 20:13:54 +01:00
GzipHelper.cs Refactor serializer tests, fix deserializer bugs, add Gzip 2025-12-19 19:29:12 +01:00
Lz4.cs Add pure managed LZ4 compression to serializers 2026-02-04 14:36:16 +01:00
Lz4CompressionMode.cs Add pure managed LZ4 compression to serializers 2026-02-04 14:36:16 +01:00
Lz4Compressor.cs Add pure managed LZ4 compression to serializers 2026-02-04 14:36:16 +01:00
Lz4Decompressor.cs Add pure managed LZ4 compression to serializers 2026-02-04 14:36:16 +01:00
README.md Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00

README.md

Compression

Three compression algorithms with a unified static API. All implementations use ArrayPool<byte> and stackalloc for minimal GC pressure.

Key Files

  • BrotliHelper.cs — Brotli compress/decompress. Stack-allocates for small inputs, pools for large. IsBrotliCompressed() detection.
  • GzipHelper.cs — GZip compress/decompress. Same API shape as BrotliHelper. IsGzipCompressed() checks magic bytes (0x1F, 0x8B).
  • Lz4.cs — High-level LZ4 facade. Dispatches to Block or BlockArray mode via Lz4CompressionMode.
  • Lz4Compressor.cs — Pure managed LZ4 block compressor. Hash table pattern matching (4K entries, 12-bit hash), MinMatch=4. WASM-compatible (no native dependencies).
  • Lz4Decompressor.cs — LZ4 block/BlockArray decompressor. Handles overlapping copies for match references.
  • Lz4CompressionMode.cs — Enum: None, Block (single), BlockArray (64KB chunked).

LZ4 Modes

Mode Use Case
Block Single contiguous block with 4-byte size header
BlockArray Chunked (64KB default) for streaming/large data

Dependencies

  • System.IO.Compression (Brotli, GZip)
  • System.Buffers (ArrayPool)