Densest sliding window over entries pre-sorted by started_offset_ms.
Returns (count, left_idx, right_idx) (inclusive) of the most populous
window no wider than window_ms. Returns (0, 0, 0) for an empty slice.
Group entries by duplicate fingerprint. Each group’s entries are sorted by
(started_offset_ms, index). Groups are returned sorted by descending size,
then fingerprint, for determinism.