Skip to content

Register CP-SAT decision strategy to stabilize solve times; Switch to ortools 9.15#452

Merged
mkannwischer merged 2 commits into
mainfrom
cpsat-search-strategy
Jun 12, 2026
Merged

Register CP-SAT decision strategy to stabilize solve times; Switch to ortools 9.15#452
mkannwischer merged 2 commits into
mainfrom
cpsat-search-strategy

Conversation

@mkannwischer

Copy link
Copy Markdown
Collaborator

No description provided.

OR-Tools >= 9.8 randomized the tie-breaking of CP-SAT's internal
scheduling search heuristic, which the "fixed" subsolver falls back to
when a model has no decision strategy. SLOTHY's models relied on that
heuristic being deterministic: since the change, solve times of large
examples (e.g. ntt_dilithium_123_45678_a55) vary by more than an order
of magnitude between runs, frequently exceeding timeouts and aborting
the external binary search with "No solution found."

Register an explicit decision strategy instead: branch on the
instruction that can be scheduled earliest, trying the earliest
position first, mimicking a greedy scheduling pass. This makes solver
behavior deterministic and fast independently of the OR-Tools version;
the previously failing benchmark solves in flat ~5-7s per attempt on
OR-Tools 9.7, 9.8 and 9.15 alike. The strategy is configurable via
config.solver_search_strategy ("lowest_min" (default),
"program_order", or "auto" for the previous behavior).

Also fix config.solver_random_seed never taking effect: it was
assigned to a non-existent CpSolver attribute instead of the solver
parameter.

Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
Signed-off-by: Matthias J. Kannwischer <matthias@zerorisc.com>
@mkannwischer mkannwischer merged commit 6f89fd4 into main Jun 12, 2026
40 checks passed
@mkannwischer mkannwischer deleted the cpsat-search-strategy branch June 12, 2026 10:28
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.

1 participant