bcftools
bcftools copied to clipboard
Feature request: make `sort` reproducible
Discussed in https://github.com/samtools/bcftools/discussions/1926
Originally posted by jrm5100 May 19, 2023 The cmp_bcf_pos function looks at:
- id
- pos
- alleles
However, if all of these match the records are considered equivalent and qsort
is unstable. Theoretically it would be possible to track the original index of the records as they are read and use that as a final tiebreaker.
Is this something that would be worthwhile? This isn't entirely theoretical- I ran into it but I could accept that it shouldn't matter how those records are sorted.