Skip to content

Reset the count after G when parsing a CIGAR string - #689

Merged
adamant-pwn merged 1 commit into
masterfrom
fix/cigar-node-insertion-parse
Oct 28, 2026
Merged

adamant-pwn merged 1 commit into
masterfrom
fix/cigar-node-insertion-parse

Conversation

@adamant-pwn

@adamant-pwn adamant-pwn commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Cigar(std::string_view) did not clear the pending count after a G (node insertion), so "2G3=" parsed as 2G23= and "3=2G1X1G" as 3=2G21X1G. Every other operation clears it.

Adds a round-trip test, DBGAlignerTest.cigar_string_round_trip. A standalone build of aligner_cigar.cpp reproduces the bug before the fix and round-trips all three test strings after it.

🤖 Generated with Claude Code


Summary by cubic

Fixes CIGAR string parsing so a node insertion (G) resets its count, preventing "2G3=" from parsing as 2G23= and "3=2G1X1G" as 3=2G21X1G.

Adds a round-trip test verifying three CIGAR strings serialize back to their original form.

Written for commit 96a36f0. Summary will update on new commits.

View guided diff Turn on auto-fix

Cigar(std::string_view) kept the digits of a node insertion's count, so
"2G3=" parsed as 2G followed by 23=. Clear the count as for every other
operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 2 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@adamant-pwn
adamant-pwn merged commit f671e15 into master Oct 28, 2026
52 checks passed
@adamant-pwn
adamant-pwn deleted the fix/cigar-node-insertion-parse branch October 28, 2026 20:25
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