Skip to content

fix: Fix extra net label in repro61, or remove trace (#79)#345

Open
IbrahimLaeeq wants to merge 1 commit into
tscircuit:mainfrom
IbrahimLaeeq:fix/bounty-issue-79
Open

fix: Fix extra net label in repro61, or remove trace (#79)#345
IbrahimLaeeq wants to merge 1 commit into
tscircuit:mainfrom
IbrahimLaeeq:fix/bounty-issue-79

Conversation

@IbrahimLaeeq
Copy link
Copy Markdown

Fixes #79.

/claim #79

were creating those traces:

  • MspConnectionPairSolver queued every net (including net-label-only ones) for trace pairing.
  • LongDistancePairSolver generated candidate trace pairs for every net regardless of distance, so even when MSP skipped a far-apart net-label-only pair, this solver reconnected it.

Changes

  1. lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts — filter queuedDcNetIds to only nets containing at least one pin that has an explicit direct connection.
  2. lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts — skip net-label-only nets when generating candidate pairs.

Together these ensure a net made up purely of net-label connections is represented by a separate net label on each pin, never a connecting trace.

Tests

  • Added tests/assets/example35.json (the repro61 scenario: two capacitors, GND/VCC net labels, no direct connections), tests/examples/example35.test.ts (asserts 0 connecting traces and 4 individual net labels, plus a snapshot), and site/examples/example35.page.tsx for the browser view.
  • Updated MspConnectionPairSolver_repro1.test.ts expectation (4 → 2 pairs — the net-label-only GND net no longer produces MSP pairs).
  • Regenerated 17 example SVG snapshots that legitimately changed: net-label-only nets now render as individual labels instead of jumping traces (direct-connection traces are unaffected; verified no solver failures).

Full suite: 58 pass, 0 fail; bunx tsc --noEmit clean.


Verified against the repository's own test suite before submission.

Copilot AI review requested due to automatic review settings May 14, 2026 18:35
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment May 14, 2026 6:35pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes net-label-only schematic nets being rendered as connecting traces by ensuring both MSP and long-distance trace generation skip nets that have no explicit direct connections.

Changes:

  • Filters MSP queueing to nets that include at least one directly connected pin.
  • Skips net-label-only nets during long-distance candidate generation.
  • Adds example35 regression coverage and updates affected SVG snapshots.

Reviewed changes

Copilot reviewed 6 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts Filters MSP processing to directly wired nets.
lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts Prevents long-distance traces for net-label-only nets.
tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro1.test.ts Updates expected MSP pair count for skipped label-only net.
tests/examples/example35.test.ts Adds regression assertions for no connecting traces and four labels.
tests/assets/example35.json Adds repro input with two capacitors and label-only nets.
site/examples/example35.page.tsx Adds browser-debug example page.
tests/examples/__snapshots__/example35.snap.svg Adds new regression snapshot.
tests/examples/__snapshots__/example33.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example31.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example28.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example26.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example24.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example22.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example20.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example16.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example15.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example12.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example10.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example03.snap.svg Updates snapshot for changed label-only net rendering.
tests/examples/__snapshots__/example01.snap.svg Updates snapshot for changed label-only net rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix extra net label in repro61, or remove trace

2 participants