Repository navigation
Make Boost a private dependency of the shared OpenMS library - #10223
Conversation
|
Generated by Claude Code |
|
Generated by Claude Code |
0fe2de6 to
88972f7
Compare
|
|
@jpfeuffer (updated to the current state; the original reply is in the edit history)
Generated by Claude Code |
|
Outdated — superseded by the answer above. The original text is in the edit history. |
#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. Claude-Session: https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg Co-authored-by: Claude <[email protected]>
| /// mass bins that are targeted for FLASHIda global targeting mode | ||
| boost::dynamic_bitset<> target_mass_bins_; | ||
| /// Value-semantic holder for the implementation's bitsets. | ||
| struct OPENMS_DLLAPI Bitsets |
There was a problem hiding this comment.
@t0mdavid-m this indirection (pImpl) is needed to get it out of the header
The README told every consumer to have Boost headers, with the version read from _openms_boost_version in OpenMSConfig.cmake and a 1.81.0 fallback. Once Boost becomes a private dependency of the shared library (#10223), the package file has no such entry and a consumer needs no Boost at all, but the fallback would still have claimed Boost 1.81.0 or newer. The Boost line is now decided by the installed OpenMSConfig.cmake: an _openms_boost_version entry gives the version requirement (with the package file's own 1.81.0 fallback for an empty value), no entry gives "No Boost". So the README is right whichever of the two changes lands first. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01ThEP3zHLTqSAe1oQNcpHwK
This comment was marked as resolved.
This comment was marked as resolved.
|
Outdated — resolved CodeRabbit follow-up. The original text is in the edit history. Generated by Claude Code |
|
Outdated — resolved CodeRabbit follow-up (NaN test added). The original text is in the edit history. Generated by Claude Code |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
git rev-parse --short HEAD
fd '^(MathFunctions_test\.cpp|MathFunctions\.cpp)$' src
ast-grep outline src/tests/class_tests/openms/source/MathFunctions_test.cpp --match 'binomial_cdf_complement|quiet_NaN' || true
ast-grep outline src/openms/source/MATH/MathFunctions.cpp --match 'binomial_cdf_complement' || true
rg -n -C 7 'quiet_NaN|binomial_cdf_complement|!\(p >= 0\.0 && p <= 1\.0\)' src/tests/class_tests/openms/source/MathFunctions_test.cpp src/openms/source/MATH/MathFunctions.cpp
git show --stat --oneline fa5bc26 -- src/tests/class_tests/openms/source/MathFunctions_test.cpp src/openms/source/MATH/MathFunctions.cppLength of output: 7374
✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
5b35d20 to
a47bcd0
Compare
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.
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
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
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
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
…rches
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
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
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
…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
…stGraph.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
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
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
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
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
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
a47bcd0 to
170bc0f
Compare
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
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
|
any concerns? otherwise I will go forward with this |
#10223 made Boost a private dependency of the shared OpenMS library, so OpenMSConfig.cmake resolves it only for a static export, which the SDK never is. package_sdk.sh no longer reads a Boost version off the package file; the README states "No Boost" unconditionally. Should the package file ever require Boost from every consumer again (an unconditional find_dependency or _openms_boost_version at its top level), the script stops instead of shipping a README that says otherwise. The CHANGELOG entry follows. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01ThEP3zHLTqSAe1oQNcpHwK
Description
Makes Boost a private dependency of the shared OpenMS library, so installed headers and the CMake package of a shared build no longer need Boost. Builds on #10311, which made Boost header-only but kept it public because 33 installed headers included it.
boost::regexparametersOpenMS::RegularExpression(pimpl overboost::regex)IDDataContainer, header-only overstd::set;IDSequencedContainerfor applied processing stepsdynamic_bitsetstd::vector<bool>; pimpl in SpectralDeconvolutionnumeric_castOpenMS::checkedCaststd::mt19937_64inRandomShuffler(same sequence);std::functionin MRMAssayflat_map(MetaInfo)std::vector.cpp/std::viewsfibonacci_heap,HashGrid,IDBoostGraphBasicProteinInferenceAlgorithm::annotateIndistinguishableGroups()for NuXLReportHashGrid.hkeeps Boost.Unordered so QT clustering stays identical on every platform. Arrow/OpenTIMS headers (ParquetFile.h,ZipRandomAccessFile.h,RationalScan2ImConverter.h) are no longer installed. Code that uses Boost directly linksBoost::boostitself (TOPP tools, tests, OpenNuXL, the application layer of #10339).Guards: a configure-time allowlist rejects any installed-header include other than OpenMS, the standard library, OS headers and declared public dependencies (Qt for the GUI).
TestExternalCodeNoBoostbuilds a consumer against the install with Boost headers stubbed out.Fixes on the way: IDMapper's integer scan-number fallback for TMT/iTRAQ never ran (also on develop);
IdentificationData::cleanup()dereferenced a group erased bymodify();binomial_cdf_complementaccepted NaN.Breaking C++ API/ABI: rebuild downstream code.
IDDataContainer::modify()takes the position by reference.Tested: CI, and locally the full build with GUI,
all_verify_interface_header_setsand all 3000 ctests incl. installed-consumer and application-layer tests (conda-forge deps, GCC 15,3a90e35).Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01NR333nLd3McuJgH9doFntg