Repository navigation
p7_omx_GrowTo_avx: count 8 floats per vector in the size checks - #34
Merged
GenevieveKrause merged 1 commit intoOct 2, 2026
Merged
Conversation
The "already big enough" test and the "must widen" test in p7_omx_GrowTo_avx() and p7_omx_GrowTo_dpf_avx() compared the model length to allocQ4_avx * 4, the SSE vector width. An AVX stripe holds 8 floats, so the early return never fired for M > 8 and every call re-laid the row pointers. Results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A small one I noticed while reading the DP matrix code. It doesn't change results, and I couldn't measure a speed difference, so there's no urgency here.
p7_omx_GrowTo_avx()andp7_omx_GrowTo_dpf_avx()decide whether a matrix is already wide enough by comparing the model length toallocQ4_avx * 4:That
4is the SSE vector width; an AVX stripe holds 8 floats. For M = 300,p7O_NQF_AVX(300)is 38 stripes, which hold 304 positions, but the check computes 38 × 4 = 152 and concludes the matrix is too narrow. So for any model longer than 8 the early return never fires, and every call lays out all the row pointers again.Nothing goes wrong because of it: the reset path is correct, and the DP routines' own guards already use 8 (
om->M > ox->allocQ4_avx*8infwdback_avx.candfwdback_fs_avx.c). This PR just changes the four* 4to* 8so the grow functions agree with them. Thencellsbookkeeping is left alone; it uses the same unit on both sides of its comparison.What I checked, with and without the change, on an AVX2 machine:
--fsand--splicemodes (23 models against 14 Mb), and in default and--fson a larger search (200 models against a 352 Mb genome).🤖 Generated with Claude Code