Skip to content

perf: allow bavet score calculation to exit early if it can prove the move cannot be accepted - #2694

Open
Christopher-Chianelli wants to merge 15 commits into
TimefoldAI:mainfrom
Christopher-Chianelli:perf/pessimistic
Open

Christopher-Chianelli wants to merge 15 commits into
TimefoldAI:mainfrom
Christopher-Chianelli:perf/pessimistic

Conversation

@Christopher-Chianelli

Copy link
Copy Markdown
Contributor

When enabled via its preview feature,
Construction Heuristic's Forager and Local Search's Decider give infomation to the ScoreDirector about the lowest score move it would accept. If after computing a level node network, the score calculator could prove the resulting score would be lower than the minimum score, it skips applying the move to the later levels' node networks.

@Christopher-Chianelli
Christopher-Chianelli marked this pull request as ready for review October 21, 2026 23:43
@Christopher-Chianelli
Christopher-Chianelli requested a review from a team October 21, 2026 23:43

@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.

See my comments on Enterprise.

@timefold-automations

timefold-automations Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This pull request, as it stands, would leave the Solver documentation stale in the place below. An automated check found it and can be wrong.

  1. Code change: timefold-solver, added property key constraint-stream-tiered-score-calculation: spring-integration/spring-boot-autoconfigure/src/main/java/ai/timefold/solver/spring/boot/autoconfigure/config/SolverProperty.java:49 (timefold.solver.constraint-stream-tiered-score-calculation) and quarkus-integration/quarkus/runtime/src/main/java/ai/timefold/solver/quarkus/config/SolverRuntimeConfig.java:60 (quarkus.timefold.solver.constraint-stream-tiered-score-calculation).
    Docs location: docs/src/modules/ROOT/pages/running-timefold-solver/library/_config-properties.adoc. spring-boot.adoc and quarkus.adoc both include this partial, and its header says it holds all the properties, but the new key isn't in it. The neighbouring constraint-stream-profiling-enabled entry is at line 31. Confidence: medium.

    Suggested edit: add this after the constraint-stream-profiling-enabled entry (after line 32):

{property_prefix}timefold.solver.{solver_name_prefix}constraint-stream-tiered-score-calculation::
Enable xref:commercial-editions/performance-improvements.adoc#tieredScoreCalculation[tiered score calculation] to skip constraints of softer score levels when they cannot change whether a move is accepted.
Enabled by default in Timefold Solver Enterprise Edition.

Separately, the new section in performance-improvements.adoc (line 110) still opens its tab block with [ tabs], with a space in it. Every other page uses [tabs]. With the space, the XML, Spring Boot and Quarkus tabs won't render as tabs.

The docs live in timefold-solver, so the fix goes into this pull request.

A new commit on the branch updates this comment, and drift that is still there when the group merges gets a docs pull request against main.


Generated by Solver Docs Drift Review with Claude.

@triceo triceo added this to the v2.10.0-rc-1 milestone Nov 17, 2026
… move cannot be accepted

When enabled via its preview feature,
Construction Heuristic's Forager and Local Search's Decider
give infomation to the ScoreDirector about the lowest score move it
would accept. If after computing a level node network, the score calculator
could prove the resulting score would be lower than the minimum score,
it skips applying the move to the later levels' node networks.
Fixes a partial score being consumed in `stepEnded()` and friends
when a bailout occurs.
this.indictmentsEnabled = indictmentsEnabled;
this.entityDescriptorToForEachCriteriaToPredicateMap = new HashMap<>();
this.streamToProfileIdSets = HashMap.newHashMap(Math.max(16, activeStreamSet.size() / 2));
this.networkId = networkId;

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.

Please double-check that the network visualization in case of tiered still produces meaningful output.

This branch was successfully deployed

2 active deployments
documentation (preview) — c4b67f74 Deployed Nov 19, 2026 by Christopher-Chianelli via Build Documentation #914
internal — c4b67f74 Deployed Nov 19, 2026 by Christopher-Chianelli via approval_required #1317
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.

4 participants