fix: don't create traces for net-label-only connections#116
Open
aifunmobi wants to merge 1 commit intotscircuit:mainfrom
Open
fix: don't create traces for net-label-only connections#116aifunmobi wants to merge 1 commit intotscircuit:mainfrom
aifunmobi wants to merge 1 commit intotscircuit:mainfrom
Conversation
Net connections (netConnections) represent virtual connections shown via net labels — they should NOT produce physical traces. Only direct connections (directConnections) should generate MSP pairs and traces. Root cause: ConnectivityMap shared its netMap by reference between directConnMap and netConnMap, causing net-label connections to pollute the direct connection map. Both MspConnectionPairSolver and LongDistancePairSolver then used the polluted global map to create trace pairs for net-label-only pins. Three fixes: 1. Clone netMap in getConnectivityMapsFromInputProblem to prevent directConnMap pollution 2. MspConnectionPairSolver: iterate over directConnMap nets and use directConnMap to find connected pins 3. LongDistancePairSolver: use directConnMap for candidate pair generation instead of netConnMap Closes tscircuit#79 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
Hi — just checking in on this. CI is passing. Let me know if there's anything to adjust! |
Author
|
@seveibar Just following up on this one — fixes the extra net label bug in repro61. All CI checks passing. Happy to make any changes needed! |
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 #79 — Traces were incorrectly drawn between pins connected only via net labels (e.g., GND/VCC
netConnections). Net labels are meant to visually represent virtual connections without physical traces.Root cause:
ConnectivityMapshared itsnetMapby reference betweendirectConnMapandnetConnMapingetConnectivityMapsFromInputProblem. WhennetConnMap.addConnections()added net-label entries, they also appeared indirectConnMap.netMap. BothMspConnectionPairSolverandLongDistancePairSolverthen created trace pairs for net-label-only pins.Three fixes:
getConnectivityMapsFromInputProblem: ClonenetMapbefore passing tonetConnMapconstructor to prevent cross-contaminationMspConnectionPairSolver: Iterate overdirectConnMapnet IDs and usedcConnMap(notglobalConnMap) to find connected pinsLongDistancePairSolver: UsedirectConnMapfor candidate pair generation instead ofnetConnMapTest plan
SchematicTracePipelineSolver_repro04_net_label_only.test.ts— two capacitors connected only via GND/VCC net labels, asserts 0 MSP pairs and 0 tracesMspConnectionPairSolver_repro1assertion (4 → 2 pairs, since GND was a netConnection)🤖 Generated with Claude Code