Repository navigation
[TEST,FIX] QPX: assert schema and a row-count floor instead of file existence (#9864 Phase 0.1) - #9878
Conversation
…ence Every assertion OpenMS made about its QPX Parquet output was an existence check. All 19 were 'cmake -E sha256sum <file>', which prints a hash and compares it to nothing, so the only property asserted was that a file had been created. No value, no column and no row count on the QPX exchange surface was compared against anything. The gap is demonstrable, not theoretical: TOPP_ProSE_3_qpx_pg_exists passed on a pg table holding ZERO rows. Feed a correctly shaped but empty pg table - same schema, same metadata - to the old check and it exits 0. It persisted because there was no instrument. FuzzyDiff is string-based and cannot read Parquet, and the convert-to-text idiom used for .idparquet, .featureparquet and .consensusparquet has no route for the QPX views, since OpenMS has no QPX reader. ParquetDiff supplied the instrument; no assertion used it. ParquetDiff gains 'min_rows', a row-count floor checked in both comparison and schema mode. It closes the one gap neither covers: an empty table satisfies any schema, and two empty tables compare equal, so neither can tell a correct table from a correctly shaped nothing. '-1' disables it; '0' is accepted and always passes, to record deliberately that a table is expected to be empty. All 19 checks now validate against the built-in QPX schema for their view and require a floor. Floors are minima, not equalities: they catch row loss while tolerating gain. They are plain integers in CMakeLists rather than committed binary references - deliberately, because a binary reference can only ever be regenerated wholesale, which is the operation that hides unrelated drift. The one remaining sha256sum is a non-Parquet YAML smoke test. Three ParquetDiff self-tests cover the floor itself: satisfied, violated by one (WILL_FAIL), and violated on the SECOND input only, since it must apply to both. ProSE's empty pg tables are recorded as 'min_rows 0' with the reason in place. pg rows come only from getIndistinguishableProteins(), and this invocation opens neither of ProSE's inference gates - ProSE_1.ini sets 'decoys=ignore' and leaves 'FDR:protein' at 0, and a single '-in' is passed - so zero is correct for the configuration. Whether ProSE should write a 0-row file at all is a contract question, filed rather than silently pinned. A produced-vs-produced check additionally asserts that merging its single run is the identity: the four existing checks covered only two distinct artefacts, which was an unstated coincidence. Three comments asserting the obsolete rationale are corrected. "Not byte-reproducible" was true and irrelevant: ParquetDiff compares schema and values, not the per-run uuid and creation_date. Part of OpenMS#9864 Phase 0.1. Values on this surface cannot be pinned until something compares them, and the normalization fixes queued behind it each have to record a numeric delta. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…inistic The floors landed at the exact observed row count. That is right for the ProteinQuantifier and IsobaricWorkflow producers, which read a committed consensusXML and do no feature finding, but wrong for the two ProteomicsLFQ ones: they find features in mzML, and feature counts legitimately differ a little between compilers and architectures - CI covers five. A floor tight enough to pin the count would report that variance as a regression. Those six are now set at roughly three quarters of the observed count, with the reasoning recorded in place. The floor's job is to catch collapse, which is what an existence check could not do at all; pinning a count is the job of a value reference, deliberately a later phase. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…ferred pg rows come only from getIndistinguishableProteins(), and ProSE infers proteins in exactly two places: single-file finalization, gated on 'FDR:protein' > 0 AND decoys, and the merged path, gated on '-out_merged' with more than one input. An identification-only run - the default, since 'FDR:protein' is 0 and decoy handling may be 'ignore' - opens neither gate and produced a schema-valid pg table holding zero rows. That file is indistinguishable to a consumer from "inference ran and found nothing", which is a different claim. Both the per-input '<basename>.pg.parquet' and the merged 'quantms.pg.parquet' are now omitted in that case, and the reason is logged at INFO naming the two settings that would produce groups. The psm files are unaffected, and the parameter documentation for '-out_qpx' now states the condition instead of promising the files unconditionally. Verified in both directions: an identification-only run writes only the two psm files, while '-Search:decoys generate -Search:FDR:protein 0.05' still writes both pg files with 3 rows each. The suppression is conditional on there being nothing to report, not blanket. The tests assert the ABSENCE, via sha256sum + WILL_FAIL - sha256sum errors on a missing file, so a failing hash is exactly "this file is not there". They go red in both directions: if ProSE starts writing empty pg files again, and equally if it starts inferring groups here. Each QPX producer also now clears its output directory first. ctest never cleans TESTS_TEMP_DIR, so a producer that crashed left the previous run's Parquet on disk for the assertions to read, and they passed on it - the same hole existed under sha256sum, but a value assertion invites more confidence in the result. This was not hypothetical: it surfaced the moment ProSE stopped writing its empty pg files and the stale ones from an earlier run kept the absence check red. 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
06838f5 to
cec0d5a
Compare
|
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 selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughProSE omits empty QPX protein-group files and logs the reason. ParquetDiff supports minimum row-count validation. TOPP tests validate QPX schemas and data, remove stale outputs, and verify merged-output identity. ChangesQPX validation and output behavior
Sequence Diagram(s)sequenceDiagram
participant ProSE
participant QPXFiles
participant ParquetDiff
ProSE->>QPXFiles: Write non-empty QPX tables
ProSE->>QPXFiles: Omit empty protein-group tables
ParquetDiff->>QPXFiles: Validate schemas and minimum row counts
ParquetDiff-->>QPXFiles: Return validation status
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 |
The empty-pg check in ProSE called qpx_pg_table->num_rows() directly. That links on Linux and macOS and fails on MSVC: ProSE.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __int64 __cdecl arrow::Table::num_rows(void)const" referenced in function ProSE::main_ Arrow is deliberately confined to libOpenMS' implementation so that binaries linking libOpenMS need not import Arrow symbols - the note on ParquetTableComparator says so, and ProSE.cpp's own include is annotated "only for std::shared_ptr<arrow::Table> declarations". A member call is not a declaration. On Windows those symbols are dllimport, so the rule is enforced by the linker; on Linux nothing catches it. ArrowIOHelpers::tableRowCount() keeps the Arrow call inside the library. It returns 0 for a null table, so the caller's null check and its emptiness check collapse into one condition. No behaviour change: an identification-only run still writes only the two psm files and logs the same reason, and no other TOPP tool calls an Arrow member directly (checked). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…feature (#9881) The 3.6 section had grown to 217 KB (22x the 3.5 section), mostly because recent entries were appended verbatim as PR-body-style root-cause writeups, with newest entries prepended to "General:" regardless of topic. Collapse incremental/superseded PR chains into one entry per feature: - QPX Parquet export: ~30 entries across #9692-#9878 (long-format conversion, run_file_name resolution, validation, transactional writes, streaming/parallel build) reduced to a 6-item block. The export is new in 3.6, so the intermediate fixes never shipped to users. - ProteinQuantifier/PeptideAndProteinQuant: the per-assay grain change, fractions:aggregate, best_charge rename, the same undetected-peptide aggregation defect fixed at three levels, and the perf work bundled. - pyOpenMS nanobind lifetime/use-after-free work (#9792, #9794, #9795). - ProSE: 30 entries down to 17, grouped by search modes, calibration, FDR, Percolator and FragmentIndex. - Bruker TimsTOF, IMAGING, ThermoRawFile and the native Parquet formats each get one nested block instead of scattered entries. - ~20 near-identical per-tool ".idparquet/.featureparquet support" and "Thermo .raw input" entries folded into "TOPP tools > all:". Remove exact duplicates (ProteinQuantifier -ratios removal, Annotation1DItem DLLAPI, ConsensusMapArrowExport streaming, macOS pkg notarization, Qt removal steps duplicated between General/Dependencies/Build System, IsoelectricPoint and IMAGING multi-region duplicated between General and OpenMS Library). File misplaced entries into the sections they belong to and add a GUI tools section, matching the structure used by 3.5 and earlier releases. Net: 217 KB -> 82 KB with all 440 distinct PR references preserved; the five dropped refs are CI-internal test guards and a historical bug reference. Claude-Session: https://claude.ai/code/session_01DWGycgSTyEwPbaBgffw8LJ Co-authored-by: Claude <[email protected]>
#9864 Phase 0.1: the first assertion on the QPX surface that isn't an existence check.
The gap
All 19 QPX assertions in
src/tests/topp/CMakeLists.txtwerecmake -E sha256sum <file>— a hash, printed and compared to nothing. The only property asserted was that a file had been created. No value, no column and no row count on the QPX exchange surface was compared against anything.It is demonstrable, not theoretical. Feed a correctly shaped but empty pg table — same schema, same file metadata — to the old check:
TOPP_ProSE_3_qpx_pg_existswas passing on a genuinely 0-row table.It persisted because there was no instrument:
FuzzyDiffcannot read Parquet, and the convert-to-text idiom used for.idparquet/.featureparquet/.consensusparquethas no route for the QPX views, since OpenMS has no QPX reader. #9865 suppliedParquetDiff; nothing used it.What this adds
ParquetDiff -min_rows— a row-count floor, checked in both comparison and schema mode. It closes the one gap neither covers: an empty table satisfies any schema, and two empty tables compare equal.-1disables it;0is accepted and always passes, to record deliberately that a table is expected to be empty.All 19 checks now validate against the built-in QPX schema for their view and require a floor. The only remaining
sha256sumin the file is a non-Parquet YAML smoke test.Floors are minima, not equalities — they catch row loss while tolerating gain, and they are plain integers in CMakeLists rather than committed binary references. That is deliberate: a binary reference can only ever be regenerated wholesale, which is the operation that hides unrelated drift. Pinning values is a later phase.
The ProteinQuantifier and IsobaricWorkflow floors sit at the observed count — those read a committed consensusXML and do no feature finding. The two ProteomicsLFQ floors sit at ~75% of observed, because that tool finds features in mzML and counts legitimately differ a little across the five CI platforms; a floor tight enough to pin the count would report that variance as a regression.
Three ParquetDiff self-tests for the floor: satisfied, violated by one (
WILL_FAIL), and violated on the second input only — it must apply to both.ProSE no longer writes an empty pg file
Investigated rather than pinned. pg rows come only from
getIndistinguishableProteins(), and ProSE infers proteins in exactly two places: single-file finalization, gated onFDR:protein> 0 and decoys, and the merged path, gated on-out_mergedwith more than one input.ProSE_1.inisetsdecoys=ignoreand leavesFDR:proteinat 0, and the test passes a single-in— so neither gate opens and zero rows is correct for the configuration.Writing the file anyway produced a schema-valid table saying "no protein groups", which a consumer cannot tell apart from "inference ran and found none". Both pg files are now omitted and the reason logged, naming the settings that would produce groups.
Conditional, not blanket — verified both directions: an identification-only run writes only the two psm files;
-Search:decoys generate -Search:FDR:protein 0.05still writes both pg files with 3 rows each.The tests assert the absence (
sha256sum+WILL_FAIL—sha256sumerrors on a missing file, so a failing hash is exactly "not there"), and go red in both directions.A hole this surfaced
ctestnever cleansTESTS_TEMP_DIR, so a producer that crashed left the previous run's Parquet on disk for the assertions to read — and they passed on it. The same hole existed undersha256sum, but a value assertion invites more confidence in the result.Not hypothetical: it fired the moment ProSE stopped writing its empty pg files and the stale ones from a run 16 minutes earlier kept the absence check red (psm rewritten at 14:12:49, pg still dated 13:56:30). Every QPX producer now clears its output directory first.
Notes for review
_existsnames — the new assertion is a strict superset of existence, so the name is understated rather than false, and renaming would break CDash history for no functional gain. The two ProSE pg checks are renamed to_absent, because there the old name would be flatly wrong.QPXFile_testandProteinGroupArrowExport_testalready assert QPX values, but on hand-built maps. They cannot detect a change in ProteomicsLFQ's or ProteinQuantifier's numbers reaching QPX, which is what §A3 and §A4 will move.Full local ctest,
-E "BrukerTims|PASEF": 9 failures, all pre-existing environmental (6CometAdapterversion-string,PercolatorAdapternumerics,Doxygen_Warning_testHAVE_DOT,ThermoRawFile_test.NET) — unchanged from the baseline.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
Summary by CodeRabbit
min_rowsoption to require minimum row counts during Parquet comparisons and schema checks.