Repository navigation
[INTERNAL,BUILD] Keep the Arrow-based OpenSWATH and Parquet helpers in libOpenMS - #10247
Conversation
#10239 moved single-consumer helpers from the libraries into their tool folders. For eight of them that also moved a private dependency of libOpenMS into the tool: they are built on Arrow/Parquet (and, for the Percolator scoring, SQLite), so OpenSwathExport, OpenSwathPercolatorScoring, OpenSwathWorkflow, OpenSwathPeakMapExtractor and ParquetDiff had to find and link Arrow, Parquet and SQLite themselves, and three of them included libOpenMS' Arrow-typed internal headers (ParquetFile.h, ZipRandomAccessFile.h), which a standalone build against an installed OpenMS can only reach if those headers are installed too. The tool programs themselves use none of it -- not one arrow:: call in OpenSwathExport.cpp, OpenSwathWorkflow.cpp and the others. All of it sits in helper classes whose interfaces are OpenMS types only. So the helpers go back into the library, behind those interfaces, and the tools link nothing but OpenMS. Rule applied: a helper built on a private dependency of libOpenMS stays in the library even if only one tool uses it. Moved back, to where they were before #10239 (the move is that PR's own patch for these files, applied in reverse, so the content is exactly the pre-move content: OPENMS_DLLAPI and <OpenMS/...> include paths restored, and OpenSwathPercolatorScoring back on the library's SQLite helpers instead of its tool-local copies): ANALYSIS/OPENSWATH OpenSwathMatrixExporter, OpenSwathParquetExporter, OpenSwathResultsExporter, OpenSwathOSWParquetReader, OpenSwathOSWParquetWriter, OpenSwathPercolatorScoring FORMAT/DATAACCESS XIPMParquetConsumer FORMAT ParquetTableComparator Their ten class tests return to class_tests/openms with their original registrations and Arrow/SQLite links; XIPMParquetRoundTrip_test, which #10239 created for the tool folder, joins them, since it tests the library producer against the library reader. XIPMParquetFile_test keeps #10239's independent reader fixtures. The five tool test folders are gone, and each tool CMakeLists is down to find_package(OpenMS) and one executable, with a comment saying why the helpers are not next to it. OpenSwathWorkflow.cpp also included ParquetFile.h without using it (no ParquetFile:: anywhere); dropped. The CHANGELOG entry of #10239, not released yet, now counts 21 headers / 20 implementations and states the rule. Not touched: ParquetFile.h and ZipRandomAccessFile.h stay installed here as on develop; whether they should be is #10223's business, and with this change no tool includes them any more. Checked locally with syntax-only compiles, stubbed generated headers and the Arrow/Parquet 25 C++ headers from the pyarrow wheel: - all five tool programs against a copy of the include tree without ParquetFile.h and ZipRandomAccessFile.h and with no Arrow on the include path (OpenSwathWorkflow failed that on the unused include before it was dropped, which also shows the setup does catch an Arrow dependency); - the eight library sources and all eleven class tests, with Arrow and SQLite; - executables.cmake evaluated with cmake -P: each of the eleven tests is registered exactly once. Nothing was built or run end to end. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (51)
💤 Files with no reviewable changes (5)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughOpenSWATH and Parquet helpers are added to libOpenMS and exported through its public headers. Affected tools now link through OpenMS instead of compiling the helpers and resolving Arrow or Parquet directly. Related class tests are registered in the central OpenMS test configuration. ChangesParquet helper relocation
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to This change moves the Parquet- and SQLite-backed OpenSWATH helpers back into the OpenMS library. The affected tools therefore link only OpenMS, and the related tests move to the central suite. No concrete behavior, build, or data problem was found. The shared SQLite helpers the moved code relies on exist, and they open existing databases as before. A full CI build is still the first end-to-end confirmation. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 43.48% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 32 files. (14 skipped: 14 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. A rabbit checks the headers, neat, Comment |
Six cleanups from reviewing this PR, each checked locally with syntax-only or object compiles against stubbed generated headers and Boost 1.83. PipEcho includes what it uses. GridWithStorage.h no longer includes QTClusterFinder.h just so that Impl.h/Impl.cpp get FeatureMap, ConsensusMap and ConsensusFeature second-hand through BaseGroupFinder.h; Impl.h includes ConsensusMap.h and FeatureMap.h itself. Found by removing the include and compiling all seven PipEcho translation units until they passed again (the two misses were exactly the ones that broke CI on b038fb8), then compiling each of the ten PipEcho headers on its own. EnzymaticDigestion holds a plain RegularExpression. The unique_ptr wrapper and its "use PImpl, since #include cost is huge" comment date from boost::regex; RegularExpression is a pimpl itself, so the second indirection bought nothing. The copy operations become defaulted -- the hand-written ones copied exactly the four data members the class has, and copying a RegularExpression shares its compiled pattern as copying the wrapper did. checkedCast instead of boost::numeric_cast in the 14 files where this PR had added <boost/numeric/conversion/cast.hpp> only to keep numeric_cast working: 9 library sources and the MRMTransitionGroupPicker, OpenSwathAnalyzer, OpenSwathChromatogramExtractor, OpenSwathFeatureXMLToTSV and OpenSwathPeakMapExtractor tools. All 32 calls convert an integer (size() or an index) to int or SignedSize, which checkedCast covers; nothing catches boost::numeric::bad_numeric_cast. The five tools use no other Boost, so they leave the Boost consumer list, and OpenSwathPeakMapExtractor's CMakeLists no longer looks Boost up -- it is identical to develop again, which also keeps it clear of #10247. Checked by compiling the five tools with every Boost header replaced by an #error stub (the previous MRMTransitionGroupPicker.cpp fails that on cast.hpp). IDDataContainer::modify no longer takes a std::function. It is a template that hands the caller's callable to an out-of-line modify_() as a function pointer plus a pointer to the callable, so nothing is copied or allocated per call -- the allocation the performance review measured in addScore and friends. The explicit instantiations export modify_ like the other members (WEAK DEFAULT in the object file, as erase). The in-tree callers' functors do not mutate themselves, so calling the original instead of a copy changes nothing for them. Ran the real IDDataContainer.cpp, instantiated for a minimal record type, against lambdas, a const callable, rvalue and lvalue functors, a std::function, a stateful lambda, OrderedView::modify and a key collision; all pass, also under ASan and UBSan. Not changed, after checking: - Moved-from pimpls. IDDataContainer's null impl_ is its empty state (the default constructor has it too), and erase/modify require an iterator into the container. Every SpectralDeconvolution access to the bitsets is reached through performSpectrumDeconvolution(), which recreates them first; that is now stated where it happens. RandomShuffler checks in both public entry points. Keeping a live Impl in moved-from objects would make the moves allocate and lose noexcept. - The Boost-free consumer test's poison headers. Its own loop writes the 15,634 files of a Boost 1.83 tree in 1.1 s, in a test that then compiles ~900 headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
Brings in #10247, which keeps the Arrow-based OpenSWATH and Parquet helpers in libOpenMS. One conflict: OpenSwathWorkflow.cpp's include of OpenSwathOSWParquetWriter.h, which #10247 moved back to the library path; took develop's side. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
594b1e2 installed the two Arrow-typed internal headers next to the public ones, outside the exported header set, because the OpenSwathExport, OpenSwathPercolatorScoring and OpenSwathWorkflow tool directories included them and can be built against an installed OpenMS. #10247, now merged, moved the Arrow-based helpers those tools used back into libOpenMS, so no tool includes either header any more -- the audit over all 14 standalone tool directories against the private header lists comes back empty. The only remaining users are libOpenMS itself and its class tests, which build against the source tree. So the workaround goes: the OpenMS_installed_private_headers list, its initialisation in includes.cmake, the install loop in src/openms/CMakeLists.txt and the FORMAT/sources.cmake entries. includes.cmake is identical to develop again. CHANGELOG and ExternalCode.doxygen now list ParquetFile.h and ZipRandomAccessFile.h with RationalScan2ImConverter.h as no longer installed, and drop the paragraph about installed-but-internal headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
…10278) Routine check of recently merged PRs against the CHANGELOG's unreleased 3.6.0 section. Fixed two bad-merge artifacts left by earlier automated changelog edits: - A stale, pre-#10247 "Move tool-only helpers" bullet (29 headers) was left duplicated alongside its current replacement (21 headers, Arrow/Parquet helpers staying in the library); removed the stale copy and the orphaned "the registry check (#10216, #10228)." fragment stranded between them, and cited #10247 on the surviving bullet. - #10220's own changelog edit inserted its new sortSpectra bullet into the middle of the existing XIC-native-ID bullet instead of after it, leaving the XIC bullet's "...named \"XIC mz=<m/z>\"" without its citation and a duplicate of that same fragment dangling on its own line below. Restored the XIC bullet with its citation and removed the stray duplicate. Added missing PR citations for entries whose text was already present: #10225 (MassTrace::updateWeightedMeanRT), #10245 (mzIdentML writer PSI-MS cvRef), #10255 (WITH_WNETALIGN default flip to OFF, all three mentions), #10244 (sqMass/SQLite Doxygen contracts), #10265 (dropped Graphviz graphs) and #10264 (vcpkg OpenBLAS fixed CPU target). Added one previously uncited PR to an existing bullet: #10227, a second instance of the same "nightly Bioconda deploy flag renamed upstream" bug class as #10167 (--mulled-test -> --mulled-build-and-test). CHANGELOG-only change; no code touched. Claude-Session: https://claude.ai/code/session_019gE7BRvu8A1retkVw81qNP Co-authored-by: Claude <[email protected]>
Six cleanups from reviewing this PR, each checked locally with syntax-only or object compiles against stubbed generated headers and Boost 1.83. PipEcho includes what it uses. GridWithStorage.h no longer includes QTClusterFinder.h just so that Impl.h/Impl.cpp get FeatureMap, ConsensusMap and ConsensusFeature second-hand through BaseGroupFinder.h; Impl.h includes ConsensusMap.h and FeatureMap.h itself. Found by removing the include and compiling all seven PipEcho translation units until they passed again (the two misses were exactly the ones that broke CI on b038fb8), then compiling each of the ten PipEcho headers on its own. EnzymaticDigestion holds a plain RegularExpression. The unique_ptr wrapper and its "use PImpl, since #include cost is huge" comment date from boost::regex; RegularExpression is a pimpl itself, so the second indirection bought nothing. The copy operations become defaulted -- the hand-written ones copied exactly the four data members the class has, and copying a RegularExpression shares its compiled pattern as copying the wrapper did. checkedCast instead of boost::numeric_cast in the 14 files where this PR had added <boost/numeric/conversion/cast.hpp> only to keep numeric_cast working: 9 library sources and the MRMTransitionGroupPicker, OpenSwathAnalyzer, OpenSwathChromatogramExtractor, OpenSwathFeatureXMLToTSV and OpenSwathPeakMapExtractor tools. All 32 calls convert an integer (size() or an index) to int or SignedSize, which checkedCast covers; nothing catches boost::numeric::bad_numeric_cast. The five tools use no other Boost, so they leave the Boost consumer list, and OpenSwathPeakMapExtractor's CMakeLists no longer looks Boost up -- it is identical to develop again, which also keeps it clear of #10247. Checked by compiling the five tools with every Boost header replaced by an #error stub (the previous MRMTransitionGroupPicker.cpp fails that on cast.hpp). IDDataContainer::modify no longer takes a std::function. It is a template that hands the caller's callable to an out-of-line modify_() as a function pointer plus a pointer to the callable, so nothing is copied or allocated per call -- the allocation the performance review measured in addScore and friends. The explicit instantiations export modify_ like the other members (WEAK DEFAULT in the object file, as erase). The in-tree callers' functors do not mutate themselves, so calling the original instead of a copy changes nothing for them. Ran the real IDDataContainer.cpp, instantiated for a minimal record type, against lambdas, a const callable, rvalue and lvalue functors, a std::function, a stateful lambda, OrderedView::modify and a key collision; all pass, also under ASan and UBSan. Not changed, after checking: - Moved-from pimpls. IDDataContainer's null impl_ is its empty state (the default constructor has it too), and erase/modify require an iterator into the container. Every SpectralDeconvolution access to the bitsets is reached through performSpectrumDeconvolution(), which recreates them first; that is now stated where it happens. RandomShuffler checks in both public entry points. Keeping a live Impl in moved-from objects would make the moves allocate and lose noexcept. - The Boost-free consumer test's poison headers. Its own loop writes the 15,634 files of a Boost 1.83 tree in 1.1 s, in a test that then compiles ~900 headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
594b1e2 installed the two Arrow-typed internal headers next to the public ones, outside the exported header set, because the OpenSwathExport, OpenSwathPercolatorScoring and OpenSwathWorkflow tool directories included them and can be built against an installed OpenMS. #10247, now merged, moved the Arrow-based helpers those tools used back into libOpenMS, so no tool includes either header any more -- the audit over all 14 standalone tool directories against the private header lists comes back empty. The only remaining users are libOpenMS itself and its class tests, which build against the source tree. So the workaround goes: the OpenMS_installed_private_headers list, its initialisation in includes.cmake, the install loop in src/openms/CMakeLists.txt and the FORMAT/sources.cmake entries. includes.cmake is identical to develop again. CHANGELOG and ExternalCode.doxygen now list ParquetFile.h and ZipRandomAccessFile.h with RationalScan2ImConverter.h as no longer installed, and drop the paragraph about installed-but-internal headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
Six cleanups from reviewing this PR, each checked locally with syntax-only or object compiles against stubbed generated headers and Boost 1.83. PipEcho includes what it uses. GridWithStorage.h no longer includes QTClusterFinder.h just so that Impl.h/Impl.cpp get FeatureMap, ConsensusMap and ConsensusFeature second-hand through BaseGroupFinder.h; Impl.h includes ConsensusMap.h and FeatureMap.h itself. Found by removing the include and compiling all seven PipEcho translation units until they passed again (the two misses were exactly the ones that broke CI on b038fb8), then compiling each of the ten PipEcho headers on its own. EnzymaticDigestion holds a plain RegularExpression. The unique_ptr wrapper and its "use PImpl, since #include cost is huge" comment date from boost::regex; RegularExpression is a pimpl itself, so the second indirection bought nothing. The copy operations become defaulted -- the hand-written ones copied exactly the four data members the class has, and copying a RegularExpression shares its compiled pattern as copying the wrapper did. checkedCast instead of boost::numeric_cast in the 14 files where this PR had added <boost/numeric/conversion/cast.hpp> only to keep numeric_cast working: 9 library sources and the MRMTransitionGroupPicker, OpenSwathAnalyzer, OpenSwathChromatogramExtractor, OpenSwathFeatureXMLToTSV and OpenSwathPeakMapExtractor tools. All 32 calls convert an integer (size() or an index) to int or SignedSize, which checkedCast covers; nothing catches boost::numeric::bad_numeric_cast. The five tools use no other Boost, so they leave the Boost consumer list, and OpenSwathPeakMapExtractor's CMakeLists no longer looks Boost up -- it is identical to develop again, which also keeps it clear of #10247. Checked by compiling the five tools with every Boost header replaced by an #error stub (the previous MRMTransitionGroupPicker.cpp fails that on cast.hpp). IDDataContainer::modify no longer takes a std::function. It is a template that hands the caller's callable to an out-of-line modify_() as a function pointer plus a pointer to the callable, so nothing is copied or allocated per call -- the allocation the performance review measured in addScore and friends. The explicit instantiations export modify_ like the other members (WEAK DEFAULT in the object file, as erase). The in-tree callers' functors do not mutate themselves, so calling the original instead of a copy changes nothing for them. Ran the real IDDataContainer.cpp, instantiated for a minimal record type, against lambdas, a const callable, rvalue and lvalue functors, a std::function, a stateful lambda, OrderedView::modify and a key collision; all pass, also under ASan and UBSan. Not changed, after checking: - Moved-from pimpls. IDDataContainer's null impl_ is its empty state (the default constructor has it too), and erase/modify require an iterator into the container. Every SpectralDeconvolution access to the bitsets is reached through performSpectrumDeconvolution(), which recreates them first; that is now stated where it happens. RandomShuffler checks in both public entry points. Keeping a live Impl in moved-from objects would make the moves allocate and lose noexcept. - The Boost-free consumer test's poison headers. Its own loop writes the 15,634 files of a Boost 1.83 tree in 1.1 s, in a test that then compiles ~900 headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
594b1e2 installed the two Arrow-typed internal headers next to the public ones, outside the exported header set, because the OpenSwathExport, OpenSwathPercolatorScoring and OpenSwathWorkflow tool directories included them and can be built against an installed OpenMS. #10247, now merged, moved the Arrow-based helpers those tools used back into libOpenMS, so no tool includes either header any more -- the audit over all 14 standalone tool directories against the private header lists comes back empty. The only remaining users are libOpenMS itself and its class tests, which build against the source tree. So the workaround goes: the OpenMS_installed_private_headers list, its initialisation in includes.cmake, the install loop in src/openms/CMakeLists.txt and the FORMAT/sources.cmake entries. includes.cmake is identical to develop again. CHANGELOG and ExternalCode.doxygen now list ParquetFile.h and ZipRandomAccessFile.h with RationalScan2ImConverter.h as no longer installed, and drop the paragraph about installed-but-internal headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
* [API,BUILD] Remove Boost from installed public headers * Fix CI portability after hiding Boost headers Constrain IDDataContainer equality to equality-comparable records so MSVC can instantiate containers whose records have no operator==. Cover both unsupported equality and supported value comparison in the class test. Include <exception> directly in PeakPickerIM and remove ProSE's unnecessary Arrow header include; its OpenMS helpers accept opaque shared pointers. Rebuilt the core and CLI libraries, affected tools and regression tests on Linux. All 20 selected class and TOPP checks passed, including QPX export. * Keep Arrow and OpenTIMS out of the installed header set Making Boost::boost PRIVATE removed the one public include directory that also carried the rest of the dependency prefix, so installed headers that include a private dependency stopped resolving. OpenSwathWorkflow.cpp failed on every platform with "arrow/api.h: No such file or directory" via ParquetFile.h; the Linux all_verify_interface_header_sets target and the new Boost-free consumer would have hit the same wall for ParquetFile.h and RationalScan2ImConverter.h. Both headers name a private dependency in their declarations -- every ParquetFile helper takes or returns an arrow::Status / Table / Array, and RationalScan2ImConverter derives from OpenTIMS' Scan2InvIonMobilityConverter -- so they join the Xerces and SQLite adapters on OpenMS_private_headers instead of being installed. The readers and writers built on them (XICParquetFile, QPXFile, BrukerTimsFile, ...) stay installed and keep exposing OpenMS types only. OpenSwathWorkflow.cpp never used ParquetFile, so its include is dropped rather than given Arrow; the Boost-free consumer no longer needs the Arrow include directories and now compiles every installed header with nothing but OpenMS' own usage requirements. openms_validate_public_headers rejects an installed header that includes Boost, Arrow/Parquet, Xerces, SQLiteCpp, Eigen, SIMDe or OpenTIMS at configure time, so the next such leak fails where it is introduced instead of on a downstream machine. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Address review findings on the Boost-private change Include <concepts> directly in IDDataContainer_test rather than relying on a transitive include for std::equality_comparable. Document QTClusterFinder's HeapHandles and RandomShuffler's special members; the copy keeps the engine state, a moved-from shuffler reseeds on next use. Reject a NaN probability in binomial_cdf_complement. Every comparison against NaN is false, so the negated range test waved it through to Boost's domain_error policy. Behavior for valid probabilities is unchanged. State getRandomSequence_'s pseudoRNG contract: the draw is reduced modulo the residue count, so the generator sets the distribution, not the index range. The index is in range for any int the generator returns, since the unsigned conversion precedes the modulo. Give ExternalCode.doxygen the file preamble its sibling pages carry, and drop its OPENMS_ADDCXX_FLAGS entry -- that variable was removed, so the page was handing consumers an unsupported instruction. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Keep QT clustering's grid order platform-independent TOPP_FeatureLinkerUnlabeledQT_5_out1 failed on Windows only: the first consensus element's centroid came out at rt=310.033 against the reference's rt=510. The Linux and macOS jobs, and the other 2988 tests, were green. QTClusterFinder::computeClustering_ walks the hash grid with grid.begin()..end() and numbers its clusters in that order, so the container's bucket order decides which of two equally good clusters is picked first. HashGrid used boost::unordered_map with boost::hash, whose bucket policy and hash values are the same on every platform -- which is what let one shared reference file match everywhere. Moving it to std::unordered_map with a std::hash-based PositionHash made both implementation-defined, and MSVC's differ from libstdc++'s and libc++'s. HashUtils.h says as much: reproducible "on the same platform". Restore Boost.Unordered here instead of renumbering the references, so clustering is bit-for-bit what develop produces: the header is now identical to develop apart from a comment and the already-unused <boost/array.hpp>. To keep Boost out of the installed interface, HashGrid.h joins OpenMS_private_headers and QTClusterFinder::Grid becomes an opaque type defined in the .cpp, the same treatment Heap and HeapHandles already get. Installed QTClusterFinder.h no longer includes HashGrid.h, so the pyOpenMS binding and other consumers of the installed headers are unaffected; HashGrid_test links Boost directly. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Include HashGrid where it is used in PipEcho The previous commit made QTClusterFinder::Grid opaque and dropped HashGrid.h from QTClusterFinder.h, which broke the Linux build: PipEcho's GridWithStorage.h names HashGrid<value_type> but only included QTClusterFinder.h, so it had been picking the template up transitively. g++ then resolved grid_index_t and grid_center_t to nothing, and nearby()'s first parameter to const int&. Include HashGrid.h there directly, with the standard headers the file uses, and drop the QTClusterFinder.h include: nothing else in PipEcho comes from it (Impl.cpp includes ProgressLogger.h itself). HashGrid.h is internal now and PipEcho lives under source/, so Boost is fine here. Checked the rest of the surface for the same transitive assumption: no other translation unit names HashGrid<...> or QTClusterFinder::Grid, and hash_value() for DPosition is used only by HashGrid_test, which includes the header itself. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Keep PipEcho's include of QTClusterFinder.h Dropping that include from GridWithStorage.h was wrong twice over: PipEcho also reaches FeatureMap, ConsensusMap and ConsensusFeature through it, via BaseGroupFinder.h, so Impl.h and Impl.cpp stopped compiling on every platform. Restore it next to the HashGrid.h include rather than replacing it, which makes this file's diff against the last green commit purely additive. Also include DPosition.h in QTClusterFinder_test, which names DPosition<2> and had been resolving it through the HashGrid.h that QTClusterFinder.h used to pull in. Feature.h still provides it, but the test should not depend on that. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Fix unusable empty-regex fallback and skip the smatch for boolean searches RegularExpressionAccess::get() returned a default-constructed boost::regex as the fallback for a RegularExpression with no compiled pattern. A default-constructed boost::regex holds no implementation and asserts (release builds: UB) as soon as it is matched against, so `RegularExpression re; re.search(s);` aborts -- reachable from public API and from pyOpenMS, though not from any current in-tree caller (SpectrumLookup::readSpectra guards with `if (!scan_regexp.empty())`). Compile the empty pattern instead, which makes RegularExpression() behave exactly like RegularExpression(""). RegularExpression::search() always built a boost::smatch, even when the caller only wanted the boolean. Take Boost's overload without a match_results when first_match is null -- it is what these call sites used before this PR, and it lets Boost add match_any -- and assign into the caller's string in place rather than through a temporary, so a reused output string keeps its capacity. Measured, so nobody mistakes this for a hot-path fix: on the anchored decoy-affix pattern DBSuitability searches with, match_any is worth 1.01x, i.e. nothing; on an unanchored alternation that misses it is 0.92x, i.e. slower. The ~10% seen on very short inputs comes from not constructing the smatch at all, not from match_any. The point is to skip work, not to speed up matching. Verified equivalent to the pre-PR behaviour over 144 pattern/text/path combinations, including a reused dirty output string and the empty-pattern case. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JuSyPgk7Qeooh6o7D74DGj * Resolve Boost in the tool directories that use it develop moved OpenNuXL and OpenSwathPeakMapExtractor into their own directories, which are meant to build standalone against an installed OpenMS SDK. Both use Boost directly, and they were getting it from the list in src/topp/CMakeLists.txt, which does not run in a standalone build. Resolve it where DecoyDatabase and NucleicAcidSearchEngine already do, in each tool's own CMakeLists, and drop the two from the parent list so exactly one place handles each tool. Only the header-only target is needed: OpenNuXL.cpp uses Boost.Range, NuXLReport.cpp Boost.Math and OpenSwathPeakMapExtractor.cpp boost::numeric_cast. OpenNuXL.cpp also includes <boost/regex.hpp>, but names no regex symbol, so no compiled component is involved; the include is left alone rather than removed here. Also link Boost into NuXLReport_test. That one is not just a standalone gap: openms_add_tool_class_test() links ${OpenMS_LIBRARIES}, which stopped carrying Boost when this PR made it private, and the test compiles NuXLReport.cpp. It would have failed in-tree as soon as develop's NuXL move met this branch. Checked every translation unit outside the libraries that includes a Boost header -- 43 of them -- and each now belongs to a target that links Boost. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Keep ZipRandomAccessFile.h out of the installed header set The rebase onto develop turned configure red on every platform, which is why the wheels failed alongside build-and-test: CMake Error at cmake/install_macros.cmake:109 (message): Installed header include/OpenMS/FORMAT/ZipRandomAccessFile.h includes a private dependency (#include <arrow/io/api.h>). That is this PR's own guard catching a real leak rather than a false positive. develop's #10239 added ZipRandomAccessFile.h to the installed header list, and its Open() returns an arrow::Result<std::shared_ptr<arrow::io::RandomAccessFile>>, so the header cannot compile without Arrow's development files. It joins ParquetFile.h on OpenMS_private_headers for exactly the same reason. Nothing loses access: no installed header includes it, and its consumers all build against the build tree and already resolve Arrow themselves -- ZipRandomAccessFile_test links the Arrow and Parquet targets, and the OpenSwathPercolatorScoring and OpenSwathWorkflow tool directories find Arrow in their own CMakeLists. Scanned all 910 installed headers for the private dependencies the guard covers; this was the only one, so configure should get through in one go. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Install the private headers standalone tools include; fix IDMapper's scan regex Three tool directories that can be built against an installed OpenMS include headers this PR had made private, so their standalone builds failed on a missing file even after 18935de gave them their own Boost lookup: OpenNuXL NuXLReport.cpp -> ANALYSIS/ID/IDBoostGraph.h OpenSwathExport ParquetExporter.cpp -> FORMAT/ParquetFile.h OpenSwathPercolatorScoring OSWParquetReader.cpp -> FORMAT/ParquetFile.h, FORMAT/ZipRandomAccessFile.h OpenSwathWorkflow OSWParquetWriter.cpp -> FORMAT/ParquetFile.h An audit of every standalone tool directory against the real private header lists found exactly these three headers and nothing else. None of them can rejoin the exported HEADERS set: each names Boost.Graph or Arrow types in its declarations, and that set is what the header-set verification and the Boost-free consumer test compile with nothing but OpenMS' own usage requirements. So they stay on OpenMS_private_headers and are additionally installed with install(FILES) next to the public headers, in the OpenMS_headers component, via a new OpenMS_installed_private_headers list. Configure fails if a header on that list is not also private, so the list cannot quietly install a public header twice. Each tool directory already finds and links Boost or Arrow itself. No public header includes any of the three. IDMapper: the TMT/iTRAQ path built its scan regex as RegularExpression{""} and then tested empty() before deriving one with getRegExFromNativeID(). A compiled empty pattern is not empty(), so the fallback never ran, extractScanNumber() found no capture group, and mapping aborted with a ParseError whenever the IDs carry bare integer scan numbers (e.g. Sage). develop had the same bug with boost::regex{""}; this PR only rewrote the line. Declare it default-constructed, and outside the per-feature loop so it is derived once, as the "all scan_ids are of the same structure" comment intends. Checked against the real RegularExpression class and the extractScanNumber logic: the old code throws on "controllerType=0 controllerNumber=1 scan=42", the new one yields 42 and 43 for two features and derives the regex once. No test relies on the throw. CHANGELOG and ExternalCode.doxygen said ParquetFile.h was no longer installed; they now describe the three installed-but-internal headers, and the doc's configure-failure sentence says "public header", which is what the guard scans. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Give NuXLReport a Boost-free grouping API instead of installing IDBoostGraph.h 594b1e2 made OpenNuXL's standalone build work by installing IDBoostGraph.h next to the public headers, outside the exported header set. That ships a Boost.Graph header again and makes every consumer of it bring Boost. NuXLReport only needs one thing from it: the indistinguishable protein groups of a run. Add that as public API with OpenMS types only: static void BasicProteinInferenceAlgorithm::annotateIndistinguishableGroups( ProteinIdentification& proteins, const PeptideIdentificationList& peptides, Size use_top_psms = 1, bool add_singletons = true); It is exactly what NuXLReport did by hand (build the graph over the run's top hits, calculateAndAnnotateIndistProteins) and what run() already does under its "annotate_indistinguishable_groups" parameter, so the class was the natural home and IDBoostGraph stays an implementation detail of the .cpp. The peptides are taken by const reference and copied inside, because the graph holds non-const pointers into them; NuXLReport already made that same copy (with a "TODO: why copy needed?"). NuXLReport calls it with (1, false), the same top-hit, no-singletons setting as before, and no longer names Internal::IDBoostGraph. IDBoostGraph.h is private and not installed again; OpenMS_installed_private_headers keeps only the two Arrow headers the OpenSwath tool directories need. Checked locally with syntax-only compiles against stubbed generated headers and Boost 1.83 (each with a negative control that fails as expected): - BasicProteinInferenceAlgorithm.cpp, and the class test with -Wall -Wshadow (no warning from the test file); - all 12 OpenNuXL sources against a copy of the include tree with all 17 private headers deleted, i.e. what a standalone build sees. The previous NuXLReport.cpp fails that on the missing IDBoostGraph.h; the new one passes. The class test covers the default (top hit, singletons), no singletons, all hits, and the empty case that throws. Its data is built so that a second-ranked hit and a hit from another run would each split the {P1, P2} group if the use_top_psms limit or the run filter were not applied. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Clean up the review findings on the Boost-private change Six cleanups from reviewing this PR, each checked locally with syntax-only or object compiles against stubbed generated headers and Boost 1.83. PipEcho includes what it uses. GridWithStorage.h no longer includes QTClusterFinder.h just so that Impl.h/Impl.cpp get FeatureMap, ConsensusMap and ConsensusFeature second-hand through BaseGroupFinder.h; Impl.h includes ConsensusMap.h and FeatureMap.h itself. Found by removing the include and compiling all seven PipEcho translation units until they passed again (the two misses were exactly the ones that broke CI on b038fb8), then compiling each of the ten PipEcho headers on its own. EnzymaticDigestion holds a plain RegularExpression. The unique_ptr wrapper and its "use PImpl, since #include cost is huge" comment date from boost::regex; RegularExpression is a pimpl itself, so the second indirection bought nothing. The copy operations become defaulted -- the hand-written ones copied exactly the four data members the class has, and copying a RegularExpression shares its compiled pattern as copying the wrapper did. checkedCast instead of boost::numeric_cast in the 14 files where this PR had added <boost/numeric/conversion/cast.hpp> only to keep numeric_cast working: 9 library sources and the MRMTransitionGroupPicker, OpenSwathAnalyzer, OpenSwathChromatogramExtractor, OpenSwathFeatureXMLToTSV and OpenSwathPeakMapExtractor tools. All 32 calls convert an integer (size() or an index) to int or SignedSize, which checkedCast covers; nothing catches boost::numeric::bad_numeric_cast. The five tools use no other Boost, so they leave the Boost consumer list, and OpenSwathPeakMapExtractor's CMakeLists no longer looks Boost up -- it is identical to develop again, which also keeps it clear of #10247. Checked by compiling the five tools with every Boost header replaced by an #error stub (the previous MRMTransitionGroupPicker.cpp fails that on cast.hpp). IDDataContainer::modify no longer takes a std::function. It is a template that hands the caller's callable to an out-of-line modify_() as a function pointer plus a pointer to the callable, so nothing is copied or allocated per call -- the allocation the performance review measured in addScore and friends. The explicit instantiations export modify_ like the other members (WEAK DEFAULT in the object file, as erase). The in-tree callers' functors do not mutate themselves, so calling the original instead of a copy changes nothing for them. Ran the real IDDataContainer.cpp, instantiated for a minimal record type, against lambdas, a const callable, rvalue and lvalue functors, a std::function, a stateful lambda, OrderedView::modify and a key collision; all pass, also under ASan and UBSan. Not changed, after checking: - Moved-from pimpls. IDDataContainer's null impl_ is its empty state (the default constructor has it too), and erase/modify require an iterator into the container. Every SpectralDeconvolution access to the bitsets is reached through performSpectrumDeconvolution(), which recreates them first; that is now stated where it happens. RandomShuffler checks in both public entry points. Keeping a live Impl in moved-from objects would make the moves allocate and lose noexcept. - The Boost-free consumer test's poison headers. Its own loop writes the 15,634 files of a Boost 1.83 tree in 1.1 s, in a test that then compiles ~900 headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Stop installing ParquetFile.h and ZipRandomAccessFile.h 594b1e2 installed the two Arrow-typed internal headers next to the public ones, outside the exported header set, because the OpenSwathExport, OpenSwathPercolatorScoring and OpenSwathWorkflow tool directories included them and can be built against an installed OpenMS. #10247, now merged, moved the Arrow-based helpers those tools used back into libOpenMS, so no tool includes either header any more -- the audit over all 14 standalone tool directories against the private header lists comes back empty. The only remaining users are libOpenMS itself and its class tests, which build against the source tree. So the workaround goes: the OpenMS_installed_private_headers list, its initialisation in includes.cmake, the install loop in src/openms/CMakeLists.txt and the FORMAT/sources.cmake entries. includes.cmake is identical to develop again. CHANGELOG and ExternalCode.doxygen now list ParquetFile.h and ZipRandomAccessFile.h with RationalScan2ImConverter.h as no longer installed, and drop the paragraph about installed-but-internal headers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Check installed headers against an include allowlist openms_validate_public_headers() rejected includes of eight known private dependencies (boost, arrow, parquet, xercesc, Eigen, SQLiteCpp, simde, opentims++) plus nlohmann/json. A dependency added later slipped past it unless someone remembered to extend the list, and even today it missed <sqlite3.h>. It now accepts only what an installed header may rely on downstream: OpenMS/..., the C++ standard library, operating-system headers (sys/..., windows.h, winternl.h) and the public dependencies OpenMP (omp.h) and Crawdad (CrawdadWrapper.h, WITH_CRAWDAD only). A library adds the headers of its own PUBLIC dependencies with the new openms_add_library(... ALLOWED_PUBLIC_INCLUDES) argument; the GUI layer allows Qt that way, so Qt stays out of the core headers. All 929 installed headers of the core, CLI, OpenSwathAlgo, GUI and test-framework layers pass, with WITH_ONNX, WITH_OPENTIMS, WITH_HDF5 and WITH_THERMO_RAW headers included; the GUI headers fail without the Qt allowance. Every private header that includes a third-party header is rejected, including SqliteConnector_impl.h (<sqlite3.h>). The header-set test gets a second negative case, a header that includes an unknown "newdep/api.h" next to allowed includes: it fails with the old denylist and passes now, and only newdep/api.h is reported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Address CodeRabbit's review of the include-allowlist push IDDataContainer allocated its Impl on first insertion, and iterators remember their owner. An end() saved from an empty container therefore stopped comparing equal to end() after the first insert, and decrementing it dereferenced a null owner (a harness around the real IDDataContainer.cpp crashed on exactly that). Boost.MultiIndex keeps such iterators valid. The default and copy constructors now allocate the Impl; only a moved-from container has none until insert(). IDMapper's TMT/iTRAQ fallback for bare scan numbers (e.g. Sage) runs since this PR fixed its never-empty regex. For a WIFF native ID ("sample=1 period=1 cycle=96 experiment=1") the generic single-number regex takes the last number, the experiment, so reference "1" could be attached to the wrong feature. WIFF IDs now go through the accession-based extractScanNumber(), which returns cycle * 1000 + experiment (96001), the convention OpenMS uses elsewhere. A new IDMapper_test section covers Thermo and WIFF IDs against bare scan numbers. annotateIndistinguishableGroups() appended to the run's existing groups, so a repeated call duplicated them. The groups now replace the run's groups, which are restored if grouping throws; the test checks both. CHANGELOG: only the CMake package of a shared build is Boost-free; a static build keeps Boost among its link dependencies. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Document the RegularExpression constructors and accessors CodeRabbit's first review asked for Doxygen on the public members of the new class; only search() had any. The comments state what callers rely on and what is easy to get wrong: a default-constructed expression is empty() and matches like "", while a compiled "" is not empty(); an invalid pattern throws a std::runtime_error (Boost's regex_error derives from it); and assign() does not affect copies made earlier, which share the old compiled state. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Test that binomial_cdf_complement rejects a NaN probability The positive range check that rejects NaN had no test: the section covered only probabilities below 0 and above 1, which the old negated check caught as well. CodeRabbit pointed out that the PR comment claiming a test was wrong. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Build IDDataContainer on std::set and give RandomShuffler a std engine IDDataContainer wrapped a Boost.MultiIndex container with a single ordered_unique index behind a pimpl, with its own out-of-line iterator carrying an owner pointer. That doubled every *Ref handle to 16 bytes and made each iterator step a call across the library boundary, the two costs the performance review of #10223 singled out. A std::set with a transparent comparator does the same job header-only: the record's key members are template arguments, a composite key is a std::tuple and a key prefix (the input file of an observation) compares against the leading key members. Iterators are the set's: 8 bytes, inline. modify() changes a record in place and checks that it still orders between its neighbours; only a key change moves the record (its node, so references stay valid), and a key that duplicates another record's erases the record and returns false, as before. modify() therefore takes the position by reference and leaves it on the record or, after a rejected duplicate, on the next one. The two cleanup() loops that shrink group keys honour that return value instead of dereferencing a possibly erased group. The applied processing steps, the one collection that also keeps insertion order, are an IDSequencedContainer: a std::vector with a linear uniqueness check, a handful of records per result. getStepsAndScoresByStep() returns its lookup view (find, end, modify); no caller iterated the step order. RandomShuffler held boost::mt19937_64 behind a pimpl. std::mt19937_64 is the same generator with the same seeding, and Boost's uniform_int, which keeps the shuffle sequence platform-independent, accepts a standard engine, so the engine is a plain member again and only the index draw stays in the .cpp. The seed-42 golden sequence in MathFunctions_test checks that nothing moved. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg * Find Boost for a TOPP or GUI layer built against an installed OpenMS OPENMS_USE_INSTALLED_LIBRARY (#10339) finds only what the applications need themselves and leaves the libraries' public dependencies to OpenMSConfig.cmake. Boost used to arrive that way; now that it is private to libOpenMS, the installation no longer provides Boost::boost, and the layer's configure failed on the TOPP tools that link it directly (ApplicationLayer_configure: "Target Digestor links to Boost::boost but the target was not found", likewise FeatureFinderMultiplex, FileInfo, FileMerger, ...). The GUI library links it too. The layer finds the Boost headers as the library build does. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg --------- Co-authored-by: Claude <[email protected]>
Description
#10239 moved single-consumer helpers out of the libraries into their tool folders. For eight of them that also moved a private dependency of libOpenMS into the tool: they are built on Arrow/Parquet (and, for the Percolator scoring, SQLite). As a result, OpenSwathExport, OpenSwathPercolatorScoring, OpenSwathWorkflow, OpenSwathPeakMapExtractor and ParquetDiff each had to find and link Arrow, Parquet and SQLite themselves. Three of them also include libOpenMS' Arrow-typed internal headers
ParquetFile.h/ZipRandomAccessFile.h, which a build against an installed OpenMS can only reach if those headers are installed too. That conflicts with #10223, which keeps private dependencies out of the installed interface.The tool programs themselves use none of it: there is no
arrow::call inOpenSwathExport.cpp,OpenSwathWorkflow.cppor the others. All of it sits in helper classes whose interfaces already use OpenMS types only. This PR moves those helpers back into the library behind the same interfaces, so the five tools link nothing but OpenMS.Rule proposed: a helper built on a private dependency of libOpenMS stays in the library, even if only one tool uses it. The other moves from #10239 (QualityControl, CometAdapter, UniPEFF, OpenSwathInfer, …) are unaffected.
What moves back (to where it was before #10239)
ANALYSIS/OPENSWATHFORMAT/DATAACCESSFORMATOPENMS_DLLAPI, the<OpenMS/...>include paths, and OpenSwathPercolatorScoring's use of the library's SQLite helpers instead of the copies it had inside the tool folder.class_tests/openmswith their original registrations and Arrow/SQLite links.XIPMParquetRoundTrip_test, which [INTERNAL,BUILD] Move remaining TOPP-only helpers out of OpenMS libraries #10239 created in the tool folder, joins them because it tests the library producer against the library reader.XIPMParquetFile_testkeeps [INTERNAL,BUILD] Move remaining TOPP-only helpers out of OpenMS libraries #10239's independent reader fixtures.CMakeLists.txtis reduced tofind_package(OpenMS)and one executable, with a comment explaining why the helpers are not next to the tool.OpenSwathWorkflow.cppincludedParquetFile.hwithout using it (noParquetFile::anywhere). That include is removed.Not changed here:
ParquetFile.handZipRandomAccessFile.hremain installed, as on develop. With this PR no tool includes them any more, so #10223 can keep them internal and drop the workaround it currently needs to install them.Verification
This was checked locally with syntax-only compiles, using stubbed generated headers and the Arrow/Parquet 25 C++ headers from the pyarrow wheel. Nothing was built or run end to end, so CI is the first full build.
ParquetFile.h/ZipRandomAccessFile.hand with no Arrow headers on the include path. OpenSwathWorkflow failed this check on the unused include before it was removed, which also shows the setup catches an Arrow dependency.executables.cmakewas evaluated withcmake -P: each of the eleven tests is registered exactly once.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg
Generated by Claude Code
Summary by CodeRabbit