{
  "aliases": [
    "Sequence-space arithmetic"
  ],
  "status": "unknown",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-18",
  "slug": "serial-number-arithmetic",
  "term": "Serial number arithmetic",
  "definition": "Serial number arithmetic compares finite wrapping counters within a bounded sequence space.",
  "note": "For a b-bit counter, differences are taken modulo 2^b and ordering at exactly half the space is undefined. A difference below half the space identifies a forward direction, not how much unobserved history elapsed. [c1]\n\nPairwise comparisons do not provide an unrestricted sort order. In an 8-bit space, 0 precedes 100, 100 precedes 200, and 200 precedes 0. A shared unwrapped interval with span below half the space avoids this cycle. [c3]\n\nJBD2 compares transaction IDs using signed differences. Interpreting such counters requires the journal identity and lifetime bounds as well as their numeric values. [c2]",
  "related": [
    "transaction-id-wraparound",
    "lost-write",
    "write-ahead-log",
    "incarnation-identifier"
  ],
  "citations": [
    {
      "id": "c1",
      "title": "Elz and Bush. RFC 1982: Serial Number Arithmetic, sections 3-5 (1996)",
      "url": "https://www.rfc-editor.org/rfc/rfc1982.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "c2",
      "title": "Linux v6.16 include/linux/jbd2.h: tid_gt and tid_geq",
      "url": "https://github.com/torvalds/linux/blob/v6.16/include/linux/jbd2.h#L1598-L1611",
      "accessed": "2026-10-18"
    },
    {
      "id": "c3",
      "title": "Hesela: ordering storage generations across counter wrap",
      "url": "https://hesela.com/analyses/storage-generation-counter-wraparound/",
      "accessed": "2026-10-18"
    }
  ],
  "provenance": [
    "RFC 1982 specifies DNS serial arithmetic, not a storage format. [c1]",
    "The linked enumeration is an exact teaching example, not a device failure-rate measurement or a recovery implementation. [c3]"
  ]
}
