Line arbitration merges the identical packets of redundant feed lines (One Quant Book 10, chapter 26) into one stream: each sequence number is processed from whichever line delivers it first and discarded when the other line delivers it again, and a gap is declared only when a later sequence number arrives before any line has delivered the missing ones.
fig_gaps.py (deterministic: the simulator is seeded).