fix: handle filtered updates in Neighborhoods properly#2073
Merged
triceo merged 5 commits intoTimefoldAI:mainfrom Feb 4, 2026
Merged
fix: handle filtered updates in Neighborhoods properly#2073triceo merged 5 commits intoTimefoldAI:mainfrom
triceo merged 5 commits intoTimefoldAI:mainfrom
Conversation
If filters are in play, we can get an update even without seeing an insert first. The code needs to account for this, just like it does in CS.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Neighborhoods (preview) move stream APIs and internals to better handle updates/retracts when tuples are filtered, and consolidates related tests.
Changes:
- Consolidates neighborhood-related tests into a new
NeighborhoodsTest. - Extends
MoveStreamFactorywith new list-variable enumeration methods and updatesListChangeMoveProviderto use the new API. - Adjusts enumerating dataset instances and
DefaultMoveStreamFactorylogic to better support filtered tuple lifecycles and new list-variable destination enumeration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/test/java/ai/timefold/solver/core/impl/neighborhood/NeighborhoodsTest.java | New consolidated test coverage for local search, null handling, and notifications. |
| core/src/test/java/ai/timefold/solver/core/impl/neighborhood/NeighborhoodsNotificationTest.java | Removed; coverage moved into NeighborhoodsTest. |
| core/src/test/java/ai/timefold/solver/core/impl/neighborhood/NeighborhoodsBasedLocalSearchTest.java | Removed; coverage moved into NeighborhoodsTest. |
| core/src/main/java/ai/timefold/solver/core/preview/api/neighborhood/stream/MoveStreamFactory.java | Adds new public preview API methods for list-variable enumeration and deprecates older method. |
| core/src/main/java/ai/timefold/solver/core/preview/api/move/builtin/ListChangeMoveProvider.java | Switches to the new destination enumeration API. |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/AbstractRightDatasetInstance.java | Adds fail-fast checks and changes update/retract behavior for filtered tuple scenarios. |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/enumerating/common/AbstractLeftDatasetInstance.java | Adds fail-fast checks and changes update/retract behavior for filtered tuple scenarios. |
| core/src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java | Implements the new API methods and refactors list-variable destination/assigned-value enumeration. |
...src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/preview/api/neighborhood/stream/MoveStreamFactory.java
Show resolved
Hide resolved
core/src/test/java/ai/timefold/solver/core/impl/neighborhood/NeighborhoodsTest.java
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java
Show resolved
Hide resolved
...ld/solver/core/impl/neighborhood/stream/enumerating/common/AbstractRightDatasetInstance.java
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java
Outdated
Show resolved
Hide resolved
...src/main/java/ai/timefold/solver/core/impl/neighborhood/stream/DefaultMoveStreamFactory.java
Show resolved
Hide resolved
|
zepfred
reviewed
Feb 4, 2026
...src/main/java/ai/timefold/solver/core/preview/api/neighborhood/stream/MoveStreamFactory.java
Show resolved
Hide resolved
zepfred
approved these changes
Feb 4, 2026
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.


If filters are in play, we can get an update even without seeing an insert first.
The code needs to account for this, just like it does in CS.
Also improves the move stream factory API following up on feedback.