Skip to content

feat(move_thread_count)!: implement auto and reject zero counts - #182

Merged
blackopsrepl merged 2 commits into
mainfrom
feature/173-move-thread-count
Nov 4, 2026
Merged

blackopsrepl merged 2 commits into
mainfrom
feature/173-move-thread-count

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #173. Base main @ bd910d01, two commits:

  • 6bc823ba fix(move_thread_count)!: reject zero thread counts
  • 51e1bcaf feat(move_thread_count)!: implement the auto evaluation policy

Gate on 51e1bcaf (fmt, clippy -D warnings, doc-names file-length facade-reachability public-api deps, rustdoc -D warnings, examples, workspace all-feature tests, doctests): EXIT 0, 1523 passed, 0 failed, 65 result lines. Slice 1 alone: clippy, rustdoc, public-api bless, config/solver lib/solver doctests/parallel integration tests: 778 passed, 0 failed. Mutation checks: auto resolved to sequential fails evaluation_policy_resolution; an AutoPolicy that never switches fails 4 tests, including the end-to-end trajectory test.

`{ count = 0 }` was silently raised to one evaluator, in local search and
in partitioned search. `MoveThreadCount::Count` and partitioned
`ThreadCount::Specific` now hold a `NonZeroUsize`, so a zero count is
rejected when the configuration is read. Partitioned search documents its
`thread_count` meanings: `auto` is one thread per partition up to the
available cores, `none` one thread, `{ count = n }` at most `n`.

BREAKING CHANGE: `MoveThreadCount::Count` holds `NonZeroUsize` and
`{ count = 0 }` is a configuration error. `ThreadCount::Specific` holds
`NonZeroUsize`.
`auto` ran exactly like `none`. It now resolves to
`EvaluationPolicy::Auto` with up to four evaluators bounded by the solve's
Rayon threads. An `AdaptiveEvaluator` runs each step sequentially or in
parallel windows as `AutoPolicy` decides from the step's measured trial
time, the previous step's candidate count, the calibrated fork-join cost of
one window and the last replica rebuild, switching after eight consecutive
steps favour the other mode. Leaving parallel mode releases the replicas.
Every policy reaches the sequential trajectory, so `auto` changes speed
only.

Closes #173.

BREAKING CHANGE: the default `move_thread_count = "auto"` may now evaluate
local-search steps in parallel windows on up to four evaluators, which
forks up to three working-solution replicas.
@blackopsrepl
blackopsrepl merged commit 51e1bca into main Nov 4, 2026
12 checks passed
@blackopsrepl
blackopsrepl deleted the feature/173-move-thread-count branch November 4, 2026 20:41
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.

move_thread_count: auto is sequential, count = 0 is silently 1

1 participant