{
  "status": "shipping",
  "advantages": [],
  "limitations": [
    "On python-zstandard 0.24.0/0.25.0, max_output_size did not cap known-size output; C-extension strict suffix handling depended on buffer slack, unlike CFFI. [python-zstd-c] [python-zstd-cffi] [python-zstd-evidence]",
    "Both tested one-shot backends returned empty bytes for damaged or header-only empty-frame inputs; incremental controls distinguished error from incomplete EOF. [python-zstd-evidence]",
    "Incremental output can be allocated before a caller checks its size; changing APIs does not establish a production memory limit. [python-zstd-cffi]"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-29",
  "slug": "zstandard",
  "term": "Zstandard",
  "aliases": [
    "zstd"
  ],
  "definition": "Zstandard is a lossless compression format and codec that stores data in frames with optional external dictionaries and content checksums.",
  "note": "Concatenated frames decode to concatenated output. A valid remaining frame does not prove that an intended later frame is still present. [rfc8878] [hesela-zstd]\n\nSeekable Zstandard adds a seek table in a final skippable frame, allowing a range to be located without decoding the entire preceding stream. Ordinary Zstandard framing does not itself provide that index. [seekable-format]\n\nThe measured CLI experiment distinguishes a checksum stored in a frame from read-time verification: explicitly ignoring the checksum accepted wrong dictionary-derived bytes. Its payload oracle also accepted changed skippable metadata because those bytes were not part of decoded output. [hesela-zstd]\n\nA frame dictionary ID can reject a differently labeled dictionary without a content checksum. Conversely, matching IDs did not detect a controlled dictionary-content mutation in Hesela's formatted-dictionary experiment; the verified content checksum caught that particular mismatch. [hesela-zstd]\n\nThe v1.5.7 reference seekable reader returned byte 65 for offset 64 after indexed lengths changed from 64/64 to 63/65. It also returned all 192 expected bytes without exposing a bad final checksum. [seekable-evidence]\n\nThe range loop can stop before frame completion triggers checksum verification; the frame wrapper uses the same routine. Validate physical frames, index geometry and intended generation separately. Keep the source unmodified for the reader lifetime. [seekable-decoder] [seekable-api]\n\nIn twelve synthetic runs, pipefail reported decoder failure but did not undo the consumer's writes; whole-frame removal still exited zero. Staging gated on decoder status and full expected bytes preserved rejected destinations: not a crash-durability guarantee. [hesela-output-publication] [zstd-stream-api]",
  "related": [
    "compression-dictionary",
    "checksum",
    "backup-verification",
    "transparent-compression",
    "skippable-frame",
    "zstandard-dictionary-id",
    "decompression-bomb",
    "zstd-window-size",
    "lossless-compression",
    "asymmetric-numeral-systems",
    "finite-state-entropy",
    "lz77"
  ],
  "citations": [
    {
      "id": "python-zstd-c",
      "title": "python-zstandard 0.25.0 pinned C extension: Decompressor_decompress allocation, resize and empty-frame branches",
      "url": "https://github.com/indygreg/python-zstandard/blob/7a77a7510b8ce068e4a103d29aea1b5ec829d8b6/c-ext/decompressor.c",
      "accessed": "2026-11-29"
    },
    {
      "id": "python-zstd-cffi",
      "title": "python-zstandard 0.25.0 pinned CFFI backend: ZstdDecompressor.decompress",
      "url": "https://github.com/indygreg/python-zstandard/blob/7a77a7510b8ce068e4a103d29aea1b5ec829d8b6/zstandard/backend_cffi.py",
      "accessed": "2026-11-29"
    },
    {
      "id": "python-zstd-evidence",
      "title": "Hesela: 192 bounded Python Zstandard API observations, generated table and pinned source hashes",
      "url": "https://hesela.dev/research/zstd-api-contract/summary.json",
      "accessed": "2026-11-29"
    },
    {
      "id": "rfc8878",
      "title": "RFC 8878: Zstandard Compression, sections 3.1, 3.1.1.1.3 and 5",
      "url": "https://www.rfc-editor.org/rfc/rfc8878.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "seekable-format",
      "title": "Zstandard seekable format 0.1.0, pinned to v1.5.7",
      "url": "https://raw.githubusercontent.com/facebook/zstd/v1.5.7/contrib/seekable_format/zstd_seekable_compression_format.md",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-zstd",
      "title": "Hesela: Compressed archives, dictionary dependencies and validation coverage",
      "url": "https://hesela.com/analyses/compressed-archives-dictionary-dependencies/",
      "accessed": "2026-10-17"
    },
    {
      "id": "seekable-decoder",
      "title": "Zstandard v1.5.7 reference seekable decoder: range completion and checksum checks",
      "url": "https://raw.githubusercontent.com/facebook/zstd/v1.5.7/contrib/seekable_format/zstdseek_decompress.c",
      "accessed": "2026-10-23"
    },
    {
      "id": "seekable-api",
      "title": "Zstandard v1.5.7 seekable API: read semantics and source lifetime",
      "url": "https://raw.githubusercontent.com/facebook/zstd/v1.5.7/contrib/seekable_format/zstd_seekable.h",
      "accessed": "2026-10-23"
    },
    {
      "id": "seekable-evidence",
      "title": "Hesela: native seekable-decoder observations, source fingerprints and reproduction",
      "url": "https://hesela.dev/research/zstd-seek-table/PUBLICATION.md",
      "accessed": "2026-10-23"
    },
    {
      "id": "zstd-stream-api",
      "title": "Zstandard v1.5.5 API: streaming decompression completion and output",
      "url": "https://raw.githubusercontent.com/facebook/zstd/v1.5.5/lib/zstd.h",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-output-publication",
      "title": "Hesela: twelve synthetic decoder-output and publication observations",
      "url": "https://hesela.dev/research/zstd-output-publication.json",
      "accessed": "2026-10-17"
    },
    {
      "id": "osdi14-persistence",
      "title": "Pillai et al.: All File Systems Are Not Created Equal, OSDI 2014, sections 2.2, 3.2-3.6 and 4.4",
      "url": "https://files.usenix.org/s3fs-public/cdn/osdi14-paper-pillai.pdf",
      "accessed": "2026-11-02"
    }
  ],
  "provenance": [
    "192 small native calls on two pinned package versions, both using libzstd 1.5.7; twelve synthetic fixtures and separate-session same-host replay. No external peer replication, measured memory consumption or claim about other wrappers. [python-zstd-evidence]",
    "Format facts follow RFC 8878 and the seekable extension. The linked experiment measures CLI 1.5.5 behavior on synthetic data, not a compression benchmark.",
    "The seekable study retains 30 synthetic fixtures, 480 isolated actions per capture and 119 C controls per configuration on one host. Its two linked cores use one reference decoder; publication summarizes existing captures, not a new native replay. [seekable-evidence]",
    "Atomic replacement during normal execution is separate from persistence after a crash. ALICE's historical study analyzes ordering, atomicity and durability assumptions; the linked staging experiment does not reproduce that crash testing. [osdi14-persistence]"
  ]
}
