The bucketing commit justified itself with "the partials order became total in an earlier commit",
which is true of the scale/merge ingest and not of this sort: part_less ends at the image number,
so two partials of one reflection on one image tie, exactly as they did before.
Nothing is wrong with the result. The counting-sort prefix lays each bucket out chunk by chunk,
and a chunk is a contiguous span of the gathered order, so every bucket arrives at std::sort in
global gather order no matter how many threads scattered it - the order is reproducible run to run
and identical across -N. Giving Partial a rank field to make the comparator total would settle
those ties by index instead, at eight more bytes on an array that reaches tens of millions of
elements, and would change nothing anyone can observe.
So state the invariant where the comparator is, rather than leaving the next reader to trust a
claim that does not hold for this half.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011n8riB6X59oRjkrSHzNPAU