Skip to content

204 add separate equal cost range mode that ignores geometric tsm constraints - #205

Merged
sebschmi merged 7 commits into
mainfrom
204-add-separate-equal-cost-range-mode-that-ignores-geometric-tsm-constraints
Aug 31, 2026
Merged

204 add separate equal cost range mode that ignores geometric tsm constraints#205
sebschmi merged 7 commits into
mainfrom
204-add-separate-equal-cost-range-mode-that-ignores-geometric-tsm-constraints

Conversation

@sebschmi

Copy link
Copy Markdown
Member

No description provided.

@sebschmi
sebschmi marked this pull request as ready for review August 31, 2026 08:21
Copilot AI lite review requested due to automatic review settings August 31, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “TSM uncertainty range” concept (renaming the previous equal-cost range), adds a mode to extend ranges while ignoring geometry-related cost, and updates the CLI/visualisation + bindings accordingly, alongside a coordinated major version bump across the workspace.

Changes:

  • Replace “equal-cost range” with TSMUncertaintyRange across core alignment, SVG rendering, and Python types.
  • Add TSMUncertaintyRangeExtensionMode with EqualCostIgnoreGeometry and expose it via --ts-uncertainty-range-extension-mode.
  • Bump workspace crate versions to 6.0.0 and update dependent crate constraints/lockfile.

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tsalign/src/show.rs Renames CLI flag/type for SVG range rendering to uncertainty ranges.
tsalign/src/align/template_switch_distance_type_selectors.rs Adds CLI selector for uncertainty-range extension mode and plumbs it into align call.
tsalign/src/align.rs Exposes --ts-uncertainty-range-extension-mode on the align CLI.
tsalign/Cargo.toml Bumps package/dependency versions to 6.0.0.
tsalign-tests/Cargo.toml Bumps test crate version to 6.0.0.
test_files/twin_equal_cost_ignore_geometry.sh Adds a repro script comparing equal-cost vs ignore-geometry outputs.
test_files/twin_equal_cost_ignore_geometry.fa Adds a small input FASTA for the repro script.
seed_chain/Cargo.toml Bumps seed_chain + generic_a_star dependency version to 6.0.0.
python_bindings/src/lib.rs Updates binding to pass the new extension mode argument.
python_bindings/python/tsalign/_types.py Renames parsed field from equal_cost_range to uncertainty_range.
python_bindings/Cargo.toml Bumps Python binding crate + deps to 6.0.0.
lib_tsshow/src/ts_arrangement/template_switch.rs Renames stored range field/type to uncertainty range.
lib_tsshow/src/ts_arrangement/source.rs Updates optional-source modelling to track “increases_inner” for uncertainty rendering.
lib_tsshow/src/ts_arrangement/inner.rs Extends inner arrangement to represent increasing/decreasing uncertainty segments.
lib_tsshow/src/ts_arrangement.rs Threads uncertainty range mode through arrangement and adds helpers for rendering bounds.
lib_tsshow/src/svg.rs Implements updated uncertainty range rendering + legend changes.
lib_tsshow/Cargo.toml Bumps lib_tsshow + lib_tsalign dependency version to 6.0.0.
lib_tsalign/src/tests.rs Updates internal tests to pass the new extension mode argument.
lib_tsalign/src/a_star_aligner/template_switch_distance/display.rs Renames display formatting from equal-cost range to uncertainty range.
lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type/tsm_uncertainty_range.rs Adds new TSMUncertaintyRange + extension mode enum.
lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type/equal_cost_range.rs Removes old EqualCostRange type.
lib_tsalign/src/a_star_aligner/template_switch_distance/alignment_type.rs Switches AlignmentType entrance payload to uncertainty range.
lib_tsalign/src/a_star_aligner/template_switch_distance.rs Re-exports new types and initializes uncertainty ranges as invalid.
lib_tsalign/src/a_star_aligner/configurable_a_star_align/tests.rs Updates tests to include new parameter.
lib_tsalign/src/a_star_aligner/configurable_a_star_align.rs Extends aligner API to accept uncertainty-range extension mode.
lib_tsalign/src/a_star_aligner/alignment_result/alignment/template_switch_specifics.rs Adds cost computation variants to support “ignore geometry” cost comparisons.
lib_tsalign/src/a_star_aligner/alignment_result.rs Renames/extends postprocessing to compute uncertainty ranges with mode parameter.
lib_tsalign/src/a_star_aligner.rs Plumbs extension mode through top-level A* align API and logs chosen behavior.
lib_tsalign/Cargo.toml Bumps lib_tsalign + deps to 6.0.0.
lib_ts_chainalign/src/chain_align.rs Renames range type in chained alignment entrance events.
lib_ts_chainalign/Cargo.toml Bumps lib_ts_chainalign + deps to 6.0.0.
generic_a_star/Cargo.toml Bumps generic_a_star version to 6.0.0.
Cargo.lock Updates lockfile versions for the workspace bump.
Suppressed comments (3)

lib_tsshow/src/ts_arrangement/source.rs:1044

  • SourceChar::make_copy() turns OptionalSource into Source, which drops the optional/uncertainty-range state (including increases_inner). This likely breaks uncertainty-range visualisation when optional chars are copied (e.g., due to TS copy-depth rendering). Preserve OptionalSource and carry increases_inner through when making a copy.

This issue also appears on line 1067 of the same file.

            } => Self::Source {
                column: *column,
                lower_case: false,
                copy_depth: Some(copy_depth.map(|copy_depth| copy_depth + 1).unwrap_or(0)),
            },

lib_tsshow/src/ts_arrangement/source.rs:1071

  • SourceChar::make_visible_copy() also turns OptionalSource into Source, dropping uncertainty-range metadata (increases_inner) and removing optional styling. Preserve OptionalSource when copying so the SVG can keep rendering optional chars correctly.
            } => Self::Source {
                column: *column,
                lower_case: false,
                copy_depth: Some(copy_depth.map(|copy_depth| copy_depth + 1).unwrap_or(0)),
            },

lib_tsshow/src/svg.rs:285

  • Similarly, the commented-out SP4 shift logic should be removed or turned into an explicit TODO. As-is it reads like partially reverted logic and makes future maintenance harder.
        /*let descendant_sp4 = if config.uncertainty_range_mode == UncertaintyRangeMode::Full {
            descendant_sp4 + usize::try_from(uncertainty_range.max_end).unwrap()
        } else {
            descendant_sp4
        };*/

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib_tsalign/src/a_star_aligner/alignment_result.rs Outdated
Comment thread lib_tsshow/src/svg.rs
sebschmi and others added 2 commits August 31, 2026 11:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@sebschmi
sebschmi enabled auto-merge August 31, 2026 08:30
@sebschmi
sebschmi merged commit 12dc457 into main Aug 31, 2026
29 checks passed
@sebschmi
sebschmi deleted the 204-add-separate-equal-cost-range-mode-that-ignores-geometric-tsm-constraints branch August 31, 2026 08:32
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.

Add separate equal-cost-range mode that ignores geometric TSM constraints

2 participants