Skip to content

fix: skip MSP pair creation for net-label-only connections (fixes #79)#563

Closed
singhaditya21 wants to merge 1 commit into
tscircuit:mainfrom
singhaditya21:bounty-fix-repro61
Closed

fix: skip MSP pair creation for net-label-only connections (fixes #79)#563
singhaditya21 wants to merge 1 commit into
tscircuit:mainfrom
singhaditya21:bounty-fix-repro61

Conversation

@singhaditya21

Copy link
Copy Markdown

Problem

When two or more pins are connected only via netConnections (net labels like GND, VCC), the MspConnectionPairSolver was incorrectly queuing those nets for MSP pair creation and routing physical traces between the pins.

This caused a spurious trace to appear between components that should only display individual net labels, and the NetLabelPlacementSolver would then add an extra net label on that trace — producing the duplicate label visible in the repro61 screenshot (issue #79).

Solution

Filter queuedDcNetIds in MspConnectionPairSolver to exclude any global connectivity net whose component pins do not appear in directConnMap. Nets with at least one pin in directConnections continue to produce MSP pairs and routed traces as before. Purely label-only nets (only in netConnections) receive only net label placements — no redundant trace.

Changes

  • MspConnectionPairSolver.ts: filter net-label-only nets from the MSP queue
  • New test: SchematicTracePipelineSolver_repro61.test.ts — verifies no MSP pairs and no traces are created for net-label-only connections; GND and VCC labels are still placed
  • Updated test: MspConnectionPairSolver_repro1.test.ts — corrects expected pair count from 4 to 2 (GND was net-label-only, only VCC and EN pairs remain)
  • Updated tests: repro130 and repro126 — updated assertions to reflect that net-label-only nets no longer produce routed traces
  • Regenerated snapshots: 18 SVG snapshots updated to reflect removal of spurious traces

Test Results

All 72 tests pass, 4 skipped, 0 failures.

/claim #79
fixes #79

When pins are connected only via netConnections (net labels), the solver
was incorrectly creating MSP pairs and routing traces between them. This
produced spurious traces alongside the net labels, causing the NetLabel-
PlacementSolver to place an extra net label on the trace in addition to
the individual pin labels — the duplicate label visible in repro61.

The fix filters queuedDcNetIds in MspConnectionPairSolver to exclude any
global net whose component pins all lack a presence in directConnMap.
Nets with at least one pin directly wired (directConnections) continue to
produce MSP pairs and routed traces as before; purely label-only nets
receive only net label placements.

Changes:
- MspConnectionPairSolver: filter net-label-only nets from MSP queue
- Add SchematicTracePipelineSolver_repro61.test.ts regression test
- Update MspConnectionPairSolver_repro1 expected pair count (4 → 2)
- Update repro130 and repro126 tests to reflect no spurious traces
- Regenerate 18 SVG snapshots

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment Jun 26, 2026 4:37pm

Request Review

@singhaditya21

Copy link
Copy Markdown
Author

Friendly nudge 🙂 — CI is green and this is mergeable whenever you have a moment. Happy to rebase or address any feedback if it helps. Thanks for the great project!

@singhaditya21 singhaditya21 closed this by deleting the head repository Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix extra net label in repro61, or remove trace

1 participant