Skip to content

Keep only each DP row's band, packed together - #12

Merged
glennhickey merged 1 commit into
mainfrom
ai-optimization
Oct 2, 2026
Merged

glennhickey merged 1 commit into
mainfrom
ai-optimization

Conversation

@glennhickey

Copy link
Copy Markdown

Summary

abPOA allocates every DP row at the full query width, though it only computes the band. With this change each row stores just its band, plus one block on either side, packed one after another from the front of the DP buffer.

  • Rows are reached through dp_row/dp_row_w, still indexed by absolute block. simd_abpoa_new_row lays out each row as it is reached.
  • An INF_MIN block sits before each band, because the backtrack reads one column to the left of it.
  • abpoa.h now includes <stdio.h>. It uses FILE, so a source file that included it before <stdio.h> did not compile.

Output is identical. That covers 203 library comparisons on simulated sets, spanning all three gap models, band settings and seeding, and 102 command-line comparisons including local and extend modes. tests/run_all.sh passes (10/10). Through cactus, it also holds on bar's output for 8 Mb of human/mouse and on evolver mammals.

In cactus bar, on 8 Mb of human/mouse at 8 threads: 59 s, 6.9 GB → 51 s, 5.5 GB.

ComparativeGenomicsToolkit/cactus#2026 moves cactus's submodule from yangao07/abPOA (v1.5.6) to this fork and pins this branch's commit, 6e02e17.

Base branch

This PR targets a new main branch, a copy of upstream yangao07/abPOA main (2e095ba, v1.5.7). This fork's master is upstream v1.2.5 from 2021, plus four build tweaks for a cactus build that no longer uses them, so it would conflict and bury this change in five years of upstream history. This branch was cut from upstream 1b7cb00. The three upstream commits since then change only release metadata (version string, README, packaging) and merge cleanly.

Please merge with a merge commit rather than squash/rebase, so the commit cactus pins stays reachable.

🤖 Generated with Claude Code

Every DP row was stored at full query width, though only its band is ever
computed, so each band sat alone in its own stretch of the buffer and every
row paged in partly-used pages at both edges of its band.  Rows now keep only
their band, plus a block either side, packed one after another and addressed
through per-row pointers (dp_row, dp_row_w) that keep absolute column
indexing, so the DP and backtrack code is otherwise unchanged.  The block
before each band is set to INF_MIN, where it used to hold whatever the buffer
last held: the backtrack reads one column left of where it stands.

Alignments are unchanged: MSA, consensus and GFA output in every gap model
and alignment mode tried, and tests/run_all.sh.  In cactus's bar, on 8Mb of
human/mouse at 8 threads, abPOA went from 59s and 6.9GB to 51s and 5.5GB.

Also include <stdio.h> in abpoa.h, which uses FILE but stopped getting it
when simd_instruction.h was dropped from the header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glennhickey
glennhickey merged commit 36110ac into main Oct 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant