Repository navigation
[TEST] QPX: pin values against text references (#9864 Phase 0.1, phases 1-2) - #9879
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughChangesThe PR adds deterministic, escaped TSV export for Parquet tables through QPX Parquet validation
Sequence Diagram(s)sequenceDiagram
participant QPXTests
participant ParquetDiff
participant ParquetTableComparator
participant ParquetFile
participant QPXReference
QPXTests->>ParquetDiff: request TSV output
ParquetDiff->>ParquetTableComparator: dumpToTsv(input, output, settings)
ParquetTableComparator->>ParquetFile: read and sort rows by canonical keys
ParquetTableComparator-->>ParquetDiff: write escaped TSV
QPXTests->>QPXReference: compare TSV output with reference
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/topp/ProSE.cpp (1)
658-679: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winDelete omitted QPX
.pgfiles before logging the skip.Reusing
-out_qpxleaves an older<basename>.pg.parquetbehind when the current run skips it because no groups were inferred, and it also leaves an oldquantms.pg.parquetwhen every merged source skips groups. Remove both<basename>.pg.parquetandquantms.pg.parquetbefore the existing “not writing” logs.Also applies to: 801-803
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` around lines 658 - 679, In the no-protein-groups branches near ProteinGroupArrowExport, delete any stale per-input <basename>.pg.parquet and merged quantms.pg.parquet outputs before the existing “not writing” logs. Apply the same cleanup to the corresponding logic around the additional locations at lines 801-803, while preserving the current skip behavior and messages.Source: Coding guidelines
🧹 Nitpick comments (2)
src/topp/ParquetDiff.cpp (1)
175-175: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRoute new status messages through the TOPP logging interface.
The new TSV-success and row-floor messages write directly to
std::cout. Use the TOPP logging interface so these messages follow the configured OpenMS log routing.Also applies to: 193-197
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ParquetDiff.cpp` at line 175, Replace the direct std::cout writes for the TSV-success message and row-floor messages in the ParquetDiff status flow with the TOPP logging interface, preserving their existing message text and verbosity conditions so output follows configured OpenMS routing.Source: Coding guidelines
src/openms/source/FORMAT/ParquetTableComparator.cpp (1)
875-875: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse newline characters in the new log statements.
Replace
std::endlwith"\n"in these new log statements. As per coding guidelines, prefer\noverstd::endl.Also applies to: 889-891, 902-903, 951-951, 964-964
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/FORMAT/ParquetTableComparator.cpp` at line 875, Replace std::endl with "\n" in the new ParquetDiff log statements, including the messages in the error-reporting paths around OPENMS_LOG_ERROR and the additional listed locations. Preserve the existing log content and behavior while removing the flushing stream manipulator.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG`:
- Line 20: Update the CHANGELOG description of canonical key ordering to match
the implementation: document V6:TMT126, then V6:TMT131, then V7:TMT127C, rather
than placing TMT127C before TMT131.
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp`:
- Around line 930-938: Update the escaping loop in the displayValue_ rendering
block to handle backslashes first, emitting them as escaped backslashes before
processing tabs, newlines, and carriage returns. Preserve the existing
control-character escapes and literal-character handling so distinct values
cannot produce the same comparison text.
In `@src/tests/topp/CMakeLists.txt`:
- Around line 250-256: Add the -schema_only option to the TOPP_ParquetDiff_8
test invocation while preserving its existing inputs, primary keys, and min_rows
value, so WILL_FAIL reflects validation of the second input’s four-row floor
rather than primary-key comparison.
---
Outside diff comments:
In `@src/topp/ProSE.cpp`:
- Around line 658-679: In the no-protein-groups branches near
ProteinGroupArrowExport, delete any stale per-input <basename>.pg.parquet and
merged quantms.pg.parquet outputs before the existing “not writing” logs. Apply
the same cleanup to the corresponding logic around the additional locations at
lines 801-803, while preserving the current skip behavior and messages.
---
Nitpick comments:
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp`:
- Line 875: Replace std::endl with "\n" in the new ParquetDiff log statements,
including the messages in the error-reporting paths around OPENMS_LOG_ERROR and
the additional listed locations. Preserve the existing log content and behavior
while removing the flushing stream manipulator.
In `@src/topp/ParquetDiff.cpp`:
- Line 175: Replace the direct std::cout writes for the TSV-success message and
row-floor messages in the ParquetDiff status flow with the TOPP logging
interface, preserving their existing message text and verbosity conditions so
output follows configured OpenMS routing.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8b908fb0-41ae-4088-b7ea-17133c918a92
⛔ Files ignored due to path filters (4)
src/tests/topp/IsobaricWorkflow_qpx_pg.tsvis excluded by!**/*.tsvsrc/tests/topp/IsobaricWorkflow_qpx_psm.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_18_qpx_pg.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_19_qpx_pg.tsvis excluded by!**/*.tsv
📒 Files selected for processing (6)
CHANGELOGsrc/openms/include/OpenMS/FORMAT/ParquetTableComparator.hsrc/openms/source/FORMAT/ParquetTableComparator.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ParquetDiff.cppsrc/topp/ProSE.cpp
…or test mean what it says Three findings from CodeRabbit on OpenMS#9879, all valid. 1. dumpToTsv could forge an escape. A tab is rendered as the two characters '\' 't' to keep one row on one line - but a value that ALREADY contained a backslash followed by 't' rendered to those same two characters. Two genuinely different tables therefore produced identical text and the reference comparison accepted them as equal, which is the exact failure a value reference exists to rule out. The backslash is now escaped first and unconditionally. Verified in both directions rather than assumed: two tables differing only in 'literal backslash-t' versus 'a real tab' now render as X\\tY and X\tY, and with the fix reverted the new regression section fails on TEST_NOT_EQUAL(text_a, text_b) because both collapse to [X\tY]. The section also asserts that neither dump contains a raw tab, which would split a row. None of the four committed references contains a backslash, so none of them moves - checked, and all 51 QPX/ParquetDiff tests still pass against the unchanged files. 2. TOPP_ParquetDiff_8 passed for the wrong reason. It exists to show the row floor applies to the SECOND input, and it did fail - but its two fixtures have disjoint primary keys, so it would have failed on the key mismatch even if 'min_rows' never looked at 'in2' at all. 'schema_only' now removes every other failure cause, leaving the floor as the only thing that can go red. 3. The documented canonical key order was backwards, in both the CHANGELOG and the CMake comment. Length-prefixing puts the six-character 'TMT126' and 'TMT131' ahead of the seven-character 'TMT127C', not 'TMT127C' before 'TMT131'. Full local ctest unchanged at 2826 tests, 9 pre-existing environmental failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…or test mean what it says Three findings from CodeRabbit on OpenMS#9879, all valid. 1. dumpToTsv could forge an escape. A tab is rendered as the two characters '\' 't' to keep one row on one line - but a value that ALREADY contained a backslash followed by 't' rendered to those same two characters. Two genuinely different tables therefore produced identical text and the reference comparison accepted them as equal, which is the exact failure a value reference exists to rule out. The backslash is now escaped first and unconditionally. Verified in both directions rather than assumed: two tables differing only in 'literal backslash-t' versus 'a real tab' now render as X\\tY and X\tY, and with the fix reverted the new regression section fails on TEST_NOT_EQUAL(text_a, text_b) because both collapse to [X\tY]. The section also asserts that neither dump contains a raw tab, which would split a row. None of the four committed references contains a backslash, so none of them moves - checked, and all 51 QPX/ParquetDiff tests still pass against the unchanged files. 2. TOPP_ParquetDiff_8 passed for the wrong reason. It exists to show the row floor applies to the SECOND input, and it did fail - but its two fixtures have disjoint primary keys, so it would have failed on the key mismatch even if 'min_rows' never looked at 'in2' at all. 'schema_only' now removes every other failure cause, leaving the floor as the only thing that can go red. 3. The documented canonical key order was backwards, in both the CHANGELOG and the CMake comment. Length-prefixing puts the six-character 'TMT126' and 'TMT131' ahead of the seven-character 'TMT127C', not 'TMT127C' before 'TMT131'. Full local ctest unchanged at 2826 tests, 9 pre-existing environmental failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
e91e524 to
da16a98
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/openms/source/FORMAT/ParquetTableComparator.cpp (1)
875-875: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueApply the required C++ formatting and logging style.
Move braces in changed control blocks onto aligned lines. Replace
std::endlwith"\n"in the new log statements.As per coding guidelines,
**/*.{h,hpp,cpp,cc,cxx}requires braces on their own aligned lines, andsrc/**/*.cppsays to prefer\noverstd::endl.Also applies to: 886-886, 891-891, 903-903, 927-927, 938-942, 956-956, 965-965, 969-969
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/FORMAT/ParquetTableComparator.cpp` at line 875, Update the changed control blocks around the Parquet dump/error-handling logic to place opening and closing braces on their own aligned lines. In the affected logging statements, including those using OPENMS_LOG_ERROR, replace std::endl with "\n" while preserving the existing messages and behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp`:
- Around line 959-964: Update the header-writing loop around
schema->field(c)->name() to pass each field name through the same TSV escaping
routine used for row cells before writing it to out. Preserve the existing tab
separators and newline while ensuring backslashes, tabs, and line breaks in
header names are escaped consistently.
- Around line 916-922: Update the primary-key loop in the surrounding
dump/comparison function to check both `ok` from `cellAt_` and `key_ok` from
`canonicalKey_`; immediately return `false` when either is false, before
appending or sorting the generated key. Preserve normal key construction for
successfully readable and canonicalized cells.
---
Nitpick comments:
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp`:
- Line 875: Update the changed control blocks around the Parquet
dump/error-handling logic to place opening and closing braces on their own
aligned lines. In the affected logging statements, including those using
OPENMS_LOG_ERROR, replace std::endl with "\n" while preserving the existing
messages and behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 42ec1421-2ed2-4109-afdb-419fe6668308
⛔ Files ignored due to path filters (4)
src/tests/topp/IsobaricWorkflow_qpx_pg.tsvis excluded by!**/*.tsvsrc/tests/topp/IsobaricWorkflow_qpx_psm.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_18_qpx_pg.tsvis excluded by!**/*.tsvsrc/tests/topp/ProteinQuantifier_19_qpx_pg.tsvis excluded by!**/*.tsv
📒 Files selected for processing (9)
CHANGELOGsrc/openms/include/OpenMS/FORMAT/ArrowIOHelpers.hsrc/openms/include/OpenMS/FORMAT/ParquetTableComparator.hsrc/openms/source/FORMAT/ArrowIOHelpers.cppsrc/openms/source/FORMAT/ParquetTableComparator.cppsrc/tests/class_tests/openms/source/ParquetTableComparator_test.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ParquetDiff.cppsrc/topp/ProSE.cpp
🚧 Files skipped from review as they are similar to previous changes (6)
- src/openms/include/OpenMS/FORMAT/ParquetTableComparator.h
- src/tests/class_tests/openms/source/ParquetTableComparator_test.cpp
- CHANGELOG
- src/topp/ProSE.cpp
- src/tests/topp/CMakeLists.txt
- src/topp/ParquetDiff.cpp
| for (int i : key_idx) | ||
| { | ||
| bool ok = false; | ||
| auto scalar = cellAt_(table, i, r, ok); | ||
| bool key_ok = true; | ||
| sort_key += canonicalKey_(scalar, key_ok); | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Fail the dump when a primary-key cell cannot be read.
Line 921 ignores both cellAt_ failure and canonicalKey_ failure. The code then sorts unreadable keys as "E;" and emits a reference instead of reporting an invalid input. Return false when either operation fails.
Proposed fix
- for (int i : key_idx)
+ for (Size k = 0; k < key_idx.size(); ++k)
{
+ const int i = key_idx[k];
bool ok = false;
auto scalar = cellAt_(table, i, r, ok);
+ if (!ok)
+ {
+ OPENMS_LOG_ERROR << "ParquetDiff: cannot read primary-key column '"
+ << key_columns[k] << "' in row " << r << "\n";
+ return false;
+ }
bool key_ok = true;
sort_key += canonicalKey_(scalar, key_ok);
+ if (!key_ok)
+ {
+ OPENMS_LOG_ERROR << "ParquetDiff: cannot read nested primary-key value in column '"
+ << key_columns[k] << "' in row " << r << "\n";
+ return false;
+ }
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for (int i : key_idx) | |
| { | |
| bool ok = false; | |
| auto scalar = cellAt_(table, i, r, ok); | |
| bool key_ok = true; | |
| sort_key += canonicalKey_(scalar, key_ok); | |
| } | |
| for (Size k = 0; k < key_idx.size(); ++k) | |
| { | |
| const int i = key_idx[k]; | |
| bool ok = false; | |
| auto scalar = cellAt_(table, i, r, ok); | |
| if (!ok) | |
| { | |
| OPENMS_LOG_ERROR << "ParquetDiff: cannot read primary-key column '" | |
| << key_columns[k] << "' in row " << r << "\n"; | |
| return false; | |
| } | |
| bool key_ok = true; | |
| sort_key += canonicalKey_(scalar, key_ok); | |
| if (!key_ok) | |
| { | |
| OPENMS_LOG_ERROR << "ParquetDiff: cannot read nested primary-key value in column '" | |
| << key_columns[k] << "' in row " << r << "\n"; | |
| return false; | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp` around lines 916 - 922,
Update the primary-key loop in the surrounding dump/comparison function to check
both `ok` from `cellAt_` and `key_ok` from `canonicalKey_`; immediately return
`false` when either is false, before appending or sorting the generated key.
Preserve normal key construction for successfully readable and canonicalized
cells.
| for (int c = 0; c < schema->num_fields(); ++c) | ||
| { | ||
| if (c != 0) { out << "\t"; } | ||
| out << schema->field(c)->name(); | ||
| } | ||
| out << "\n"; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Escape TSV header field names.
Lines 961-963 write field names without the escaping applied to row cells. A schema field name containing a backslash, tab, or line break produces an invalid or ambiguous TSV header. Apply the same escaping routine to each header field name.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/openms/source/FORMAT/ParquetTableComparator.cpp` around lines 959 - 964,
Update the header-writing loop around schema->field(c)->name() to pass each
field name through the same TSV escaping routine used for row cells before
writing it to out. Preserve the existing tab separators and newline while
ensuring backslashes, tabs, and line breaks in header names are escaped
consistently.
…or test mean what it says Three findings from CodeRabbit on OpenMS#9879, all valid. 1. dumpToTsv could forge an escape. A tab is rendered as the two characters '\' 't' to keep one row on one line - but a value that ALREADY contained a backslash followed by 't' rendered to those same two characters. Two genuinely different tables therefore produced identical text and the reference comparison accepted them as equal, which is the exact failure a value reference exists to rule out. The backslash is now escaped first and unconditionally. Verified in both directions rather than assumed: two tables differing only in 'literal backslash-t' versus 'a real tab' now render as X\\tY and X\tY, and with the fix reverted the new regression section fails on TEST_NOT_EQUAL(text_a, text_b) because both collapse to [X\tY]. The section also asserts that neither dump contains a raw tab, which would split a row. None of the four committed references contains a backslash, so none of them moves - checked, and all 51 QPX/ParquetDiff tests still pass against the unchanged files. 2. TOPP_ParquetDiff_8 passed for the wrong reason. It exists to show the row floor applies to the SECOND input, and it did fail - but its two fixtures have disjoint primary keys, so it would have failed on the key mismatch even if 'min_rows' never looked at 'in2' at all. 'schema_only' now removes every other failure cause, leaving the floor as the only thing that can go red. 3. The documented canonical key order was backwards, in both the CHANGELOG and the CMake comment. Length-prefixing puts the six-character 'TMT126' and 'TMT131' ahead of the seven-character 'TMT127C', not 'TMT127C' before 'TMT131'. Full local ctest unchanged at 2826 tests, 9 pre-existing environmental failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
da16a98 to
4e43f06
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
…ow counts Phase 0.1 gave the QPX views a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is IN it. ParquetDiff gains 'out_tsv', which writes a table out as text sorted by primary key, and four references are pinned against that with FuzzyDiff: the pg view of ProteinQuantifier_19 (48 rows) and _18 (3 rows), and the pg (20 rows) and psm (4 rows) views of IsobaricWorkflow. Text rather than committed Parquet is the whole point. A binary reference can only ever be regenerated wholesale, which is exactly the operation that hides unrelated drift; a text reference is reviewable in a pull request and patchable line by line, and it puts QPX on the same footing as every other reference in the suite rather than inventing a second kind of artefact. The dump reuses the comparator's own canonical key encoding, so it cannot disagree with the comparison about what a primary key is, and it escapes tabs and newlines inside values so one row is always one line. Rows therefore come out in length-prefixed key order - 'TMT126' before 'TMT127C' before 'TMT131' - which looks unsorted but is deterministic and byte-comparable, which is what a reference needs. A file with no derivable key still dumps, in file order, with a warning saying so, because a reference built from it would be sensitive to how the producer ordered its rows. Comparison uses the shared relative tolerance with the absolute one set to ZERO. FuzzyDiff.ini's absdiff of 0.01 exists for "zero vs. epsilon" on unbounded quantities; the QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright - in one fixture 68 of 104 PEPs are <= 0.01, so every one of them would compare equal to every other. Verified, not argued: perturbing a PEP by 0.005 turns the psm reference red, and that is a change the shared absdiff would have absorbed silently. Both references were shown to fail on purpose - a 5% intensity change and the q-value change above - and restored afterwards. Fixtures were chosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML and does no mzML parsing, feature finding, alignment or normalization; IsobaricWorkflow adds only reporter extraction; both keys are float-free. ProteinQuantifier_19's 48 rows are 4 fraction groups x 6 TMT labels x 2 anchors with 12-entry grouped_runs lists - the design melting, fraction-group keying and label assignment that OpenMS#9869/OpenMS#9874/OpenMS#9876 touched - so it now VERIFIES rather than assumes OpenMS#9876's claim that nothing changes at the default 'fractions:aggregate'. The feature view and both ProteomicsLFQ producers are deliberately NOT pinned. The feature key contains a float32 'rt' matched with zero tolerance, and ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the normalization fix that will move them anyway. Part of OpenMS#9864 Phase 0.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…or test mean what it says Three findings from CodeRabbit on OpenMS#9879, all valid. 1. dumpToTsv could forge an escape. A tab is rendered as the two characters '\' 't' to keep one row on one line - but a value that ALREADY contained a backslash followed by 't' rendered to those same two characters. Two genuinely different tables therefore produced identical text and the reference comparison accepted them as equal, which is the exact failure a value reference exists to rule out. The backslash is now escaped first and unconditionally. Verified in both directions rather than assumed: two tables differing only in 'literal backslash-t' versus 'a real tab' now render as X\\tY and X\tY, and with the fix reverted the new regression section fails on TEST_NOT_EQUAL(text_a, text_b) because both collapse to [X\tY]. The section also asserts that neither dump contains a raw tab, which would split a row. None of the four committed references contains a backslash, so none of them moves - checked, and all 51 QPX/ParquetDiff tests still pass against the unchanged files. 2. TOPP_ParquetDiff_8 passed for the wrong reason. It exists to show the row floor applies to the SECOND input, and it did fail - but its two fixtures have disjoint primary keys, so it would have failed on the key mismatch even if 'min_rows' never looked at 'in2' at all. 'schema_only' now removes every other failure cause, leaving the floor as the only thing that can go red. 3. The documented canonical key order was backwards, in both the CHANGELOG and the CMake comment. Length-prefixing puts the six-character 'TMT126' and 'TMT131' ahead of the seven-character 'TMT127C', not 'TMT127C' before 'TMT131'. Full local ctest unchanged at 2826 tests, 9 pre-existing environmental failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
198504a to
61acbbe
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
…reference feature<->PSM (#9864) Every QPX view carries a mandatory int64 identity column that is its primary key -- feature_id, psm_id, pg_id. OpenMS emitted none of the three, so every -out_qpx file was invalid against the current spec. The ids are derived exactly as qpx.core.data.identity derives them: BLAKE2b truncated to 8 bytes over the canonical JSON of a footer-declared identity_composite, read as a signed big-endian int64. Byte-exactness is not cosmetic. `qpxc convert openms` re-derives feature_id for identified rows from that declared composite but never rewrites the psm.feature_id pointing at it, so ids that were merely plausible would turn an OpenMS collection into one with dangling cross-references the moment it was converted -- which qpx's own dataset validation reports as dangling_feature_id. The composites are the ones qpxc already hard-codes for OpenMS -out_qpx input, in that order, so a conversion reproduces what OpenMS wrote. Reproducing Python's float repr is the one genuinely fiddly part, because the feature composite hashes rt and observed_mz as persisted. Verified against the reference implementation on 399,325 float32 values (uniformly random bit patterns, the RT and m/z ranges QPX actually stores, and exact powers of two either side of both fixed/exponential boundaries) and on 60,000 random composites carrying control characters, astral-plane unicode, JSON metacharacters, int64 extremes, nulls and set-valued lists. Zero mismatches. Then end to end: every one of the 747 rows all four producers write re-derives to the id OpenMS emitted. Cross-references: psm.feature_id and feature.psm_ids. A consensus feature emits one row per run, so its identifications are distributed to the row of their own run -- claiming a PSM as evidence for a quantity measured in a different file would be wrong. An unassigned identification keeps feature_id null, as does any psm-only producer. Both directions come out of one pass over the feature rows, which is what makes them reciprocal: qpx validates that a PSM pointing at a feature is listed back by that feature. Measured on the shipped LFQ fixture: 39 consensus features with one identification each produce 39 links, all resolving, while the other 65 identifications are unassigned and correctly null; 23x1 + 11x2 + 5x3 = 60 feature rows confirms the per-run distribution. The scan and run_file_name derivations the two views must agree on were verbatim copies in both exporters. They are now one shared implementation, because the linkage depends on that agreement -- two copies would be one edit away from a collection whose cross-references silently stop resolving. ParquetDiff leaves the identity and cross-reference columns out of both the comparison and the TSV dump, with -with_ids to opt back in. The spec states identity is meaningful within a file only, so comparing a file against a committed reference is a join it tells you not to make; and feature_id hashes rt, so one ULP of platform drift would not shift a digit, it would report every row as missing on both sides. Rows are still matched on the natural key, which degrades gracefully. -schema mode asserts instead what actually matters: the id is present, never null and never repeated. Consequence: zero churn in the references #9879 committed, verified. Verification - QPXIdentity_test pins the derivation against vectors taken from the reference implementation, not from this code's own output. It has failed for a real reason: it caught std::from_chars silently parsing nothing from a '+'-signed exponent. - ConsensusMapArrowExport_test re-derives each row's feature_id from the columns as written, in the declared order, which is what would catch this exporter hashing the right values in the wrong slots. - The cross-reference test asserts resolvability in both directions plus reciprocity, and guards against vacuity -- that guard fired twice on a fixture whose PSMs had no resolvable run, which is exactly what it is for. - Both new ParquetDiff checks were shown to fail on purpose: a table with duplicated ids and one with a null id are each reported, and the unmodified file passes. - Full suite: 8 failures, all in the known environmental baseline (6 CometAdapter version-string, PercolatorAdapter numerics, Doxygen HAVE_DOT). Not in scope: feature.pg_ids. No upstream converter populates it, and the documented semantic join (anchor_protein + run_file_name in grouped_runs + intensities[].label) is already fully available in OpenMS output. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
Audited PRs merged since the last CHANGELOG update (#9881): most of them (#9879, #9880, #9882, #9884, #9886, #9892, #9896, #9898, #9900, #9901, #9888) already carried their own CHANGELOG entries. Only the Docker library-stage fix (#9891) was missing one. Claude-Session: https://claude.ai/code/session_01Jgrv6mFL3oawgLdYs1efPH Co-authored-by: Claude <[email protected]>
Note
Stacked on #9878 — its three commits appear in this diff too. The change under review here is the last commit. Rebases to
developcleanly once #9878 lands.#9864 Phase 0.1, phases 1–2: the QPX views get value references.
#9878 gave them a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is in it.
Text references, not committed Parquet
ParquetDiffgains-out_tsv, which writes a table out as text sorted by primary key. The reference is that text, compared withFuzzyDiff.This is the load-bearing design decision. A committed
.parquetcan only ever be regenerated wholesale — which is precisely the operation that hides unrelated drift, and something this project has been bitten by. A text reference is reviewable in the PR and patchable line by line, and it puts QPX on the same rails as every other reference in the suite rather than inventing a second kind of artefact.Three properties that make it usable as a reference:
canonicalKey_. The dump therefore cannot disagree with the comparison about what a primary key is, and the reference is not hostage to how the producer ordered its rows.Row order looks unsorted —
TMT126,TMT127C,TMT131— because the encoding length-prefixes each value. It is deterministic and byte-comparable, which is what matters; the CMake comment says so.Tolerance: relative only, absolute zero
FuzzyDiff.ini'sabsdiffof 0.01 exists for "zero vs. epsilon" on unbounded quantities. The QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright — inBSA_qpx's psm table, 68 of 104 PEPs are ≤ 0.01, so every one would compare equal to every other.Verified rather than argued: perturbing a PEP by 0.005 — a change the shared
absdiffwould have absorbed silently — turns the psm reference red.The references
ProteinQuantifier_19_qpx_pg.tsvgrouped_runsProteinQuantifier_18_qpx_pg.tsvIsobaricWorkflow_qpx_pg.tsvIsobaricWorkflow_qpx_psm.tsvChosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML — no mzML parsing, no feature finding, no alignment, no normalization. IsobaricWorkflow adds only reporter extraction. Both keys are float-free.
ProteinQuantifier_19's 48 rows are exactly the design melting, fraction-group keying and label assignment that #9869/#9874/#9876 touched — so it now verifies rather than assumes #9876's claim that nothing changes at the defaultfractions:aggregate sum.Both references were shown to fail on purpose (a 5% intensity change, and the q-value change above) and restored afterwards.
Deliberately not pinned yet
The feature view and both ProteomicsLFQ producers. The feature key contains a
float32rtmatched with zero tolerance, so a one-ULP cross-platform drift does not degrade gracefully — it becomes2N"row only in one file" errors. And ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the §A3 normalization fix, which will move them anyway.Full local ctest,
-E "BrukerTims|PASEF": 2826 tests, 9 failures, all pre-existing environmental (6CometAdapterversion-string,PercolatorAdapternumerics,Doxygen_Warning_testHAVE_DOT,ThermoRawFile_test.NET).🤖 Generated with Claude Code
https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
Summary by CodeRabbit
New Features
out_tsvoption to ParquetDiff, allowing exports without a second input file.Bug Fixes
Tests