fix: exclude net-label-only nets from MSP pair queue (closes #79)#162
Open
satyamdas03 wants to merge 1 commit intotscircuit:mainfrom
Open
fix: exclude net-label-only nets from MSP pair queue (closes #79)#162satyamdas03 wants to merge 1 commit intotscircuit:mainfrom
satyamdas03 wants to merge 1 commit intotscircuit:mainfrom
Conversation
) Pins connected only via netConnections (net labels like VCC/GND with no directConnections) were incorrectly generating routed traces. Net labels already represent the electrical connection visually, so no wire trace should be drawn between them. Root cause: getConnectivityMapsFromInputProblem passed directConnMap.netMap by reference to new ConnectivityMap(...), so adding net-label entries to netConnMap mutated directConnMap.netMap as well. This caused Object.keys(netConnMap.netMap) to include purely-netlabel nets. Fix: Build a flat Set of pin IDs that appear in at least one directConnections entry, then filter the queued net IDs to only those where at least one connected pin is in that set. Net-label-only nets are excluded and produce no MSP pairs / traces. Tests: - MspConnectionPairSolver_repro61: 0 MSP pairs for netlabel-only circuits - SchematicTracePipelineSolver_repro61: full pipeline, 0 traces generated - MspConnectionPairSolver_repro1 expectation corrected (4 → 2 pairs) - 7 example snapshots updated (cleaner output, no spurious GND traces) - 51 pass, 0 fail /claim tscircuit#79 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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.
Problem
Pins connected only via
netConnections(net labels like VCC/GND, with nodirectConnections) incorrectly produced routed wire traces. Since net labels already represent the electrical connection visually, drawing a wire trace between these pins creates a spurious extra line (the repro61 bug).Root Cause
getConnectivityMapsFromInputProblempassesdirectConnMap.netMapby reference tonew ConnectivityMap(...). WhennetConnMap.addConnectionsadds net-label entries, it mutates the same underlying object — sodirectConnMap.netMapends up containing all nets, including purely-netlabel ones.As a result,
Object.keys(netConnMap.netMap)inMspConnectionPairSolverqueues every net (including VCC, GND that have zero direct wires), which generates spurious MSP pairs and traces.Fix
Build a flat
Set<string>of pin IDs that appear in at least onedirectConnectionsentry. Then filter the queued net IDs to only those where at least one connected pin is in that set:Tests
MspConnectionPairSolver_repro61— verifies 0 MSP pairs for net-label-only circuits ✅SchematicTracePipelineSolver_repro61— full pipeline, 0 traces generated ✅MspConnectionPairSolver_repro1expectation corrected (4 → 2 pairs; GND was net-label-only) ✅/claim #79