feat: add SameNetTraceMergeSolver to combine close same-net trace segments#338
Open
colorbank wants to merge 1 commit into
Open
feat: add SameNetTraceMergeSolver to combine close same-net trace segments#338colorbank wants to merge 1 commit into
colorbank wants to merge 1 commit into
Conversation
…ments Closes /claim tscircuit#29 Closes /claim tscircuit#34
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
/claim #29\n/claim #34\n\n## Summary\n\nAdds a new
SameNetTraceMergeSolverpipeline phase that combines same-net trace segments whose endpoints are within a configurable gap (default: 0.12 schematic units).\n\n## Changes\n\n### New:lib/solvers/SameNetTraceMergeSolver/SameNetTraceMergeSolver.ts\n- ExtendsBaseSolver\n- Groups traces by net key (userNetId ?? globalConnNetId ?? dcConnNetId)\n- Iterates over same-net trace pairs and joins any two whose closest endpoint pair is withinmaxEndpointGap\n- Inserts an L-turn bridge segment when endpoints are not axis-aligned\n- Runs until no more merges are possible, then setssolved = true\n- ExposesgetOutput(): { traces: SolvedTracePath[] }\n\n### Modified:lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts\n- ImportsSameNetTraceMergeSolver\n- AddssameNetTraceMergeSolver?field to the class\n- Inserts a newsameNetTraceMergeSolverpipeline step aftertraceCleanupSolverand before the secondnetLabelPlacementSolver\n- UpdatesnetLabelPlacementSolver(2nd) andexample28Solverto prefersameNetTraceMergeSolver?.getOutput().traces\n\n### New:tests/solvers/SameNetTraceMergeSolver/SameNetTraceMergeSolver.test.ts\n- 4 unit tests covering:\n 1. Merges two same-net traces with close endpoints\n 2. Does not merge traces from different nets\n 3. Does not merge same-net traces whose endpoints are too far apart\n 4. Chains multiple merges (3 traces → 1)