{
  "slug": "comma-free-code",
  "term": "Comma-free code",
  "aliases": [
    "Comma-free dictionary",
    "Self-synchronizing block code"
  ],
  "definition": "A comma-free code uses equal-length words so that no shifted word-length window across two codewords is itself a codeword.",
  "note": "Alignment: The condition includes two identical words. In an uncorrupted concatenation, finding a complete codeword identifies a boundary without a delimiter. This is the fixed-length convention, not a synonym for every prefix code. [golomb1958]\n\nExample: The binary dictionary {001, 011} has eight shifted windows across its four ordered word pairs, none valid. With enough valid continuation, a scanner starting anywhere needs at most five observed bits to include a complete word. The suffix 01 alone is too short. [example]\n\nIntegrity: Changing 001 to 011 by one bit preserves codeword validity. Both words can also lose one bit and yield 01, so this dictionary cannot correct every single deletion even with the original width known. Synchronization and correction are separate requirements. [example]\n\nDistinctions: The complete two-bit prefix code parses an alternating stream as 01 or, one bit later, 10 indefinitely. Conversely, {001, 011} is comma-free but not cross-bifix-free: suffix 01 of 001 equals prefix 01 of 011. The latter condition forbids every proper prefix/suffix overlap. [example] [blackburn2015]\n\nStorage: SATA uses K28.5 in ALIGN for alignment, not arbitrary valid 8b/10b words. Repeated D10.2 words also produce valid shifted words. During speed negotiation, the specification recommends checking whole ALIGN primitives, not just their comma. [sata35] [example]",
  "related": [
    "huffman-coding",
    "tunstall-coding",
    "varshamov-tenengolts-code",
    "sata"
  ],
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "The example carries one source bit in three stored bits before framing or outer protection; it is neither a compressor nor a noisy-channel recovery guarantee.",
      "citationIds": [
        "example"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "citations": [
    {
      "id": "golomb1958",
      "title": "Golomb, Gordon and Welch: Comma-Free Codes, Canadian Journal of Mathematics 10 (1958), 202-209, section 1",
      "url": "https://doi.org/10.4153/CJM-1958-023-9",
      "accessed": "2026-11-18"
    },
    {
      "id": "blackburn2015",
      "title": "Simon R. Blackburn: Non-overlapping codes, arXiv:1303.1026v3 (2015), introduction",
      "url": "https://arxiv.org/abs/1303.1026v3",
      "accessed": "2026-11-18"
    },
    {
      "id": "example",
      "title": "Hesela: exhaustive small comma-free dictionaries, phase recovery and error counterexamples",
      "url": "https://hesela.dev/research/comma-free-codes/README.md",
      "accessed": "2026-11-18"
    },
    {
      "id": "sata35",
      "title": "SATA-IO: Serial ATA Revision 3.5 Gold (2020), sections 4.1.1.11, 4.1.1.16-17, 8.4.4.1 and 9.3.3.5",
      "url": "https://sata-io.org/system/files/specifications/SerialATA_Revision_3_5_Gold.pdf",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "Primary-source synthesis and exact finite enumeration of 65,808 nonempty binary dictionaries, not a media experiment or a new general theorem.",
    "Status research describes the storage-coding context; the mathematical definition is established. The construction does not identify a deployed storage format."
  ]
}
