Add same-net trace segment alignment#438
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: 44d4e912d9
ℹ️ 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".
| tracePath: candidatePath, | ||
| } | ||
|
|
||
| if (intersectsDifferentNet(candidateTrace, output)) continue |
There was a problem hiding this comment.
Prevent same-net alignment from routing through obstacles
This acceptance path only verifies orthogonality and intersectsDifferentNet, so the new alignment phase can move a segment through chip/box obstacles (and other non-trace blockers) without being rejected. Earlier cleanup passes explicitly validate against static obstacle rectangles and label bounds, but this phase omits those checks entirely; in a layout where two same-net segments are close on opposite sides of a component, the shorter one can be snapped across the component and still be accepted.
Useful? React with 👍 / 👎.
| anchorSegment.fixedCoord, | ||
| ) | ||
|
|
||
| if (!isOrthogonalPath(candidatePath)) continue |
There was a problem hiding this comment.
Reject self-intersecting candidate paths before applying
Checking only isOrthogonalPath is insufficient here: an orthogonal path can still self-intersect after moving an internal segment. Because the subsequent collision filter skips traces with the same mspPairId, the candidate is never tested against non-adjacent segments of its own trace, so a zig-zag trace can be transformed into a self-crossing polyline and committed.
Useful? React with 👍 / 👎.
/claim #29
/claim #34
Summary
globalConnNetId.This covers both:
Verification
bun test tests\solvers\TraceCleanupSolver\alignNearbySameNetSegments.test.ts tests\examples\example29.test.ts tests\examples\example34.test.tsbun testbunx tsc --noEmitbun run buildgit diff --checkNote:
bun run format:checkfailed locally on the repo-wide baseline CRLF/LF formatting mismatch across existing files; touched files were formatted with Biome directly. Remote CI format-check passes on this PR.