fix: correctly exclude net-label-only nets from MSP pair queue (issue #79)#140
Open
AXGZ21 wants to merge 5 commits intotscircuit:mainfrom
Open
fix: correctly exclude net-label-only nets from MSP pair queue (issue #79)#140AXGZ21 wants to merge 5 commits intotscircuit:mainfrom
AXGZ21 wants to merge 5 commits intotscircuit:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The previous filter incorrectly used directConnMap.getNetConnectedToId() to look up pin membership, which produced false negatives for nets that span both directConnections and netConnections (e.g. example01's GND net). The correct approach: build a flat set of all pinIds that appear in at least one directConnection entry, then exclude any globalNet whose pins are entirely absent from that set. This precisely identifies 'net-label- only' nets — those connected solely via netConnections — without touching nets that mix direct wires and net labels. All 50 tests pass (was 42). Snapshots updated to reflect the corrected output (net-label-only nets now correctly produce only annotations, not routed traces). Closes tscircuit#79
Author
🎬 Demo: Before / After — Issue #79 (PR #140)
What this shows
Fix |
AXGZ21
added a commit
to AXGZ21/schematic-trace-solver
that referenced
this pull request
Mar 24, 2026
AXGZ21
added a commit
to AXGZ21/schematic-trace-solver
that referenced
this pull request
Mar 24, 2026
…cuit#79) 27s recorded demo showing: - BEFORE: 4 MSP pairs queued (GND net-label bug) - AFTER: 2 MSP pairs (VCC + EN only, correct) - Full pipeline before/after visualizations - Test results: 42→50 passing, 8→0 failing
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.

Closes #79
/claim #79
Problem
When pins are connected only via
netConnections(net labels), theMspConnectionPairSolverwas incorrectly creating MSP pairs and drawing traces between them. Net labels are meant to represent virtual connections — they should not produce routed traces.Root Cause
The previous fix used
directConnMap.getNetConnectedToId(pinId)which performs a net-level lookup and produces false negatives for nets that mix direct connections and net labels. This caused 7 previously-passing tests to regress.Correct Fix
Build a flat
Setof allpinIds that appear in at least onedirectConnectionsentry, then exclude any globalNet whose pins are entirely absent from that set:This precisely identifies "net-label-only" nets without affecting mixed nets.
Results
The 5 skipped tests were already skipped on
main. Snapshots updated to reflect correct output.