Skip to content

fix: clone netMap to prevent extra traces for net-label-only connections#182

Open
inventelpk-cell wants to merge 1 commit intotscircuit:mainfrom
inventelpk-cell:fix-extra-net-label-repro61
Open

fix: clone netMap to prevent extra traces for net-label-only connections#182
inventelpk-cell wants to merge 1 commit intotscircuit:mainfrom
inventelpk-cell:fix-extra-net-label-repro61

Conversation

@inventelpk-cell
Copy link
Copy Markdown

Summary

Fixes issue where pins connected only via netConnections (net labels) incorrectly generate physical trace lines.

Root cause: directConnMap.netMap was passed by reference to the ConnectivityMap constructor for netConnMap. When netConnMap.addConnections() added net-label-only connections, it mutated the shared netMap, causing queuedDcNetIds to include nets with zero direct connections.

Fix: Shallow-clone netMap: new ConnectivityMap({...directConnMap.netMap})

Closes #79

Test plan

  • All 49 tests pass (5 skipped)
  • TypeScript compilation passes (tsc --noEmit)

Shallow-clone directConnMap.netMap before passing to ConnectivityMap
constructor. Prevents netConnMap.addConnections() from mutating the
shared netMap, which caused queuedDcNetIds to include nets with zero
direct connections, generating traces for net-label-only connections.

Closes tscircuit#79
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 13, 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 Apr 13, 2026 1:13pm

Request Review

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

2 participants