Repository navigation
exports: restore or explain the remaining names of #2; check the reachable export set in CI - #11
Merged
Conversation
…chable Restored: - functional imports function: overloaded_function takes its targets as boost::function. The edge was invisible to the generator (partial specializations, includes inside the library's own detail/ headers). - concept_check owns boost/concept_archetype.hpp (regex reaches the archetypes again; concept_check exports them for the first time). - utility owns boost/call_traits.hpp (wave reaches call_traits again); variant imports utility for it. Declared, with the reason, by the new policy rule [[unreachable]] and listed in skipped.txt: names of include-only libraries (MPL, Parameter, Fusion) that the pre-#1 generator listed again for every specialization it met, two Container implementation details, and the names of the headers cobalt and geometry leave out. skipped.txt also names the target of each skip-directive, and a drop by the spelling an importer loses (boost::size, not std::size).
…reason gen_exports.py --check proves the committed lists are what the generator writes; it cannot see that they lost names (mcpplibs#5 lost nine with verify-scripts green). check_reachable.py compares what each module's importers reach with 9953323 (main before #1) and with the CI base. A lost (module, name) pair must be explained in skipped.txt by the module it went from: a drop, an unreachable, or a skip-directive whose target still has the name. An entry for a name the module does reach is an error. verify_generated.py runs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2. Follows #9 and #10: the third and fourth acceptance criteria, i.e. the small groups that were not analysed and the reachable-export check in verify-scripts.
Problem
Measured per module against
99533232(main before #1), 72 (module, name) pairs (37 names) outside the three detail groups of #10 were still lost at the modules they came from: #2's small groups, plus nine names #5 lost afterwards with verify-scripts green (boost::size, three of cobalt'smain.hpp, five of geometry'sboost_fusion.hpp).Most of them have one cause. The pre-#1 generator keyed entities by libclang USR, and a specialization named in a signature has its own USR (
function<int(int)>isc:@N@boost@S@function>#FI(#I), the primary isc:@N@boost@ST>1#T@function), so it was taken for an unclaimed entity and its name was exported again. I confirmed this by running the oldclosure_fromon a synthetic TU. Since #1 a name belongs to the first module that claims it, and the accidental duplicates are gone. The question per name is therefore who should own it and whether the module's dependency on it is real.Criterion 3: each small group
boost::functionassignable_archetype,copy_constructible_archetype,null_archetypeboost/concept_archetype.hppboost::call_traitsboost/call_traits.hpp; variant imports utilityboost::mpl×14,mpl::aux×2boost::parameter×4fusion::dequecontainer::(make_)transform_iteratorcobalt::main,main_promise,signal_helperfusion_adapt_detail×3,mpl::count_if,mpl::aux::next_ifboost::sizedrop, now recorded asboost::sizeinstead ofstd::sizeoverloaded_function's constructor takesboost::function; the archetypes are Boost.ConceptCheck's andcall_traitsis Boost.Utility's, and those two modules did not export them at all, because the first library to include the header (iterator, variant) claimed them. Upstream's CMake links functional → function and variant → utility as well.libs/<lib>(documentation, examples, tests) of the official 1.92.0 archive (pinned SHA-256) for each of these 56 pairs. Two matched: accumulators' reference showsparameter::keywordas the type of static members, and hana's Fusion example, which includes<boost/fusion/...>itself.mpl::aux::template_arityandmpl::order_implhave no skipped.txt entry, and flyweight'sdropof theparameternames does not explain why heap, lockfree and graph lost them.The explanations are a new policy rule,
[[unreachable]](reason,names = {name = [module, ...]}). It only writes<lib> unreachable <name> -- <reason>lines to skipped.txt.Criterion 4:
tools/ci/check_reachable.pyverify_generated.pyruns it aftergen_exports.py --check, on all three hosts. It compares what each module's importers reach (its own.incplus everything itexport imports) with two baselines:99533232, and the CI base (merge base of a pull request, previous head of a push), so a name added after #1 is protected as well. A lost name must be explained in skipped.txt:skip-directivecovers only the spelling through the directive:<ns>::Xmay go only while<target>::Xis still reachable. skipped.txt names the target for this.unreachableentry (the module does reach the name) is an error, and so is a module that disappeared.Not seen by the check: names declared in
src/*.cppmitself, what is behind a name, and the#ifaround an export (guards have their own skipped.txt lines).Output
No module loses a name compared with main. 74 archetype names move from iterator to concept_check, 3 from variant to utility. New edges: functional → function, variant/bimap/serialization → utility.
mcpp.tomlimpliesfollows.algorithm.depsloses its direct function edge, which is now transitive (range→functional); its facade still imports function.Rejected
dropno longer claims names no library owns (flyweight's drop keepsboost::parameternames out of every later module). I generated it: heap gets its three names back, lockfree and graph still cannot reach them, and heap and statechart additionally export 57 implementation details.boost::mpl/boost::parameterby namespace: the next loss there would be silent again.More in the design record,
.agents/docs/2026-11-29-reachable-exports-design.md.Side finding (not addressed)
The include edges do not read a library's own
detail/headers. Going by the transitive closure, 56 such edges are in no.deps(e.g. numeric → units, gil → filesystem). Whether an importer needs each one has to be looked at separately.Verified locally
tools/ci/verify_generated.pyend to end (patch replay,gen_exports.py --checkwith every library regenerated, the new check,gen_features.py --check, the audits).tools/tests: 76 tests, 19 new.mcpp testwith group A's features: gcc@16.1.0 417/417, llvm@22.1.8 417/417.tests/{functional,concept_check,utility}.cppandtests/regex/smoke.cppfail to compile against main's exports (llvm); the one intests/variant.cpppasses on both and keepscall_traitsreachable after the move.export import, a removeddll::fsname, a removedunreachableline, the removedcore drop, a stale entry,ublas::matrixremoved from numeric, a removed module. Each is reported at the right module. On Module test hardening: tests/<lib>/ suites, conversion module, export fixes #5's tree it reports 912 unexplained losses.