fix: prevent traces with same net name from incorrectly connecting#102
Open
LiamConner10 wants to merge 1 commit intotscircuit:mainfrom
Open
fix: prevent traces with same net name from incorrectly connecting#102LiamConner10 wants to merge 1 commit intotscircuit:mainfrom
LiamConner10 wants to merge 1 commit intotscircuit:mainfrom
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
techmannih
reviewed
Dec 27, 2025
Member
techmannih
left a comment
There was a problem hiding this comment.
please Add before and after screenshots
Author
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.


Summary
Fixes tscircuit/core#1498 - Schematic traces with the same net name were incorrectly jumping/connecting to each other.
Root cause: The
getConnectivityMapsFromInputProblemfunction 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 fixtests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_sameNetIdNoMerge.test.ts: 5 new test casesTest plan
bunx tsc --noEmit)bun test)/attempt #1498
🤖 Generated with Claude Code