Return a nonzero exit status for detected paired-end read-count mismatches - #719
Open
thierrygosselin wants to merge 2 commits into
Open
thierrygosselin wants to merge 2 commits into
thierrygosselin wants to merge 2 commits into
Conversation
Replace the warning-and-stop behaviour at the existing paired-pack count check with an explicit error and nonzero exit status. Include both input filenames in the error message instead of silently discarding unmatched reads. This addresses detected count mismatches in separate paired-end files. It does not add identifier validation or change interleaved input handling.
Test both shorter-mate directions around pack boundaries and with inputs exceeding 40,000 reads, using one and four threads. Require a nonzero exit status and an explicit count-mismatch diagnostic. Verify that equal inputs and intentional reads_to_process limits continue to succeed. All 20 cases pass with the fix. Unmodified Conda fastp 1.3.6 returns success for all 12 unequal-input cases.
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.
Summary
When paired input packs contain different numbers of reads, fastp currently warns, discards unmatched reads, and can finish with exit status 0.
This PR changes the existing mismatch check to fail explicitly and identify both input files.
Changes
error_exit()when paired-pack counts differ.Regression tests
Added synthetic tests covering:
--reads_to_processlimits.Run with:
On macOS ARM64, all 20 cases pass with the patch. Unmodified Conda fastp 1.3.6 returns success for all 12 unequal-input cases.
Relationship to #694
Related to #694: this addresses failure reporting when a count mismatch is detected. I did not reproduce the historical hang in these tests, so this PR does not claim to resolve every deadlock scenario described there.
Scope
This patch concerns the existing count check for separate paired-end files. It does not validate read identifiers, change interleaved input handling, or scan beyond an intentional processing limit.
Linux execution has not been tested.