Skip to content

fix(solver): required construction roster and optional pass time share (#283) - #288

Merged
blackopsrepl merged 2 commits into
mainfrom
fix/283-construction-quality
Dec 1, 2026
Merged

blackopsrepl merged 2 commits into
mainfrom
fix/283-construction-quality

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

fix(solver): place required rows in a direct pass, then an augmenting pass

The required cursor gave each row a free value before trying rematches for
it, then moved to the next row, and dropped each placed row from the value
degrees. Value order for later rows thus followed the rows placed so far,
and a row's rematch could take the value a later row had free. On INRC-II
n120w8 that roster left local search a much harder start: at 5 s, H0 ended
at -213830 and H1 at -208935 soft, against -183305 and -180860 on v0.31.4,
with local search at about 10 steps a second instead of 50.

Required rows are now placed in two passes over the scarcity order. The
direct pass gives each row its first free value, ranking values by the
degrees of every row the pass started with; the augmenting pass then
recounts the degrees over the rows left and places them with rematches,
retiring each row it places. Both passes stay on the construction cursor
with incremental scoring.

n120w8, scratch build of the bench adapter, one core, seed 1:

  • 1 s: H0 and H1 0hard (v0.31.4 leaves all 2844 and 2872 required shifts
    unassigned).
  • 2 s: H0 -205060 / H1 -206665 soft (v0.31.4: -217370 / -221820).
  • 5 s: H0 -174875 / H1 -173550 (v0.31.4: -183305 / -180860).
  • 10 s: H0 -147015 / H1 -144165 (v0.31.4: -152470 / -148035).
  • 60 s: H0 -74840 / H1 -69390 (v0.31.4: -74665 / -72960).
    Repeats with four solves at a time (six at 10 s, three at 60 s) put the
    two sides within run-to-run spread; mean soft cost, this change against
    v0.31.4: 10 s H0 159274 / 158067, H1 153267 / 153455; 60 s H0 78495 /
    79617, H1 79175 / 78388.

direct_pass_orders_values_by_the_degrees_it_started_with fails when the
direct pass retires placed rows from the degrees.

fix(solver): give the optional assignment pass its exact time share

The optional pass stops once a fifth of a time-limited solve has passed. Its
remaining share went to the construction phase as a seconds_spent_limit,
rounded up to whole seconds, so on a 1 s solve the pass got the whole
second: on INRC-II n120w8 it ran about 930 ms after required construction
and local search never started.

The share now reaches the phase as a Duration time budget, which the
scoped phase termination caps below any configured limit. The trace reports
it as time_budget_ms instead of time_budget_seconds.

n120w8 at 1 s: the pass takes about 125 ms and local search the remaining
800 ms. With the previous commit, six repeats end at a mean soft cost of
217824 (H0) and 218989 (H1); main before both ended at 224820 and 223990.

… pass

The required cursor gave each row a free value before trying rematches for
it, then moved to the next row, and dropped each placed row from the value
degrees. Value order for later rows thus followed the rows placed so far,
and a row's rematch could take the value a later row had free. On INRC-II
n120w8 that roster left local search a much harder start: at 5 s, H0 ended
at -213830 and H1 at -208935 soft, against -183305 and -180860 on v0.31.4,
with local search at about 10 steps a second instead of 50.

Required rows are now placed in two passes over the scarcity order. The
direct pass gives each row its first free value, ranking values by the
degrees of every row the pass started with; the augmenting pass then
recounts the degrees over the rows left and places them with rematches,
retiring each row it places. Both passes stay on the construction cursor
with incremental scoring.

n120w8, scratch build of the bench adapter, one core, seed 1:
- 1 s: H0 and H1 0hard (v0.31.4 leaves all 2844 and 2872 required shifts
  unassigned).
- 2 s: H0 -205060 / H1 -206665 soft (v0.31.4: -217370 / -221820).
- 5 s: H0 -174875 / H1 -173550 (v0.31.4: -183305 / -180860).
- 10 s: H0 -147015 / H1 -144165 (v0.31.4: -152470 / -148035).
- 60 s: H0 -74840 / H1 -69390 (v0.31.4: -74665 / -72960).
Repeats with four solves at a time (six at 10 s, three at 60 s) put the
two sides within run-to-run spread; mean soft cost, this change against
v0.31.4: 10 s H0 159274 / 158067, H1 153267 / 153455; 60 s H0 78495 /
79617, H1 79175 / 78388.

direct_pass_orders_values_by_the_degrees_it_started_with fails when the
direct pass retires placed rows from the degrees.
The optional pass stops once a fifth of a time-limited solve has passed. Its
remaining share went to the construction phase as a `seconds_spent_limit`,
rounded up to whole seconds, so on a 1 s solve the pass got the whole
second: on INRC-II n120w8 it ran about 930 ms after required construction
and local search never started.

The share now reaches the phase as a `Duration` time budget, which the
scoped phase termination caps below any configured limit. The trace reports
it as `time_budget_ms` instead of `time_budget_seconds`.

n120w8 at 1 s: the pass takes about 125 ms and local search the remaining
800 ms. With the previous commit, six repeats end at a mean soft cost of
217824 (H0) and 218989 (H1); main before both ended at 224820 and 223990.
@blackopsrepl
blackopsrepl merged commit 80697e7 into main Dec 1, 2026
7 checks passed
@blackopsrepl
blackopsrepl deleted the fix/283-construction-quality branch December 1, 2026 13:27
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