Skip to content

Provisional: non-mutating solution comparison for Gecode 7 (breaking changes) - #242

Draft
zayenz wants to merge 14 commits into
mainfrom
feature/comparison
Draft

zayenz wants to merge 14 commits into
mainfrom
feature/comparison

Conversation

@zayenz

@zayenz zayenz commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Provisional design for Gecode 7 or another release permitting breaking changes. Not ready to merge or suitable for Gecode 6.x: Space::compare() changes the ABI, and custom optimization models must implement it alongside constrain().

Add a read-only comparison returning better, equivalent, worse, or incomparable. BAB, RBS, and portfolio search use it to rank independently produced solutions; constrain() continues to prune working spaces. Convenience models and FlatZinc implement comparison.

The current engines reject incomparable solutions. That policy and the migration contract remain under review. Comparison failures reach the controlling caller; public engines must then be destroyed and recreated.

Relevant search and objective tests pass locally with and without threads. The full search matrix and other platforms were not verified locally.

Zdev-Change-Id: Zd450758a16d392690607cf153a5160083ad5c3a5cd6812f461a16610075fc80a
…iness

Zdev-Change-Id: Z5c772894bb48c0852974820982b13020d663b002850618c6bcba63a53e9e4571
Zdev-Change-Id: Zd3bd5210f7a14908a3b4cf47a040ce93d4488f82ec178872c8b90824895e3f87
Zdev-Change-Id: Z1c007f6a8f418dab7835ce3c161f32811819842b08897f39166326aacd7afcb5
Zdev-Change-Id: Z87d7de4220478ed2e6d58d55f4648cde323acfbbb28ecb589c39215a802aeb03
Zdev-Change-Id: Z738bbca9dd306371480ab382cbd9492a52cd416d460e53b9512a5f83e57476d7
Zdev-Change-Id: Zc9f2540cb25a8b2bc131505b4314c6ea435ced462e808cb28c0b3f57b66f8f34
Arbitrate candidates and external incumbents with non-mutating comparison, invalidate superseded queued results, and deliver comparison failures safely through next().

Preserve restart support by clearing failure state during reset, with focused parallel BAB regressions.

Zdev-Change-Id: Z7926867238a6c0cfb64f226c42bf1df0d6994fedf653be929d33ef60ec652f92
Use non-mutating comparison for PBS incumbent arbitration and safely return collector or nested-asset failures after portfolio workers quiesce.

Add mixed portfolio regressions and document model-defined comparability, float ranking, migration, and the possible future best-effort incomparability policy.

Zdev-Change-Id: Ze012cd6e1d4ae7aebf1483d8aabd40f2204a99b09907e93c1a7e61d6dfc7b911
Zdev-Change-Id: Z4e4e39fd1665c0addf3e5726ab9bfb5ef3c6d49a7ca7b636d665bb672dccf5c5
Zdev-Change-Id: Z779d79cd0461e169a13d69dddf214ef27fe9499b996e28b9f44c29b66ff7cb97

@zayenz zayenz left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The one-argument CarSequencing::compare() hid the inherited Gist display overload. Added using Script::compare to restore the two-argument call.
  • Parallel PBS broadcast a solution before handling a stored worker failure. That could call into a failed asset and replace the original exception. The failure guard now runs before solution processing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant