{
  "slug": "deflate",
  "term": "DEFLATE",
  "aliases": [
    "Deflate",
    "raw DEFLATE"
  ],
  "definition": "DEFLATE is a lossless compressed-data format combining length-distance references and Huffman coding, with an additional uncompressed block form.",
  "note": "Compressed blocks use fixed or dynamic Huffman codes; stored blocks carry uncompressed bytes. Match lengths are 3-258 bytes and backward distances are 1-32768 bytes. The distance limit bounds history, not stream length. Only stored blocks have a 65535-byte data limit. [rfc1951]\n\nRaw DEFLATE has no wrapper payload checksum. The zlib format adds Adler-32 and can identify a preset dictionary; gzip adds a member header, CRC32 and uncompressed size modulo 2^32. These formats are not interchangeable decoder inputs. [rfc1950] [rfc1952]\n\nA match can overlap the output it creates. A length 5 at distance 2 after XY appends XYXYX. Decoding therefore needs evolving history, not just a frozen copy of earlier bytes. [rfc1951]\n\nzlib Z_SYNC_FLUSH byte-aligns output but retains history. Z_FULL_FLUSH also resets history for later decoding. Both emit 00 00 ff ff; inflateSync finds only a candidate, not a certified restart. [zlib-restart]\n\nIn synthetic native-zlib controls, the full-flush suffix decoded correctly; the sync-flush suffix failed without history. A literal marker inside stored data even led to Z_STREAM_END with no input left, but yielded DECOY instead of the original payload. Decoder completion alone cannot establish the original boundary. [restart-results]\n\nRapidgzip accepts prefetched chunks by the preceding chunk's actual end offset. Its seek index retains bit offsets, decoded offsets and history windows. Plausible block discovery and validated stream position are separate steps. [rapidgzip]",
  "related": [
    "gzip",
    "compression-dictionary",
    "block-independent-compression",
    "zip-archive",
    "checksum",
    "lossless-compression",
    "huffman-coding",
    "lz77",
    "adler-32"
  ],
  "citations": [
    {
      "id": "rfc1951",
      "title": "RFC 1951: DEFLATE format, sections 2 and 3.2-3.3 (Informational, May 1996)",
      "url": "https://www.rfc-editor.org/rfc/rfc1951.html",
      "accessed": "2026-11-11"
    },
    {
      "id": "rfc1950",
      "title": "RFC 1950: zlib wrapper, dictionary identifier and Adler-32, section 2.2",
      "url": "https://www.rfc-editor.org/rfc/rfc1950.html",
      "accessed": "2026-11-11"
    },
    {
      "id": "rfc1952",
      "title": "RFC 1952: gzip member header and trailer, section 2.3.1",
      "url": "https://www.rfc-editor.org/rfc/rfc1952.html",
      "accessed": "2026-11-11"
    },
    {
      "id": "hesela-archives",
      "title": "Hesela: DEFLATE blocks, history and wrappers",
      "url": "https://hesela.com/analyses/compressed-archives-dictionary-dependencies/#deflate-foundations",
      "accessed": "2026-11-11"
    },
    {
      "id": "zlib-restart",
      "title": "zlib 1.3 API: deflate flush modes and inflateSync candidate search",
      "url": "https://github.com/madler/zlib/blob/v1.3/zlib.h",
      "accessed": "2026-11-30"
    },
    {
      "id": "restart-results",
      "title": "Hesela: native zlib restart controls, results and reproduction instructions",
      "url": "https://hesela.dev/research/deflate-restart/README.md",
      "accessed": "2026-11-30"
    },
    {
      "id": "rapidgzip",
      "title": "Knespel and Brunst: Rapidgzip (HPDC 2023), sections 1.2-1.3 and 3",
      "url": "https://arxiv.org/html/2308.08955v1",
      "accessed": "2026-11-30"
    }
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "Huffman coding is block-local, but references can cross block boundaries; locating a block does not guarantee independent decoding. [rfc1951]",
    "A wrapper checksum can detect corruption only when checked; RFC 1952 permits a compliant gzip decoder to skip its trailer. It does not authenticate the archive. [rfc1950] [rfc1952]"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-30",
  "provenance": [
    "Primary-format synthesis, not a performance benchmark or a historical claim about first implementation. RFC 1951 is Informational.",
    "Restart controls use synthetic raw-DEFLATE inputs and native zlib 1.3, not a Rapidgzip benchmark or a measurement of corruption frequency."
  ]
}
