Skip to content

Commit dc771db

Browse files
drandyhaasclaude
andcommitted
plan executor: optimize_caps inherits the BGA-fanout options (skip its per-step reset)
Regression from the per-step reset (ef21a30): optimize_caps is the tail of the BGA fanout, not a standalone op -- it clears decoupling caps from THE FANOUT'S vias, at the fanout's clearance / via size (the CLI runs it as place_fanout_clearance right after bga_fanout, with the same --clearance 0.09). The plan's optimize_caps step carries no params of its own, so before ef21a30 it correctly INHERITED the preceding fanout step's live control state. The per-step reset wiped that -- optimize_caps then ran at the default clearance (0.25 instead of 0.09) and stopped moving the caps: on rp2350 the CLI moves all 6 decoupling caps (C18-C24, ~160-280um), while the GUI plan left them all at their original positions. Fix: skip the per-step reset for optimize_caps so it keeps the fanout step's options (clearance/via/grid + the BGA cap-placement knobs). Leak-safe -- the steps AFTER optimize_caps still reset, so nothing bleeds into the plane steps. The board still graded 0 DRC before this (the #362 sync makes the router follow the caps wherever they actually are), so this was a route-quality regression, not a shorting one -- the caps just weren't getting their clearance optimization. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UKFKAEkBFgwTKh1E4oJkaQ
1 parent d6229e8 commit dc771db

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

kicad_routing_plugin/claude_plan.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,17 @@ def _next_step(self):
831831
# reset touches PARAMETERS only, not selections/log; apply_step_params
832832
# + apply_step_selection below then restore exactly THIS step's state.
833833
# (reset_params_to_defaults' own docstring says it is called here.)
834-
if hasattr(self.dialog, 'reset_params_to_defaults'):
834+
# EXCEPTION: optimize_caps is the tail of the BGA fanout, not a
835+
# standalone op -- it clears decoupling caps from THE FANOUT'S vias,
836+
# at the fanout's clearance/via-size (the CLI runs it as
837+
# place_fanout_clearance right after bga_fanout with the same
838+
# --clearance). It carries no params of its own, so it must INHERIT
839+
# the preceding fanout step's options; resetting to defaults first
840+
# runs it at the wrong clearance and it stops moving the caps. So
841+
# skip the per-step reset for optimize_caps and let it keep the
842+
# fanout step's live control state.
843+
if (step["action"] != "optimize_caps"
844+
and hasattr(self.dialog, 'reset_params_to_defaults')):
835845
try:
836846
self.dialog.reset_params_to_defaults()
837847
except Exception as _e:

0 commit comments

Comments
 (0)