Skip to content

fix: handle filtered updates in Neighborhoods properly#2073

Merged
triceo merged 5 commits intoTimefoldAI:mainfrom
triceo:npe
Feb 4, 2026
Merged

fix: handle filtered updates in Neighborhoods properly#2073
triceo merged 5 commits intoTimefoldAI:mainfrom
triceo:npe

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Feb 4, 2026

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.

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.
Copilot AI review requested due to automatic review settings February 4, 2026 07:44
@triceo triceo requested a review from zepfred February 4, 2026 07:45
@triceo triceo added this to the v1.31.0 milestone Feb 4, 2026
@triceo triceo self-assigned this Feb 4, 2026
@triceo triceo changed the title fix: properly handle filtered updates in Neighborhoods fix: handle filtered updates in Neighborhoods properly Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 MoveStreamFactory with new list-variable enumeration methods and updates ListChangeMoveProvider to use the new API.
  • Adjusts enumerating dataset instances and DefaultMoveStreamFactory logic 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
59.7% Coverage on New Code (required ≥ 70%)

See analysis details on SonarQube Cloud

@triceo triceo merged commit 8009b14 into TimefoldAI:main Feb 4, 2026
29 of 30 checks passed
@triceo triceo deleted the npe branch February 4, 2026 13:25
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.

2 participants