Skip to content

feat(policy): suitability-aware construction, measured search effort and budget-aware defaults - #276

Merged
blackopsrepl merged 3 commits into
mainfrom
feat/default-policy-253
Nov 17, 2026
Merged

blackopsrepl merged 3 commits into
mainfrom
feat/default-policy-253

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #253.

The default policy now chooses construction, search effort, family scheduling and the construction/search budget split from model structure and benchmark evidence instead of from capability presence alone.

Construction: suitability and a completion guarantee

  • Fixed fleets. When strict savings hooks reject merges and the Clarke-Wright routes outnumber the vehicles that can take them, Clarke-Wright used to throw away every route. Construction then ended with all elements unassigned and the solve failed its completion gate; this is the "nothing assigned" case the delivery-scale bench hit. Clarke-Wright now keeps the routes it matched. The default construction follows with cheapest insertion over the remaining elements (reason list_elements_remain_unassigned), so required completion is verified rather than assumed.
  • Scale. Default Clarke-Wright keeps 40 savings per element when the slot declares a savings neighbour hook (the domain = "cvrp" profile does). Its memory grows linearly instead of quadratically.
  • Tests: list_clarke_wright_fixed_fleet covers a fleet smaller than the savings routes with capacity, a fixed fleet with time windows, an explicit Clarke-Wright then cheapest-insertion run, and a fleet that fits. Three of the four fail on v0.31.1 with "20 unassigned element(s)".

Local search: measured effort and cost-weighted families

  • Accepted count per step was 256 for every shape that had one. It is now chosen per model shape, from five-seed runs at 10 s:

    Shape Before After
    List variables 256 4
    Scalar groups 256 32
    Scalar with nearby hooks or repairs 256 32
    Precedence forager ceiling 256 32

    Ordinary scalars stay at 1.

  • On the bench: CVRP was best at 4 for every size; rostering was worst at 4 and best at 32; job shop was best at 32.

  • List ruin and unbounded k-opt now draw weight 1 against 4 for every other family. They stay available for diversification without an equal share of the step (ruin costs 48 ms per move at 10k stops). The resolved plan reports this as weighting = fixed:[...]. A graded 4/2/1 variant gave mixed results; ruin-only down-weighting was level or better at all three CVRP sizes.

Budget coordination

  • Required construction is never capped.
  • The optional assignment pass is the one step that can run long without being needed. On the rostering bench it takes about 7 s, which left a 10 s solve 2 s of search. The pass now stops after a fifth of the time limit. The step reports the seconds it was allowed as time_budget_seconds.
  • The fifth is measured, not assumed:
    • At 10 s, an uncapped pass is worst.
    • At 60 s, a tenth measurably costs quality (6.42/6.46 against 5.90/5.65 uncapped).
    • A fifth matches the uncapped run at 60 s (5.99/5.76) and still frees the 10 s solve.
  • A solve without a time limit is unaffected.

Evidence (solverforge-bench, native SolverForge, CPUs 0–3, 10 s, 5 seeds; quality ratio to the reference, lower is better; every run feasible)

Instance v0.31.1 default v0.31.1 specialized config this PR, default
CVRP X-n101-k25 1.0324 1.0318 1.0284
CVRP X-n242-k48 1.0313 1.0304 1.0280
CVRP X-n524-k153 1.0622 1.0588 1.0610
INRC-II n030w4 (1) 2.42 2.25 2.24
INRC-II n030w4 (2) 2.33 2.14 2.09
INRC-II n060w8 (H0) 21.9 20.1 16.6
INRC-II n060w8 (H2) 19.7 17.9 14.5
JSPLIB ft10 1.0699 1.0699 1.0680
JSPLIB la21 1.0681 1.0704 1.0780
JSPLIB ta21 1.1901 1.1876 1.1654

For rostering and job shop the adapters' configured policy is already the default, so that column is a second run of the old default.

Rostering n060w8 at 60 s (3–5 seeds): v0.31.1 scores 8.31 and 7.75; this PR scores 6.21 and 5.98.

Residual cases:

  • CVRP X-n524 is still 0.2% behind the hand-tuned configuration.
  • JSPLIB la21 is noisy at 10 s (sd 0.01–0.02 between runs). The confirmation run of this head was taken on a loaded host; the earlier uncontended run of the same job-shop policy scored 1.058.

Search policy, construction and budget changes are internal, and the public API is unchanged. docs/configuration.md and the solver WIREFRAME document the new rules.

…d default savings

When strict savings hooks reject merges and the Clarke-Wright routes outnumber the vehicles that can take them, construction discarded every route, so a fixed fleet ended construction with every element unassigned and the default solve failed its completion gate. Clarke-Wright now commits the routes it matched, and the default construction runs a list cheapest insertion over the elements left unassigned (reason list_elements_remain_unassigned). The completion stage reads the unassigned count only for a slot whose Clarke-Wright ran, against the source that construction already bound.

The default Clarke-Wright keeps 40 savings per element when the slot declares a savings neighbour hook, so its memory grows linearly with the stop count instead of with its square.

Refs #253
…ndidate cost

The default local search collected 256 accepted moves before every step, whatever the model, so a rostering solve made about 220 steps in 10 s and a CVRP solve about 600. Five-seed solverforge-bench runs at 10 s pick a count per model shape: list variables collect 4, scalar groups and scalar models with nearby or repair moves collect 32, and the precedence forager's ceiling is 32. On CVRP the new default now matches the hand-tuned configuration; job shop and rostering improve on every instance.

The default union also stopped giving every family an equal share of the step. List ruin and unbounded k-opt rebuild or scan whole routes per candidate (48 ms per ruin move at 10k stops), so they draw weight 1 against 4 for every other family; they stay available for diversification. The resolved plan reports the weights as weighting = fixed:[...].

Refs #253
The optional assignment pass is the one default construction step that can run long without being needed. On the rostering bench it takes about 7 s, so a 10 s solve was left with 2 s and a few dozen search steps. The pass now stops once a fifth of the solve's time limit has passed and leaves optional rows to local search's optional-assignment moves. A fifth still lets the pass finish inside a 60 s solve, where a tenth measurably costs quality. Required construction is never capped, and a solve without a time limit runs the pass to completion. The step reports the seconds it was allowed as time_budget_seconds.

Closes #253
@blackopsrepl

Copy link
Copy Markdown
Collaborator Author

Zero-regression gate — aca3167d vs ff945a3b (main = v0.31.1): passed (EXIT 0)

16 cases, 5 layouts, 51 trials. semantic_match on every case: True.

  • wall: -3.11% … +2.14%
  • instructions: -0.01% … +0.00%
  • allocations: +0.00% … +0.00%
  • allocated bytes: +0.00% … +0.00%
  • simulated D1 misses: -5.67% … +0.23%
  • simulated LL misses: -0.16% … +0.03%

Evidence: zr-pr276-aca3167d-vs-ff945a3b/report.json.

@blackopsrepl
blackopsrepl merged commit 4a2a8c4 into main Nov 17, 2026
7 checks passed
@blackopsrepl
blackopsrepl deleted the feat/default-policy-253 branch November 17, 2026 21:25
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.

Improve default policy selection so strong search does not require detailed application configuration

1 participant