gap_boundaries
gap_boundaries(
start ,
stop ,
step ,
tolerance: GapTolerance ,
)
Locate the gaps between value-ordered runs.
Each row is a run: its first and last value and its step. Returns (order, reach, has_gap) over the start-ordered rows. reach is the furthest stop seen before each row, so an overlapping or fully nested row can never open a gap behind it, and has_gap marks each row whose start clears that reach by more than the tolerance allows. The first row has nothing behind it and never reports a gap.
Arrays rather than a frame, and an explicit first-row mask rather than shift, whose NaN fill would upcast integer values to float: reach is a reported value, not just a comparand.