Repository navigation
Cut per-step overhead on narrow banded ends-free alignments - #59
Merged
Merged
Conversation
Each step widens its inputs' initialized range by a diagonal or two, and slice::fill lowered that to a memset_pattern16 call whose setup cost far more than the stores. Fills of up to 8 offsets now use volatile stores, so LLVM doesn't turn the loop back into the call. On narrow banded ends-free alignments (dada2-like) this is 7-14% faster; output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apply_heuristic_cutoff ran its general path every step. For banded-static with the wavefront already inside the band (compute clamps to it; only begin-free seeding reaches past it) the cutoff changes nothing and doesn't use steps_wait, so return straight away. A few percent on narrow banded alignments; output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
16 of 22 tasks
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.
Part of #31, prompted by HPCBio/dada2-rs#51's finding that begin-free gaps make each ends-free alignment about 3× slower. Details are in the #31 comment and PERFORMANCE_LOG.
Findings
|match|per diagonal from the end diagonal, against 18 per difference, so the seeded diagonals can't be ruled out until the search is nearly done. Not included here.Changes (separate commits)
494602c:init_endsfills of up to 8 offsets use volatile stores instead ofslice::fill.filllowered to amemset_pattern16call per input per step, whose setup cost far more than the one or two stores.9034dc5:apply_heuristic_cutoffreturns at once for banded-static when the wavefront is inside the band. Compute already clamps to the band; only begin-free seeding reaches past it. That path doesn't usesteps_wait, so skipping it changes nothing.704a5e4: PERFORMANCE_LOG and PROGRESS notes.Results
M2, median of 5, in ms,
main(bef359a) → this PR. Output identical in every case.This is 9–16% faster on dada2-like alignments. The utest and long gap-affine controls are at 0.99× and 0.96×. The 3× from begin-free remains: it's the step count of an exact WFA with seeded diagonals.
Validation
🤖 Generated with Claude Code, with edits by @cjfields