Repository navigation
Conversation
Gecode 7 replaces the master() and slave() Space hooks with hub() and spoke() for both restart-based and portfolio-based search. Internal PBS runnables become spokes, their back-pointer the portfolio, and the wrapped engine the engine.
The MetaDispatch tests check which hook RBS and PBS call, how often, and for which restart reason or asset, with each hook overridden alone and together. They also check that RBS honours the hub() restart decision and the spoke() completeness result, that no-goods reach the hub, that stopped engines delete every clone, and that BAB incumbents reach the hub and spoke spaces through RBS, PBS, and PBS over RBS. The Sol model gains a spoke() override.
Configuring with tests compiles a space overriding hub() and spoke(), and then requires spaces overriding master() or slave() to fail, one hook at a time. The pass fixture is also built into the test library. The new hub-spoke example shows both overrides and the Gecode 6 names they replace.
The Gecode 7 migration notes give the hook rename, its unchanged timing and defaults, and the risk of a renamed hook declared without override. The terminology contract records the role definitions, both engine lifecycles, and the names considered and rejected. The README links the migration notes, and the changelog records the breaking change.
Space now declares master() and slave() as deleted virtual functions. A non-deleted function cannot override a deleted one, so a Gecode 6 override fails to compile even without override, where it used to compile and never be called. The configure-time try_compile checks become two CTest cases that build EXCLUDE_FROM_ALL object libraries: one overrides hub() and spoke() and must build, the other overrides slave() without override and master() with it, and must fail. The failing case requires the passing one, so a broken setup cannot make it pass. The pass fixture leaves the test library.
The notes now start with what a port needs: rename the overrides, keep their signatures, and rely on the compiler to find old ones. Short semantics follow, including that a spoke is a disposable clone rather than a long-lived peer, and pointers to the crossword, photo, and qcp examples. The terminology contract shrinks to the wheel picture in the notes. The hub-spoke example goes: its overrides only called the defaults, and with several assets it printed unassigned solutions.
The probing phase clones its root space for each DFS probe, and the dichotomic phase clones the model for each bounded search before giving it to RBS. Neither space plays a meta-search role, so the rename to hub misdescribed them.
Hub and spoke name Spaces, but the rename also called the per-asset engine wrappers in sequential and parallel PBS spokes. They now use the existing public PBS word: Asset, assets, n_assets, and asset_stop, and make_rbs_engine takes its leaf engine as engine. Space variables keep the names hub and spoke. The sequential Asset::init declaration and definition use the same parameter names, and the stat members describe what they hold.
The hub() and spoke() documentation now matches the engines. RBS also calls spoke() when search starts and ignores that result. The default RBS hub() constrains with the last solution, if any, posts the no-goods, and returns true. The hub's result counts only after a solution, and returning false then skips spoke(). The default PBS hub() removes all branchers, so spoke() must post each asset's branching. The RBS and PBS class comments point to these functions.
PBS spoke-only models now post their branching in spoke(), as the default hub() requires, and every PBS dispatch case checks that its solution is assigned. A new case keeps that branching out and expects an unassigned solution, showing that the default hub() removes the model's branchers. Another case makes the first RBS spoke reach the cutoff and checks the exact hub() and spoke() calls of a limit restart. A parallel case records that PBS runs only as many assets as it has threads. The rename had added a no-op spoke() override to an existing test space; it is gone. The new enums use PascalCase constants, and the SEB portfolio test names its thread counts and options for the portfolio and the assets.
The single fail fixture overrode slave() without override and master() with it. The master() override fails even if Space no longer deletes the old hooks, since override then names no virtual function, so the test could never catch a lost deletion. Split it into hub-spoke-api-fail-master and hub-spoke-api-fail-slave. Each is the pass fixture with one hook replaced by an old override without override. The tests now require the deleted-function diagnostic of Clang or GCC instead of any failure; MSVC words it differently, so there they only require the build to fail. Both still require the pass test.
The Ninja job's Check step selected only build-gecode-test and test, so the compile tests for the meta-search hooks never ran in CI.
If the hub fails after hub(), RBS ends. The last PBS asset searches the hub itself, so its spoke is the hub or a clone of it, not always a clone.
Drop the origin of the names and the comparison with other solvers, and say which space each hook runs on.
This was referenced Nov 20, 2026
This branch has not been deployed
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.
Gecode 7 renames the meta-search hooks
Space::master()andSpace::slave()toSpace::hub()andSpace::spoke(). Both RBS and PBS call them at the same points as before and keep the same default behavior.I kept the rename in its own PR ahead of #283 so reviewers can look at the name change separately from the protocol changes. #283 changes the hook signatures again and removes
MetaInfo, at which point the deleted declarations and compile-fail tests added here go away because old overrides fail to compile on their own.Most of the diff is the mechanical rename, with a few supporting changes around it:
Spacedeclares the oldmaster()andslave()hooks as deleted virtual functions. Without that, a Gecode 6 model that wrotebool slave(const MetaInfo&)withoutoverridewould still compile and silently never be called, turning LNS into plain restarts. With deleted declarations, both old hooks fail at compile time. Two CTest compile-fail cases verify this (one per hook) and run in the Ninja CI job.Asset,n_assets,asset_stop), matching the public PBS vocabulary. Hub and spoke refer strictly to spaces.job-shopnow names its cloned spacesrootandmodel, because neither plays a meta-search role.hub()andspoke()spell out when RBS and PBS call each hook and which space each runs on, anddocs/gecode-7-migration.mdsummarizes what downstream code needs to update.MetaDispatchtests check which hook RBS and PBS invoke, how many times, and for which restart reason or asset.Tested locally: Search passes 25,848 of 25,848 tests.
Stack
Merge in this order. #242 targets
main, and each later PR builds on the one before it so its diff shows only its own commits. The first four PRs are standalone search and random-number changes; #284 through #274 are the Gecode 7 changes split out of what used to be a single branch.