fix: reset late list when upper levels of score changed#2407
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Local Search Late Acceptance (LA) acceptor by introducing a circular buffer with lazy “epoch” resets and by resetting late scores when the best score improves on non-dominated levels (hard/medium), updating and extending tests accordingly.
Changes:
- Replaced the LA acceptor’s raw score array with a new
LateAcceptanceScoreBufferthat supports efficient lazy resets. - Added “reset late scores on non-dominated (hard/medium) best-score improvement” logic to
LateAcceptanceAcceptor. - Updated and expanded unit tests to cover the new reset behavior and adjusted an existing solver test’s expected solution ordering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/src/main/java/ai/timefold/solver/core/impl/localsearch/decider/acceptor/lateacceptance/LateAcceptanceAcceptor.java | Switches to the new buffer and adds best-score-level tracking to decide when to reset late scores. |
| core/src/main/java/ai/timefold/solver/core/impl/localsearch/decider/acceptor/lateacceptance/LateAcceptanceScoreBuffer.java | Adds a new epoch-based circular buffer for late scores to simplify and speed up resets. |
| core/src/test/java/ai/timefold/solver/core/impl/localsearch/decider/acceptor/lateacceptance/LateAcceptanceAcceptorTest.java | Adds Mockito-based setup and new tests validating late-score resets on hard/medium improvements. |
| core/src/test/java/ai/timefold/solver/core/impl/solver/DefaultSolverTest.java | Updates expected ordering for the stale declarative shadow test based on new solver behavior. |
triceo
reviewed
Jun 23, 2026
triceo
approved these changes
Jun 24, 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.



No description provided.