Skip to content

Align end-to-end regardless of earlier ends-free settings - #62

Merged
cjfields merged 2 commits into
mainfrom
fix/end2end-ignores-free-ends
Oct 19, 2026
Merged

cjfields merged 2 commits into
mainfrom
fix/end2end-ignores-free-ends

Conversation

@cjfields

Copy link
Copy Markdown
Member

Fixes #61.

  • align_end2end_inner (behind align_end2end, align_lambda, align_packed2bits) runs with an end-to-end span and restores the previous one, so later align_endsfree calls on the same aligner keep their free-end settings.
  • Adds set_alignment_end_to_end, C's wavefront_aligner_set_alignment_end_to_end, which the port lacked: it resets the span and zeroes the free-end limits, so a later align_endsfree is end-to-end too (as C's wavefront_align follows the span).
  • aligner::tests::test_end2end_ignores_free_ends: a reused aligner (linear, match −5 and 0, both compat modes) must give a fresh aligner's end-to-end score and CIGAR, before and after the setter. Fails without the fix (score 5 vs 21).
  • FIXED_BUGS 16.

All 282 tests pass; CLI output identical to main over 36 configurations (affine/linear/affine2p, global and ends-free spans, both compat modes, high/med). Not a C-parity change, so the differential harness is unaffected.

🤖 Generated with Claude Code

cjfields and others added 2 commits October 19, 2026 10:01
set_alignment_free_ends sets the span to ends-free and nothing reset it,
so align_end2end (and align_lambda, align_packed2bits) on a reused
aligner still seeded begin-free cells: a leading gap was taken as a free
skip, giving a suboptimal global score. Found by dada2-rs, which caches
one aligner per thread. End-to-end alignment now runs with an end-to-end
span and restores the previous one for later ends-free calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C's wavefront_aligner_set_alignment_end_to_end had no Rust counterpart, so
nothing could reset the span after set_alignment_free_ends or
set_alignment_extension. The setter also zeroes the free-end limits, so a
later align_endsfree is end-to-end too, as C's wavefront_align follows the
span.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cjfields
cjfields merged commit 96c1f23 into main Oct 19, 2026
17 checks passed
@cjfields
cjfields deleted the fix/end2end-ignores-free-ends branch October 19, 2026 15:27
cjfields added a commit to HPCBio/dada2-rs that referenced this pull request Oct 19, 2026
HPCBio/wfa2lib-rs#62 (fixes #61) makes align_end2end ignore earlier
ends-free settings, so the adapter no longer clears free ends itself.
end_model_global_after_ends_free_same_thread passes without the
workaround; 7,980 real pairs each (PacBio, MiSeq), ends-free first then
global: 0 score differences from NW.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

align_end2end keeps begin-free limits from an earlier set_alignment_free_ends

1 participant