You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TEST] Characterize MassTraceDetection drift from #10905 - #10930
Add a 16 KB fixture reproducing the trace drift in #10905: 119 observations spanning 1.239685 Th over 211.062 s. Include provenance, a reduction recipe and the accepted trajectory, retaining competing peaks and empty scans.
Add a characterization test through MassTraceDetection::run() that identifies the trace by its intensity maximum and checks its count, spans, centroid and seven observations. The excessive span is explicitly recorded as known buggy behavior for later algorithm work to replace. Extraction algorithms and defaults are unchanged. This provides a shared baseline for #10929.
Compiled the checkout's MTD source at d8286837b0 and class tests with GCC 13.3 against the official Linux x86_64 SDK dated 2026.11.14 (library revision 339429f). 2/2 affected C++ tests passed in the native SDK harness: MassTraceDetection_test and MassTrace_test.
Full input and fixture have identical accepted peaks/intensities, seed and centroid/SD update sequence. Decompressed mzML schema validation passed.
The complete source-tree build and full OpenMS test suite have not been run as part of this validation.
Checklist
New and existing affected unit tests pass locally with my changes (native SDK harness)
I have read the OpenMS AI Policy, and I understand, have reviewed and tested every change in this PR and can explain it in my own words
Substantial AI use (Codex); commits carry a Co-authored-by: trailer, and the description above explains the design intent and rationale
Summary by CodeRabbit
Tests
Added regression coverage for a drift-related mass-trace detection case, checking the detected trace’s size, length, centroid, mass range, and selected peak measurements.
Added a reproducible test fixture with recorded extraction parameters and measurement details.
Documentation
Documented the fixture’s source data, checksums, reproduction steps, validation, and commands for running the related tests.
Welcome @Prachi194agrawal and thank you for your contribution to OpenMS! To help us better understand our userbase and contributors, we would appreciate if you could complete the survey at the link below. Completing this survey will help us get to your PR sooner. Thank you for your participation!
Before we review your PR, please confirm the following by replying to this comment with the checklist below (copy, paste and tick the boxes):
- [ ] I've added myself to the [AUTHORS](https://github.com/OpenMS/OpenMS/blob/develop/AUTHORS) file
- [ ] I've built this branch locally and all tests pass
Hi @Prachi194agrawal, having a dedicated 16 KB reduced fixture for this trajectory is a great idea! Relying on the full 8.3 MB Metabolomics_2.mzML is definitely heavy, so isolating it will be a nice improvement for the test suite
Once maintainers review and merge this baseline into develop, I'd be glad to rebase #10929 on top of it and verify that the max_apex_deviation_ppm guard prevents the drift on this exact fixture
I've built this branch locally and all tests pass.
MassTraceDetection_test and MassTrace_test passed locally in the native SDK harness (2/2). The full source-tree build and full OpenMS test suite are still pending.
Review was skipped as selected files did not have any reviewable changes.
Files ignored due to path filters: 2
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905.mzML.gz is excluded by !**/*.gz
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905_trajectory.tsv is excluded by !**/*.tsv
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 3a775680-7734-4103-8e79-e47ab44fbc85
Commits
Reviewing files that changed from the base of the PR and between ca1699f and c3720c3.
Files ignored due to path filters: 2
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905.mzML.gz is excluded by !**/*.gz
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905_trajectory.tsv is excluded by !**/*.tsv
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The pull request documents the drift fixture associated with issue #10905 and adds a regression test. The test checks the identified trace’s measurements as recorded buggy behavior. It does not change the MassTraceDetection algorithm.
Fixture provenance and observed trajectory src/tests/class_tests/openms/data/MassTraceDetection_drift_10905.md
Documents the mzML crop and fixture-generation recipe, extraction parameters, observed trajectory measurements, and validation commands.
Regression test for the observed trace src/tests/class_tests/openms/source/MassTraceDetection_test.cpp, AUTHORS
Adds a test that runs MassTraceDetection on the drift input, identifies a trace by its most intense peak, and checks its measurements. Adds contributor names to the test file and contributor list.
Suggested reviewers:poshul, cbielow
Change: Other
Merge Risk: Minimal · previous review d59dd
This PR adds a characterization test and fixture documentation for the MassTraceDetection drift and does not change runtime behavior. Production impact is negligible, and the PR is ready to merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a characterization test for the MassTraceDetection drift reported in #10905. The changeset adds a regression test, a reduced fixture record, and an AUTHORS entry, and …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title names the main change: a characterization test for the MassTraceDetection drift reported in #10905. The changeset adds a regression test, a reduced fixture record, and an AUTHORS entry, and the test records the drift as current buggy behavior. The title is specific and matches the primary purpose of the PR.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
I thumped my paws beside the trace, Then checked each peak and measured space, The drift still hops across the span, A fixture helps us track the plan, I nibble clover; tests keep watch.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 49670614-6a81-4142-bd5d-96c941d425e4
Commits
Reviewing files that changed from the base of the PR and between d828683 and d59ddd4.
Files ignored due to path filters: 2
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905.mzML.gz is excluded by !**/*.gz
src/tests/class_tests/openms/data/MassTraceDetection_drift_10905_trajectory.tsv is excluded by !**/*.tsv
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
AI-generated initial review
This is an automated, AI-generated first review. It looks only for high- and medium-priority issues (no nits) and checks whether the PR has tests and measurements. Please double-check anything before acting on it; a maintainer will follow up. I reviewed d59ddd47 against develop (d8286837). CodeRabbit had no actionable comments.
What I ran:
Library used: pyOpenMS 3.6.0. Its MassTraceDetection gives the same results as develop. The only changes since v3.6.0 are:
boost::dynamic_bitset was replaced by std::vector<bool>;
a sortedness precondition was added, which only debug builds check;
findNearest was refactored, keeping the same tie rule.
The new test, on the fixture: all 27 assertions of the new section pass. Exactly one trace matches the apex (label T14).
Full input: I ran the same parameters on the RT-sorted Metabolomics_2.mzML (SHA-256 matches the .md). It gives T1930. All 119 peaks (RT, m/z, intensity) and the centroid are identical to the fixture's trace. Your reduction claim holds.
Recipe: the Python recipe in the .md regenerates the fixture byte for byte (SHA-256 a0cd1a4c…).
Replay: I re-implemented the extraction loop in Python. It reproduces all 23 traces of the fixture exactly. The TSV's centroid_before_mz and sd_before_Th columns match it on all 118 non-seed rows.
Robustness across platforms: the expectations use 1e-6 tolerances, so I checked how close the run comes to a different outcome. I looked at all 1,344 nearest-peak decisions of every extraction attempt up to and including the target trace.
No nearest peak came closer to the ±3·SD bound than 8.4×10⁻⁴ of the window half-width.
No two neighbouring peaks were closer to a tie than 1.9×10⁻³ of it.
Differences between compilers and math libraries are far smaller than that. Examples: FMA contraction on arm64, or std::log(float) resolving to logf in updateWeightedSDEstimateRobust. The expected values should therefore hold on macOS and Windows too.
Input checks: the fixture is strictly RT-sorted and MS1-only, so the new debug precondition in run() holds. Loading takes about 0.1 s and the extraction about 1 ms.
Not run:
The C++ test itself: there is no OpenMS build in this environment, and building one for a test-only PR would take hours.
CI: it hasn't run yet. As a first-time contributor's PR, its workflow runs need a maintainer's approval.
Verdict:
High priority: none.
Medium priority: none. Two items in the description need fixing (see below).
Checked and fine
Finding the trace: the test finds it by its intensity apex, which is robust. Exactly one trace matches, in both the fixture and the full input.
Tolerances:
TOLERANCE_RELATIVE(1.0) turns off the relative check, so the 1e-6 absolute tolerance is what applies.
Resetting to 1.00001 / 1e-5 at the end restores the defaults. That's the state the following sections expect, since the file sets no other tolerances.
Index guard: it prevents out-of-bounds access. A changed trace length is still reported by the size check.
.mzML.gz input:MzMLFile reads gzip through CompressedInputSource. Other class tests already load gzipped mzML, e.g. InternalCalibration_test and MapAlignmentAlgorithmPoseClustering_test.
Other open PRs:
#10893 (MassTrace refactoring) only changes the containers used during extraction, so the numbers don't change. The API this test calls (begin/end, operator[], getSize, getTraceLength, getCentroidMZ) stays.
#10929 (draft) adds a guard that is off by default (-1). This test is unaffected unless that default changes.
For information (for maintainers)
The test pins known-buggy output on purpose. The comment and the .md both say a fix should replace the expectations. #10905 asks for the fixture and an annotated trajectory. Please confirm you also want a characterization test that asserts the current drift. Any fix that changes the default behaviour will then have to replace these expectations with scientifically validated ones, not just update the numbers.
Unused documentation in the test data directory:
The .md (172 lines) and the .tsv (119 rows) aren't read by any test. No other .md sits in src/tests/class_tests/openms/data/.
Their content is accurate: hashes, recipe and trajectory are verified above.
Maintainers may want to keep them there or move the provenance elsewhere, e.g. into the issue or a shorter header comment in the test.
Tests
You provided: a characterization test through MassTraceDetection::run() with a 16 KB fixture. You ran it, together with MassTrace_test, against the nightly SDK.
Missing: a CI run on all platforms, which needs workflow approval. Based on the margins above, I don't expect platform-specific failures. No further tests are needed for this scope.
Measurements
The fixture comes from real data (the Metabolomics_2.mzML tutorial file). You checked that the full input and the fixture give the same trace, and I reproduced that independently (above).
The PR changes no library code, so no performance measurement is needed.
Description
AI-policy box: the box confirming that you've read the AI policy and reviewed and tested every change isn't ticked. Please tick it once that's true.
Missing trailer: the description says the commits carry a Co-authored-by: trailer, but neither 54ad8ee nor d59ddd4 has one. Please add it, e.g. by amending the commits, or say so here so the maintainers can add it to the squash commit.
Add a reduced fixture and accepted trajectory for the reported 1.24 Th drift.
Preserve the extraction seed, competing peaks and scan gaps, and record the
current buggy behavior through the public run() API for future guard work.
Refs OpenMS#10905
Co-authored-by: Codex <[email protected]>
Keep the MassTraceDetection drift contribution focused by restoring the
existing filterByPeakWidth comments to their original formatting.
Refs OpenMS#10905
Co-authored-by: Codex <[email protected]>
Thanks for independently reproducing the drift and verifying the fixture. I’ve added the Codex Co-authored-by: trailers and checked the AI-policy box after reviewing and testing the changes. MassTraceDetection_test and MassTrace_test both passed locally in the native SDK harness.
Thanks. This should be part of the pr that fixes the issue. I don’t want to have one. Fix split into several PRs. Causes too much noise. Note that the fix needs extensive benchmarking (check some of my recent PRs on metabolics stuff). Will close here.
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
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.
Description
Add a 16 KB fixture reproducing the trace drift in #10905: 119 observations spanning 1.239685 Th over 211.062 s. Include provenance, a reduction recipe and the accepted trajectory, retaining competing peaks and empty scans.
Add a characterization test through
MassTraceDetection::run()that identifies the trace by its intensity maximum and checks its count, spans, centroid and seven observations. The excessive span is explicitly recorded as known buggy behavior for later algorithm work to replace. Extraction algorithms and defaults are unchanged. This provides a shared baseline for #10929.Refs #10905
Validation
d8286837b0and class tests with GCC 13.3 against the official Linux x86_64 SDK dated 2026.11.14 (library revision339429f). 2/2 affected C++ tests passed in the native SDK harness:MassTraceDetection_testandMassTrace_test.The complete source-tree build and full OpenMS test suite have not been run as part of this validation.
Checklist
AI use (see the OpenMS AI Policy)
Co-authored-by:trailer, and the description above explains the design intent and rationaleSummary by CodeRabbit
Tests
Documentation