feat: detect close same-net trace endpoints for merging (#378)#405
Open
onchito-walks wants to merge 2 commits into
Open
feat: detect close same-net trace endpoints for merging (#378)#405onchito-walks wants to merge 2 commits into
onchito-walks wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ion (tscircuit#378) - Add findCloseSameNetTraceGroups sub-solver that groups same-net traces by endpoint proximity (default threshold: 0.5mm) - Wire into TraceCleanupSolver init and output - Add focused test coverage for same-net grouping - All 62 tests pass, typecheck clean, build clean, format clean Addresses tscircuit#378
4071c30 to
955302d
Compare
Author
|
This adds the detection phase for close same-net trace endpoints. It runs conservatively — only groups traces, never mutates paths — so downstream phases can decide whether to merge them. I kept the detection threshold at 0.5 units based on the existing trace grid spacing, but happy to adjust if you have a different convention in mind. The implementation is structured as a self-contained sub-solver with its own test suite (1 test, 4 assertions, passing). Ready for review whenever you get a chance. |
Builds on the detection phase to actually merge close same-net trace segments. mergeTwoSameNetTraces finds the closest endpoint pair between two same-net traces and constructs a continuous path through an L-shaped connector. mergeCloseSameNetTraceGroups processes all detected groups. 7 tests covering: horizontal merge, vertical merge, touching endpoints, distance gate, reverse orientation, multi-group processing, single-trace safety.
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
Detection + merge pipeline for close same-net trace endpoints. Two-phase approach:
Phase 1: Detection
Groups same-net traces whose endpoints are within 0.5 grid units of each other. Conservative — no path mutations, just grouping.
Phase 2: Merge
For each detected group, finds the closest endpoint pair and constructs a continuous path with an L-shaped connector. Handles horizontal, vertical, and touching endpoints.
Changes
Verification