Support base-cost per ts_kind in tschainalign.#181
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends lib_ts_chainalign to support a template-switch base cost that varies by TsKind (TS11/TS12/TS21/TS22), and updates chaining/exact-chaining logic and tests to use the per-kind cost.
Changes:
- Introduces
TsBaseCost<Cost>and replacesAlignmentCosts.ts_base_cost: CostwithTsBaseCost<Cost>. - Updates exact-chaining (TS12 jump) and chaining cost-function logic to apply
ts_base_cost.get(ts_kind)where theTsKindis known. - Updates compatibility conversion from
lib_tsalignconfigs and adjusts lower-bound computations/tests accordingly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib_ts_chainalign/src/exact_chaining/ts_34_jump/tests.rs | Updates tests to construct ts_base_cost via Into<TsBaseCost<_>>. |
| lib_ts_chainalign/src/exact_chaining/ts_12_jump/tests.rs | Updates tests to construct ts_base_cost via Into<TsBaseCost<_>>. |
| lib_ts_chainalign/src/exact_chaining/ts_12_jump/algo.rs | Applies ts_base_cost based on the end coordinate’s TsKind. |
| lib_ts_chainalign/src/costs/compat.rs | Converts lib_tsalign base-cost fields into a per-TsKind TsBaseCost. |
| lib_ts_chainalign/src/costs.rs | Adds TsBaseCost type and updates AlignmentCosts to use it. |
| lib_ts_chainalign/src/chaining_lower_bounds/ts_jump/tests.rs | Updates tests for new TsBaseCost API and uses min() where needed. |
| lib_ts_chainalign/src/chaining_lower_bounds/ts_jump.rs | Incorporates the base cost into 12-jump lower bounds using TsBaseCost::min(). |
| lib_ts_chainalign/src/chaining_cost_function/tests.rs | Updates test construction of AlignmentCosts::new to pass a TsBaseCost. |
| lib_ts_chainalign/src/chaining_cost_function.rs | Uses ts_base_cost.get(ts_kind) when comparing against thresholds / cost limits. |
| lib_ts_chainalign/src/alignment/ts_kind.rs | Adds clarifying doc comments for TS11/TS12/TS21/TS22. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.