Route the blocking link after packing short links

This commit is contained in:
Jan Petykiewicz 2026-11-30 15:24:18 -08:00
commit 9e97945174

View file

@ -271,11 +271,16 @@ 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)
shifts = short_shift_seed_set(problem, options.search, self._selection_cost, defer_blocker=not self.problem.initial_paths)
if shifts is not None:
trial = verify(replace(problem, initial_paths=shifts), planner)
complete = len(trial.valid_costs) == len(problem.nets)
trials.append(trial if complete else replace(trial, selection="incomplete-layout"))
if len(shifts) == len(problem.nets) - 1:
detour = self._residual_constructive_trial(options, trial, limit_per_pass=16)
if detour is not None:
trials.append(detour)
return trials, tuple(rejections)
if not complete:
rejections.append("Local S-bend layout failed full verification")
return trials, tuple(rejections)
@ -459,7 +464,17 @@ class _AutomaticRun:
planner = "residual-dogleg"
candidates = residual_dogleg_candidates(residual, options.search, limit_per_pass=limit_per_pass)
with self._time("plan", planner=planner, policy=planner):
world = None
for seed in candidates:
path = materialize_path_seed(
seed, start=net.start, net_width=net.width, search=options.search, clearance=residual.clearance, bounds=residual.bounds,
)
if not path or path[-1].end_port != net.target:
continue
if world is None:
world = RoutingWorld.from_problem(residual, board=self.board)
if not world.verify_path_report(net.net_id, path).is_valid:
continue
candidate = replace(problem, initial_paths={**seeds, net.net_id: seed})
trial = self._verify(candidate, planner, policy=planner)
if len(trial.valid_costs) == len(problem.nets):