Skip to content

Conversation

@LiamConner10
Copy link

@LiamConner10 LiamConner10 commented Dec 26, 2025

Summary

Fixes tscircuit/core#1498 - Schematic traces with the same net name were incorrectly jumping/connecting to each other.

Root cause: The getConnectivityMapsFromInputProblem function was using user-provided net IDs (like "GND") as grouping keys, causing all connections with the same net name to be merged into a single connectivity island.

Fix: Use unique synthetic net IDs (dc_0, dc_1, nc_0, etc.) for each connection entry. Pins are now only considered connected if explicitly listed in the SAME connection entry.

Changes

  • lib/solvers/MspConnectionPairSolver/getConnectivityMapFromInputProblem.ts: Core fix
  • tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_sameNetIdNoMerge.test.ts: 5 new test cases

Test plan

  • Type check passes (bunx tsc --noEmit)
  • Unit tests pass (bun test)
  • Verify traces no longer jump between unrelated pins with same net name

/attempt #1498

🤖 Generated with Claude Code

Fixes tscircuit/core#1498

## Problem
Schematic traces with the same net name (e.g., "GND") were incorrectly
jumping/connecting to each other even when they weren't part of the same
electrical connection.

## Root Cause
The `getConnectivityMapsFromInputProblem` function was using user-provided
net IDs as grouping keys, causing all connections with the same net name
to be merged into a single connectivity island.

## Solution
Use unique synthetic net IDs (`dc_0`, `dc_1`, `nc_0`, etc.) for each
connection entry instead of the user-provided net names. This ensures
pins are only considered connected if they are explicitly listed in the
SAME directConnection or SAME netConnection entry.

## Changes
- Each directConnection now gets a unique ID: `dc_${index}`
- Each netConnection now gets a unique ID: `nc_${index}`
- netConnections that share a pin with an existing directConnection
  properly extend that connection
- Added 5 test cases to verify the fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 26, 2025

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

Project Deployment Review Updated (UTC)
schematic-trace-solver Ready Ready Preview, Comment Dec 26, 2025 1:52am

Copy link
Member

@techmannih techmannih left a comment

Choose a reason for hiding this comment

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

please Add before and after screenshots

@techmannih techmannih requested a review from seveibar December 27, 2025 13:22
@LiamConner10
Copy link
Author

Before:

image

After:

image

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.

Bug schematic traces with the same net name jumpeing to eachother

2 participants