Use flat arrays in p7_Builder_MaxLength - #23
Open
kevinmoran1988 wants to merge 1 commit into
Open
kevinmoran1988 wants to merge 1 commit into
kevinmoran1988 wants to merge 1 commit into
Conversation
Replace per-state 2-element row allocations with flat columns, widen transitions to double once, and carry the current column's M[k-1] and D[k-1] in locals. Same operations in the same order. 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.
p7_Builder_MaxLength() kept its two DP columns as 3(M+1) separately allocated 2-element rows, and re-read hmm->t[k] and recomputed (1 - t) inside the inner loop. This uses flat columns, widens the transitions to double once, and carries the current column's M[k-1] and D[k-1] in locals so the D recurrence no longer goes through memory. The operations and their order are unchanged, so max_length is identical.
bathbuild over 5232 dipteraODB12 alignments, serial, 3 runs each, in seconds:
base 230.97 / 232.23 / 229.27
patch 224.01 / 226.81 / 224.33 (1.03x)
Output byte-identical to base on that corpus.
🤖 Generated with Claude Code