Add same-net trace combining phase#290
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dac37f136
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (segment.axis === "horizontal") { | ||
| firstPoint.y = coordinate | ||
| secondPoint.y = coordinate | ||
| } else { | ||
| firstPoint.x = coordinate | ||
| secondPoint.x = coordinate |
There was a problem hiding this comment.
Keep trace endpoints attached when snapping
When the source segment is the first or last segment of a trace, these assignments move the trace endpoint itself. In the pipeline those endpoints represent the pins for the SolvedTracePath, so a simple two-point or terminal run that gets combined with a nearby same-net run will no longer start/end at its component pin coordinates, leaving the rendered/solved connection detached. Terminal segments need to be skipped or rewritten with an added jog so the pin endpoint remains fixed.
Useful? React with 👍 / 👎.
| const segments = groupTraces.flatMap((trace) => | ||
| this.getSegmentRefs( | ||
| this.outputTraces[traceIndexById.get(trace.mspPairId)!]!, | ||
| ).map((segment) => ({ | ||
| ...segment, | ||
| traceIndex: traceIndexById.get(trace.mspPairId)!, | ||
| })), | ||
| ) |
There was a problem hiding this comment.
Recompute segment refs after each snap
segments captures each run's constantCoord before any modifications, but later comparisons still use those stale coordinates after snapSegmentToCoordinate mutates the trace. With three overlapping same-net runs at y=0, y=0.1, and y=0.2 and mergeDistance=0.15, the y=0.1 run first snaps to y=0, then the y=0.2 run is compared against the stale y=0.1 ref and snaps to y=0.1, leaving two separate runs that should have collapsed onto the shared run. Updating/rebuilding refs or iterating until stable avoids this order-dependent partial combine.
Useful? React with 👍 / 👎.
|
Addressed the automated review feedback in b1442d9: terminal trace segments are no longer moved, and segment refs are rebuilt by iterating one combine at a time until stable. Added regressions for endpoint preservation and multi-run collapse. Full |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1442d9c0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ], | ||
| ), | ||
| definePipelineStep( | ||
| "netLabelPlacementSolver", |
There was a problem hiding this comment.
Use a distinct name for the second label placement phase
Adding another pipeline entry named netLabelPlacementSolver creates two sibling stages with the same identifier; the stage table keys rows by stage.solverName and solveUntilPhase(stage.solverName) stops at the first match, so the post-combine label-placement phase cannot be targeted/downloaded separately and its timing/instance data overwrites the earlier phase. This also violates React's requirement that list keys be unique among siblings (https://react.dev/learn/rendering-lists). Give this new phase its own solver property/name or otherwise disambiguate the two runs.
Useful? React with 👍 / 👎.
|
Addressed the latest Codex review feedback in ff339e1: the second net-label placement pass now uses a distinct Verification:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff339e1f97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (segment.axis === "horizontal") { | ||
| firstPoint.y = coordinate | ||
| secondPoint.y = coordinate | ||
| } else { | ||
| firstPoint.x = coordinate | ||
| secondPoint.x = coordinate |
There was a problem hiding this comment.
Recheck collisions before snapping segments
When this phase runs after TraceCleanupSolver in the pipeline, snapSegmentToCoordinate rewrites the segment endpoints unconditionally. In cases where the snapped segment has adjacent legs, moving a horizontal/vertical run toward a nearby same-net run can extend those legs through the gap that cleanup had routed around; if a different-net trace, chip, or label sits there, the final output can reintroduce a collision because no obstacle/collision check is performed before committing the new coordinates.
Useful? React with 👍 / 👎.
|
Addressed the latest Codex review feedback in 5c65323: same-net segment snaps are now transactional and only commit if they do not introduce new chip, net-label, or different-net trace collisions. The pipeline now passes input-problem obstacles and current net-label placements into the combiner, and the solver has regressions for both different-net trace blockers and net-label obstacles.\n\nVerification:\n- |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
This is ready for maintainer review from my side. All repo checks and the Vercel preview are green, and the latest Codex review found no major issues after the collision-safety follow-up. |
Summary
SameNetTraceCombiningSolveras a dedicated post-cleanup pipeline phaseglobalConnNetIdand snap close overlapping parallel same-net segments onto a shared run/claim #29
/claim #34
Tests
npx --yes bun test tests/solvers/SameNetTraceCombiningSolver/SameNetTraceCombiningSolver.test.tsnpx --yes bun run format:checknpx --yes tsc --noEmitnpx --yes bun run buildnpx --yes bun testReview feedback addressed