feat: add SameNetTraceCombiningSolver to merge close collinear same-net traces#276
Open
chengyixu wants to merge 3 commits intotscircuit:mainfrom
Open
feat: add SameNetTraceCombiningSolver to merge close collinear same-net traces#276chengyixu wants to merge 3 commits intotscircuit:mainfrom
chengyixu wants to merge 3 commits intotscircuit:mainfrom
Conversation
…(issue tscircuit#79) Deep-clone directConnMap.netMap when creating netConnMap to prevent shared-reference mutations. In MspConnectionPairSolver, route direct-wire nets through dcConnMap (not globalConnMap) to exclude net-label-only pins that share a net name from getting merged into wire routing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Regenerate 6 stale snapshot SVGs after rebase onto main - Fix biome formatting in repro79 test (single-line arrays) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…et traces Implements a post-processing solver that identifies and merges collinear (horizontal at same Y, vertical at same X) trace segments belonging to the same net when they are within COLLINEAR_TOLERANCE (0.05) and GAP_TOLERANCE (0.15). The solver extends one segment to span the combined range and collapses the redundant segment, then simplifies trace paths by removing zero-length segments. Includes 8 unit tests covering horizontal/vertical merges, different-net isolation, large-gap rejection, overlapping segments, and edge cases. Pipeline position: after TraceCleanupSolver, before NetLabelPlacementSolver. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
Author
Author
|
Hi! This PR is CI green and ready for merge when you have a moment. Thanks! |
Author
Author
|
Hey @seveibar -- all CI is green on these 4 PRs totaling $500 in bounties:
The fixes are surgical and well-tested. Would appreciate a review when you have a moment. |
Author
|
Hi @seveibar, all CI checks are passing ✅ (test, format-check, type-check, Vercel). This PR is ready for review and merge whenever you have a moment. Thanks! |
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.
What this PR does
Merges same-net trace segments that are collinear (same X or Y axis) and close together (gap <= 0.15), reducing visual clutter by combining redundant parallel traces into single cleaner lines.
How to test
bun test tests/solvers/SameNetTraceCombiningSolver/SameNetTraceCombiningSolver.test.tsBefore / After
Before: Same-net traces from different MSP pairs rendered as separate overlapping/parallel lines, cluttering the schematic with redundant visual elements.
After: Collinear same-net segments within 0.15 gap tolerance are merged into a single line. 10 snapshot files updated showing cleaner output (examples 01, 02, 07, 13, 14, 15, 18, 19, 21, 27, 29).
Which issues this fixes
Fixes #29 (combine same-net traces)
Fixes #34 (merge close collinear traces)
Pipeline position
Inserted after
TraceCleanupSolver, beforeNetLabelPlacementSolver. Downstream solvers fall back gracefully when the combiner is absent.Test results
/claim #29
/claim #34