Avoid unnecessary search and placement trials in automatic routing

This commit is contained in:
Jan Petykiewicz 2026-11-30 15:35:45 -08:00
commit 9e41c1abf8

View file

@ -17,7 +17,9 @@ from inire.model import FixedRoute, resolve_bend_geometry
from inire.results import AutomaticRoutingReport, RoutingStage, RoutingTiming, _planner_for_mode
from inire.router._bundle import ordered_bundle_terminal_headings, plan_ordered_bundle
from inire.router._capacity import cut_capacity, port_conflicts
from inire.router._columns import column_jog_candidates, column_recovery_candidates, column_recovery_subproblems, column_seed_candidates
from inire.router._columns import (
column_jog_candidates, column_partition_budget_exceeded, column_recovery_candidates, column_recovery_subproblems, column_seed_candidates,
)
from inire.router._compact import compact_port_seed_set, short_shift_seed_set
from inire.router._congestion_policy import ordered_nets
from inire.router._perimeter import (
@ -271,7 +273,10 @@ class _AutomaticRun:
if not trials or len(_best_trial(trials).valid_costs) < len(problem.nets):
planner = "local-sbend"
with self._time("plan", planner=planner):
shifts = short_shift_seed_set(problem, options.search, self._selection_cost, defer_blocker=not self.problem.initial_paths)
shifts = short_shift_seed_set(
problem, options.search, self._selection_cost,
defer_blocker=not self.problem.initial_paths, length_weights=self.length_weights,
)
if shifts is not None:
trial = verify(replace(problem, initial_paths=shifts), planner)
complete = len(trial.valid_costs) == len(problem.nets)
@ -582,10 +587,13 @@ class _AutomaticRun:
):
with self._time("plan", planner="column-recovery"):
groups = column_recovery_subproblems(problem)
# With independent channels, try construction before spending search
# budget on each net. Keep the general bypass as a later fallback.
if len(groups) > 1 and self._try_column_recovery(options, trials, groups):
return True
try_recovery_early = len(groups) > 1 or (len(groups) == 1 and column_partition_budget_exceeded(problem))
# Independent channels and dense aperture fields can be cheaper to route
# by construction. Try their bypass before spending search budget.
if try_recovery_early:
if self._try_column_recovery(options, trials, groups):
return True
groups = ()
probe_iterations = options.congestion.max_iterations
proxy, _ = resolve_bend_geometry(options.search)
# Clipped proxies can find cheaper routes in later probe iterations than in the wider retry.