fix(autorouting): ignore unowned top-level traces when ignoreExistingTopLevelPcbRouteState is enabled (#4154) - #4192
Conversation
…TopLevelPcbRouteState is enabled (tscircuit#4154) - In getSimpleRouteJsonFromCircuitJson, filter out unowned top-level pcb traces (traces lacking source_trace_id, pcb_component_id, and subcircuit_id) from SRJ obstacles when ignoreExistingTopLevelPcbRouteState is true. - Component-owned footprint copper primitives (e.g. solder-jumper bridges with pcb_component_id) and subcircuit copper are preserved as fixed obstacles. - Add regression unit test in repro-ignore-unowned-top-level-traces.test.ts. Fixes tscircuit#4154
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
This PR remains ready for review and merge. A brief summary of what it delivers: Root cause fixed: When Fix: Filter out unowned top-level traces (those not associated with any component in the current subnet) before injecting them as obstacles. Component-owned traces are preserved correctly. Verification: Snapshot test added in Happy to address any review comments. |
Summary of Changes
Root Cause / Technical Context
When getSimpleRouteJsonFromCircuitJson runs with ignoreExistingTopLevelPcbRouteState: true (e.g. for imported board circuits like Altium PMP22650), top-level copper traces without source_trace_id were unconditionally added to obstacles via db.pcb_trace.list().filter((trace) => !trace.source_trace_id).
Consequently, unassigned top-level copper arcs were passed to getObstaclesFromRoute, which threw errors on diagonal segments and leaked unowned existing routing into an unrouted SRJ problem.
Verification & Testing
Closes #4154