Skip to content

fix: map unmapped reads (tid=-1) to correct index in slow_idxstats#511

Open
nh13 wants to merge 1 commit intorust-bio:masterfrom
nh13:nh/fix-slow-idxstats-unmapped
Open

fix: map unmapped reads (tid=-1) to correct index in slow_idxstats#511
nh13 wants to merge 1 commit intorust-bio:masterfrom
nh13:nh/fix-slow-idxstats-unmapped

Conversation

@nh13
Copy link
Copy Markdown
Contributor

@nh13 nh13 commented Mar 30, 2026

When iterating CRAM records, unmapped reads have tid == -1. Casting
this to usize wraps to usize::MAX, causing an index-out-of-bounds
panic. Map tid == -1 to the designated unmapped slot at index nref.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 30, 2026

Pull Request Test Coverage Report for Build 23730666310

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 81.81%

Totals Coverage Status
Change from base Build 21474746563: 0.03%
Covered Lines: 2793
Relevant Lines: 3414

💛 - Coveralls

When iterating CRAM records, unmapped reads have tid == -1. Casting
this to usize wraps to usize::MAX, causing an index-out-of-bounds
panic. Map tid == -1 to the designated unmapped slot at index nref.
@nh13 nh13 force-pushed the nh/fix-slow-idxstats-unmapped branch from 0d961ac to 7967059 Compare March 30, 2026 06:14
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.

2 participants