Skip to content

Add phased subcircuit autorouting#2127

Open
ShiboSoftwareDev wants to merge 2 commits intotscircuit:mainfrom
ShiboSoftwareDev:main
Open

Add phased subcircuit autorouting#2127
ShiboSoftwareDev wants to merge 2 commits intotscircuit:mainfrom
ShiboSoftwareDev:main

Conversation

@ShiboSoftwareDev
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Apr 10, 2026 4:49am

Request Review

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

this is too confusing as written, but it works so it's a good first attempt

the diff is really hard to read because you used closures. You should request changes for any PR that has closures- we don't accept them because they cause a codebase to rapidly become unmaintanable because of scope leaking

return traces.length > 0
}

_getRoutingPhasePlans(): RoutingPhasePlan[] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should this be in the subcircuit class?

}> = []
let obstacleCircuitJson: AnyCircuitElement[] = []

const solvePhase = async (phasePlan: RoutingPhasePlan) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so generally, named closures are a huge antipattern, for some reason codex loves making them, but we'll rarely accept a PR with them, and staff are instructed to make sure we don't merge code with named closures especially into core

<board width="24mm" height="20mm">
<subcircuit
name="POWER_STAGE"
autorouter={{ local: true, groupMode: "subcircuit" }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
autorouter={{ local: true, groupMode: "subcircuit" }}


circuit.add(
<board width="24mm" height="20mm">
<subcircuit
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove the subcircuit- why is there a subcircuit?

@seveibar
Copy link
Copy Markdown
Contributor

@ShiboSoftwareDev you might want to do 2 PRs, in the first PR you can just "set up" the autorouting system to avoid some kind of large refactor. The diff is impossible to read as is and this is sensitive logic. If the code was broken up properly there would not be this issue, so you might want to clean up the functions and do basic methods in the first PR, then do the actual implementation in a second PR. Being careful and keeping this code clean will save us hundreds of hours in the long term

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants