Timestamp ties
Block timestamps and input timestamps are compared as whole Unix seconds.
When several blocks have the exact target timestamp, at_or_after returns the lowest block number, at_or_before returns the highest, and closest returns the lowest.
When the target is equally distant between two different block timestamps, closest returns the lower block number.
A target after the current tip timestamp returns the tip for at_or_before and closest, and tip + 1 for at_or_after. Before a known genesis timestamp, at_or_before returns -1 and the other modes return block 0.