Skip to content

fix: reset late list when upper levels of score changed#2407

Merged
triceo merged 5 commits into
TimefoldAI:mainfrom
zepfred:chore/stuck
Jun 25, 2026
Merged

fix: reset late list when upper levels of score changed#2407
triceo merged 5 commits into
TimefoldAI:mainfrom
zepfred:chore/stuck

Conversation

@zepfred

@zepfred zepfred commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@zepfred zepfred marked this pull request as ready for review June 23, 2026 15:13
@zepfred zepfred requested a review from triceo as a code owner June 23, 2026 15:13
Copilot AI review requested due to automatic review settings June 23, 2026 15:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 LateAcceptanceScoreBuffer that 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 triceo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IMO some room for improvement. Copilot is also making some sense.
Will approve once we have the validation results.

@triceo triceo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small comments.

Copilot AI review requested due to automatic review settings June 24, 2026 15:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

@sonarqubecloud

Copy link
Copy Markdown

@triceo triceo changed the title feat: improve LA acceptor fix: reset late list when upper levels of score changed Jun 25, 2026
@triceo triceo merged commit b35c255 into TimefoldAI:main Jun 25, 2026
21 of 24 checks passed
@triceo triceo added this to the v2.3.0 milestone Jun 25, 2026
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.

3 participants