Merge close same-net trace segments#401
Open
qkzdreamer wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new TraceCleanupSolver pipeline pass that merges (snaps) close, parallel trace segments that belong to the same net, with the intent of producing cleaner, aligned routing while avoiding modifications to pin-adjacent segments.
Changes:
- Added
mergeCloseSameNetTraceSegmentspass and wired it intoTraceCleanupSolveras a new pipeline step. - Implemented same-net, parallel-segment snapping with post-pass
simplifyPath. - Added unit tests to verify same-net merging and different-net non-merging.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
lib/solvers/TraceCleanupSolver/TraceCleanupSolver.ts |
Adds a new pipeline step to run same-net segment merging after L-shape balancing. |
lib/solvers/TraceCleanupSolver/mergeCloseSameNetTraceSegments.ts |
Implements the segment-snapping/merging algorithm and returns simplified paths. |
tests/solvers/TraceCleanupSolver/mergeCloseSameNetTraceSegments.test.ts |
Adds focused tests for same-net merge behavior and different-net preservation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+120
to
+124
| const distance = Math.abs(segmentA.fixedCoord - segmentB.fixedCoord) | ||
| if (distance < EPS || distance > mergeDistance) continue | ||
|
|
||
| setSegmentFixedCoord( | ||
| traceB.tracePath, |
Comment on lines
+123
to
+128
| setSegmentFixedCoord( | ||
| traceB.tracePath, | ||
| segmentB.segmentIndex, | ||
| segmentB.orientation, | ||
| segmentA.fixedCoord, | ||
| ) |
Comment on lines
+77
to
+79
| const isInternalSegment = (trace: SolvedTracePath, segmentIndex: number) => | ||
| segmentIndex > 0 && segmentIndex < trace.tracePath.length - 2 | ||
|
|
Comment on lines
28
to
33
| type PipelineStep = | ||
| | "minimizing_turns" | ||
| | "balancing_l_shapes" | ||
| | "merging_close_same_net_segments" | ||
| | "untangling_traces" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #34
/claim #34
Tests