Correct pileup motif ownership, validation, and mask limits - #702
Open
SuhasSrinivasan wants to merge 7 commits into
Open
Correct pileup motif ownership, validation, and mask limits#702SuhasSrinivasan wants to merge 7 commits into
SuhasSrinivasan wants to merge 7 commits into
Conversation
5 tasks
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.
Review status: Author-reviewed and ready for ONT review.
Addresses #678 and the pileup motif-mask portion of #676.
Summary
This PR consolidates the related pileup motif correctness fixes in one review unit:
u8membership mask fail clearly before output mutation.Severity
High — scientific completeness, reproducibility, and output integrity.
Accepted commands could omit motif sites or change results solely with chunking/preload mode. More than eight matching motifs could be accepted while the ninth was silently unrepresentable. Invalid combine-strand geometry could be detected only after replacing an existing output file.
Root causes and fixes
u8, but parsed and automatically added motif counts were not checked. Capacity is now validated both before and after automatic motif insertion.Reproduction and expected behavior
CGCGrepeatCGCGlabel is absentA 0twice, duplicating affected output and consuming nine mask slotsA 0motif and remains within the eight-motif limitThe ninth-motif case was reproduced with installed modkit 0.6.4 on the included oligo fixture: it exited successfully, produced 11 rows, and reported only the first eight motif labels even though the ninth
CGCG 0motif occurs in the requested reference interval.Testing
Tested exact head:
ea331688225f262ca26bc6b844194b24da27885f(tree19e43d07ee95e116e601274794370ff142e0f8f2).cargo test --offline --locked -p mod_kit motif_capacity_accepts_eight_and_rejects_nine --lib -- --nocapture: 1 passed, 0 failed.cargo test --offline --locked -p modkit --test test_pileup -- --nocapture: 23 passed, 10 ignored, 0 failed.cargo test --offline --locked --workspace --all-targets --no-fail-fast -- --test-threads=1: 195 passed, 14 ignored, 0 failed.adding single-base motif: 'A 0'twice and produces 38 rows for seven C motifs plusm6A/2OmeA; the final head addsA 0once and produces 23 rows with the expected eight distinct motif labels.rustfmt --checkandgit diff --check upstream/master...HEAD: passed. Whole-workspace formatting still reports unrelated pre-existing formatting differences in untouched files.The large direct-RNA slice was not used for this change because the included genomic FASTA/motif fixtures provide exact boundary, coordinate, label, and count oracles. The added capacity checks run only during one-time preset construction, outside the per-read hot loop.
Output and compatibility
Non-goals
Reviewer guide
fasta.rs.pileup/subcommand.rs, including the checks before and after automatic motif insertion.test_pileup.rs.Author checklist