fix: merge nearby same-net trace segments#418
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds a new TraceCleanupSolver pipeline phase that aligns nearby overlapping same-net trace segments onto a shared X/Y coordinate to reduce “almost-parallel” clutter (issue #34 / related #29).
Changes:
- Introduces
mergeNearbySameNetSegmentsto detect overlapping horizontal/vertical interior segments on the same net and align them to a shared coordinate. - Integrates this cleanup phase into
TraceCleanupSolverafter the L-shape balancing step. - Adds unit tests covering same-net alignment and different-net non-alignment.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/solvers/TraceCleanupSolver/mergeNearbySameNetSegments.ts |
Implements the new same-net segment alignment pass. |
lib/solvers/TraceCleanupSolver/TraceCleanupSolver.ts |
Wires the new cleanup phase into the solver pipeline. |
tests/solvers/TraceCleanupSolver/mergeNearbySameNetSegments.test.ts |
Adds unit tests for the new merge/alignment behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type PipelineStep = | ||
| | "minimizing_turns" | ||
| | "balancing_l_shapes" | ||
| | "merging_close_same_net_segments" | ||
| | "untangling_traces" |
There was a problem hiding this comment.
Addressed in dbcd4a3: updated the pipeline JSDoc with the new close same-net merge phase.
| changed = true | ||
| break | ||
| } | ||
|
|
||
| if (changed) break |
There was a problem hiding this comment.
Addressed in dbcd4a3: replaced the two-pass single-pair merge with component-based grouping so all eligible close same-net segments are aligned, and added a 3-trace regression test.
Summary
Closes #34
Related to #29
Test Plan