Serial number arithmetic
Serial number arithmetic compares finite wrapping counters within a bounded sequence space.
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. [1]
Pairwise 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. [3]
JBD2 compares transaction IDs using signed differences. Interpreting such counters requires the journal identity and lifetime bounds as well as their numeric values. [2]