Skip to content

Fix multi-level merges in vg gamsort - #5023

Merged
jltsiren merged 1 commit into
masterfrom
fix-gamsort
Aug 27, 2026
Merged

Fix multi-level merges in vg gamsort#5023
jltsiren merged 1 commit into
masterfrom
fix-gamsort

Conversation

@jltsiren

Copy link
Copy Markdown
Contributor

Changelog Entry

To be copied to the draft changelog by merger:

  • vg gamsort no longer crashes with very large GAM files.

Description

vg gamsort tries to do up to 2048-way merges if possible. If the GAM file is very large (more than ~1 TiB of uncompressed data / ~200 GiB of compressed data / ~60x coverage of human short reads), there will be more than 2048 temporary files after the initial sort. vg gamsort has to do intermediate merges with such inputs, but that code path has always been broken. This PR fixes the issue by opening ranges of input files (rather than output files) for the intermediate merges.

Fixes #5022.

Also fixes the progress bars in vg gamsort.

@jltsiren
jltsiren merged commit 634aa47 into master Aug 27, 2026
2 checks passed
@jltsiren
jltsiren deleted the fix-gamsort branch August 27, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vg gamsort segfaults in StreamSorter::streaming_merge on a 238GB GAM

2 participants