fix: don't route traces between net-label-only pins (#79)#395
Open
voltrace-io wants to merge 2 commits into
Open
fix: don't route traces between net-label-only pins (#79)#395voltrace-io wants to merge 2 commits into
voltrace-io wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
When pins share a net only via net labels (netConnections) with no directConnections, the solver was creating routed traces between them. Root causes fixed: 1. getConnectivityMapsFromInputProblem passed directConnMap.netMap by reference into netConnMap. Subsequent addConnections() calls mutated the direct-only map. Now clones the netMap to keep views independent. 2. MspConnectionPairSolver._step looked up pins via globalConnMap which unions direct + net connections. Switching to dcConnMap means net-only nets produce zero MSP pairs (and zero routed traces). 3. LongDistancePairSolver iterated every net in netConnMap, including label-only nets. It now skips nets with no primary MSP pair. Tests: - New repro61 test locks in the fix at MSP and pipeline levels - MspConnectionPairSolver_repro1 updated (GND net-only: 4 -> 2 pairs) - 22 example snapshots regenerated (spurious net-only traces removed) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
f614077 to
894622d
Compare
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 the "trace jumping" bug where the solver created routed traces between pins that share a net only via net labels (
netConnections), with nodirectConnectionsbetween them. This is the extra net label / spurious trace issue described in #79 (see also tscircuit/core#1503).Root causes fixed:
Reference mutation in
getConnectivityMapsFromInputProblem—directConnMap.netMapwas passed by reference intonetConnMap. SubsequentaddConnections()calls mutated the "direct-only" map too, sodcConnMapended up containing net-label-only pins. Fixed by cloning the netMap.Wrong map in
MspConnectionPairSolver._step— Pin lookup usedglobalConnMap(which unions direct + net connections). Switching todcConnMapmeans net-label-only nets produce zero MSP pairs and zero routed traces.LongDistancePairSolverreinvented traces for label-only nets — It iterated every net innetConnMapincluding nets that exist only as labels. Now skips any net that has no primary MSP pair: long-distance routing should only complete partially-routed nets, never create traces for label-only nets.Changes:
repro61test locks in the fix at both MSP and pipeline levelsMspConnectionPairSolver_repro1updated: GND (net-only, 3 pins) correctly produces 0 MSP pairs instead of 2Tests: 60 pass, 4 skip, 0 fail
Typecheck:
bunx tsc --noEmit— no errorsFormat:
biome format— clean/claim #79
Review & Testing Checklist for Human
directConnectionsandnetConnectionsstill produce correct traces (e.g., example01, example15)Notes