Repository navigation
get_snarl_tree_records(): number root components across all temporary indexes - #246
Merged
Merged
Conversation
… indexes With more than one temporary index, root components of later indexes reused root-record slots and connected component ranks starting from 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamnovak
approved these changes
Oct 16, 2026
adamnovak
left a comment
Member
There was a problem hiding this comment.
This looks like it should work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SnarlDistanceIndex::get_snarl_tree_records()accepts several temporary indexes, one per connected component. Each temporary index numbers its root components from 0, and the function passed that per-index number directly toRootRecordWriter::add_component()andset_rank_in_parent(). With more than one temporary index:This keeps a running
component_offsetacross the temporary indexes, so each root component gets a distinct slot and number. With a single temporary index, which every current caller passes, the offset is 0 and the output is unchanged.vg uses this to build the distance index one connected component at a time, in parallel (vgteam/vg PR: VG_PR_LINK):
.distof an HG002-sampled HPRC whole-genome graph (73 components) goes from 30m27s to 4m01s;Checked against the serial build: same snarl tree, a one-to-one mapping of component numbers, and identical
minimum_distance()on 2M random position pairs.