Repository navigation
Accumulate stage-1 Hamming hits in registers - #985
Merged
bbuchfink merged 1 commit intoSep 26, 2026
Merged
Conversation
all_vs_all set each query/target result bit with a read-modify-write on the HitField word. Build each query row's hit mask in a 64-bit register and store one word per 64 targets instead. HitField rows are now sized from bit_length(count - 1), so a full 1024-target tile no longer allocates, zeroes and scans twice the words it needs, and hits() only scans the words in use. The sparse kernels still use HitField::set on the zeroed field. Output is byte-identical. On a 1 M read subset at 16 threads the fingerprint compare fell from 222 k to 119 k CPU samples and search wall time from 141.8 s to 131.4 s. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Hey, I wanted to thank you for reviewing these two requests! I'm grateful for this software that you provide to us all and I was happy I was able to contribute. |
Owner
|
Sure no problem, I always appreciate contributions from the community. |
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.
all_vs_all set each query/target result bit with a read-modify-write on the
HitField word, in the innermost loop. It now builds each query row's hit mask
in a 64-bit register and stores one word per 64 targets.
This also changes HitField::init for every stage-1 kernel, not only this one:
rows are now sized from bit_length(max_target - 1) instead of
bit_length(max_target), so a full 1024-target tile no longer allocates, zeroes
and scans twice the words it needs, and hits() scans only the words in use. A
row still holds targets 0..max_target-1. The self, mutual-cover and linearised
kernels keep setting bits one pair at a time on the zeroed field.
Measured on v2.2.7 at 16 threads. On a 1 M-read blastx block, with
byte-identical output, the fingerprint compare fell from 222 k to 119 k CPU
samples and search time from 141.8 s to 131.4 s. On a 734 k-window genome
block, measured with #984 applied, search time fell from 122.4 s to 107.0 s
(-12.6%) with 11.8% fewer instructions and identical alignment counts.
Builds on v2.2.8 (745cd3b) and passes ctest.
An AI assistant (Claude Code Opus 5.0) assisted with this work.