fix: skip MSP pair generation for net-label-only nets (issue #79)#170
Open
cccignore wants to merge 2 commits intotscircuit:mainfrom
Open
fix: skip MSP pair generation for net-label-only nets (issue #79)#170cccignore wants to merge 2 commits intotscircuit:mainfrom
cccignore wants to merge 2 commits intotscircuit:mainfrom
Conversation
…t#79) Nets that exist only in netConnections and have availableNetLabelOrientations were incorrectly being queued for wire-trace generation, producing spurious traces alongside the net labels that represent them. Root cause: MspConnectionPairSolver used Object.keys(netConnMap.netMap) to build queuedDcNetIds, which includes all nets — including ones that should only be shown as net labels. Fix: filter queuedDcNetIds to only include nets that need wire traces: - nets with at least one pin in directConnections (always need a trace), OR - nets with no configured label orientation (no label → trace is the only representation of the connection) Nets that are purely in netConnections AND have availableNetLabelOrientations are skipped — NetLabelPlacementSolver handles them instead. This is stricter than filtering on directlyWiredPinIds alone (as done in PR tscircuit#162): that approach incorrectly removes traces for netConnections nets that have no label orientation configured, leaving the connection invisible. Changes: - MspConnectionPairSolver.ts: add directlyWiredPinIds + netLabelOrientedNets filter for queuedDcNetIds - MspConnectionPairSolver_repro1.test.ts: update expected pair count 4 → 2 (GND is net-label-only in that fixture) - Add MspConnectionPairSolver_issue79.test.ts: 3 targeted unit tests - Add SchematicTracePipelineSolver_repro_issue79.test.ts: full pipeline repro - Add SchematicTracePipelineSolver_issue79.page.tsx: demo page - Update 7 SVG snapshots (spurious GND/VCC traces removed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LongDistancePairSolver independently iterates all nets in netConnMap to build long-distance candidate pairs, bypassing the filter added to MspConnectionPairSolver. Nets that are purely label-only (in netConnections + availableNetLabelOrientations, no directConnections) were therefore still producing spurious traces via this second path. Apply the same hasDirect / hasLabel guard so both solvers agree on which nets require wire traces. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Hi! Could you take a look at this PR when you have a chance? It fixes issue #79 by filtering out net-label-only nets from the MSP pair and long-distance pair generation pipelines. All 53 tests pass and CI is green. Thanks! |
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 #79
Problem
Nets connected only via
netConnectionsthat haveavailableNetLabelOrientationsconfigured were incorrectly queued for wire-trace generation. This produced spurious trace lines alongside (or instead of) the net labels that should represent the connection — the repro61 bug.Root Cause
MspConnectionPairSolverbuiltqueuedDcNetIdsfromObject.keys(netConnMap.netMap), which includes every net — including purely label-only ones like GND/VCC.Fix
Filter
queuedDcNetIdsto keep only nets that actually need wire traces:directConnections(explicit wire always wins)netConnectionswith no label orientation configured (no other way to show the connection)netConnectionswhose user-facing net ID appears inavailableNetLabelOrientations—NetLabelPlacementSolverhandles theseWhy this is better than PR #162
PR #162 filters on
directlyWiredPinIdsalone, which removes allnetConnectionsnets whendirectConnectionsis empty — leavingMspConnectionPairSolver_repro2-style circuits with no connections at all. This fix only removes nets that have an explicit label orientation configured.Tests
MspConnectionPairSolver_issue79.test.ts— 3 unit tests:netConnections+ orientation) → 0 MSP pairsnetConnectionswithout orientation → still gets MSP pairdirectConnectionsandnetConnections→ keeps pairSchematicTracePipelineSolver_repro_issue79.test.ts— full pipeline: VCC/GND produce no spurious traces, net labels are placedMspConnectionPairSolver_repro1— expected pair count updated 4 → 2 (GND was net-label-only)SchematicTracePipelineSolver_issue79.page.tsxAll 53 tests pass, 0 fail.