Skip to content

Fix Subcircuit Autorouting, send externallyConnectedPointIds to autorouter (which internally handles an MSP for picking best routes)#1023

Merged
seveibar merged 4 commits intomainfrom
subcircuit-autorouter-fix
Jul 1, 2025
Merged

Fix Subcircuit Autorouting, send externallyConnectedPointIds to autorouter (which internally handles an MSP for picking best routes)#1023
seveibar merged 4 commits intomainfrom
subcircuit-autorouter-fix

Conversation

@seveibar
Copy link
Copy Markdown
Contributor

@seveibar seveibar commented Jul 1, 2025

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tscircuit-core-benchmarks ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 1, 2025 9:48pm

@seveibar seveibar changed the title Fix Subcircuit Autorouting [WIP] Fix Subcircuit Autorouting, send externallyConnectedPointIds to autorouter (which internally handles an MSP for picking best routes) Jul 1, 2025
@seveibar seveibar marked this pull request as ready for review July 1, 2025 21:46
@seveibar seveibar force-pushed the subcircuit-autorouter-fix branch from f0c6b30 to b399fd2 Compare July 1, 2025 21:47
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Unsafe Type Cast Causes External Connection Failures

The unsafe type cast of tr.route as any[] can cause a runtime error if tr.route is not iterable. Additionally, it bypasses type safety for seg.start_pcb_port_id and seg.end_pcb_port_id, leading to silent failures where the "externally connected points" feature may not correctly identify connected ports due to an assumed route structure that doesn't match the actual database schema.

lib/utils/autorouting/getSimpleRouteJsonFromCircuitJson.ts#L320-L324

const tracePortIds = new Set<string>()
for (const seg of tr.route as any[]) {
if (seg.start_pcb_port_id) tracePortIds.add(seg.start_pcb_port_id)
if (seg.end_pcb_port_id) tracePortIds.add(seg.end_pcb_port_id)
}

Fix in Cursor


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@seveibar seveibar merged commit 69ef298 into main Jul 1, 2025
12 checks passed
@seveibar seveibar deleted the subcircuit-autorouter-fix branch July 1, 2025 21:53
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