Skip to content

test(localsearch): pin forager, acceptor, recreate and seed behaviour - #206

Merged
blackopsrepl merged 4 commits into
mainfrom
feature/205-local-search-config-tests
Nov 5, 2026
Merged

blackopsrepl merged 4 commits into
mainfrom
feature/205-local-search-config-tests

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #205. Base main @ ff11cd47, four test-only commits:

  • 5982cd9a forager types and the score tie break (configured, default and tabu-search foragers)
  • 19bc7ee2 acceptor parameters: step counting step_count_limit, great deluge water_level_increase_ratio, simulated annealing hard regression policies
  • 9f9225a2 ruin-and-recreate cheapest_insertion vs first_fit
  • f70f37dc simulated annealing, random tie breaks and ruin choice each follow random_seed

Gate (fmt, clippy, doc-names file-length facade-reachability public-api deps, rustdoc, examples, workspace all-feature tests, doctests): EXIT 0, 1581 passed, 0 failed, 71 result lines.

Mutation checks, each failing at least one new test: the nine mappings listed in #205, seeding the annealing acceptor from the OS, and drawing the per-step seed from the OS.

Building first_accepted as the best-score forager, swapping
first_best_score_improving and first_last_step_score_improving, or
ignoring score_tie_break = "random" passed every test. Each forager type
now has a test offering candidates in a fixed order and asserting which it
picks and when it stops, and the configured, default and tabu-search
foragers each have a test that a random tie break spreads picks over
equally scored candidates while "first" keeps the first.
The step counting hill climbing step_count_limit, the great deluge
water_level_increase_ratio and the simulated annealing
temperature_controlled hard regression policy could be replaced by their
defaults or by the other policy without a test failing. Each now has a
test driving the built acceptor through steps and asserting which moves
it accepts.
Building cheapest_insertion recreate as first fit passed every test. A
solve with only ruin-and-recreate moves now shows cheapest insertion
rebuilding two tasks on the cheapest free workers, and first fit putting
them back on the first worker.
Simulated annealing, random tie breaks and the ruin choice each get a
bounded solve where only that part is random, asserting that repeated
solves with one seed agree and that some other seed disagrees. Seeding the
annealing acceptor or the per-step seed from the operating system fails
them.

Closes #205.
@blackopsrepl
blackopsrepl merged commit f70f37d into main Nov 5, 2026
12 checks passed
@blackopsrepl
blackopsrepl deleted the feature/205-local-search-config-tests branch November 5, 2026 07:23
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.

Local search config items have no behaviour tests

1 participant