Skip to content

Add SameNetTraceCombiningSolver to merge parallel traces on same net (fixes #29)#349

Open
BossChaos wants to merge 2 commits into
tscircuit:mainfrom
BossChaos:feat/same-net-trace-combining
Open

Add SameNetTraceCombiningSolver to merge parallel traces on same net (fixes #29)#349
BossChaos wants to merge 2 commits into
tscircuit:mainfrom
BossChaos:feat/same-net-trace-combining

Conversation

@BossChaos
Copy link
Copy Markdown

Summary

This PR implements the SameNetTraceCombiningSolver as requested in #29 ($100 bounty).

What it does

  • Combines close trace segments on the same net that are parallel
  • Pipeline integration: Added as the final step in SchematicTracePipelineSolver, running after trace cleanup
  • Proximity-based detection: Uses configurable proximityThreshold (default 0.5) to determine mergeable segments
  • Parallel matching: Detects horizontal, vertical, and same-angle trace pairs

Implementation

  1. SameNetTraceCombiningSolver - Core algorithm:

    • Groups traces by net ID
    • Finds parallel traces on the same net
    • Combines close trace segments by merging paths
    • Simplifies merged paths by removing redundant points
  2. SameNetTraceCombiningSolverWrapper - Pipeline integration

  3. 4 test cases: parallel traces, different nets, far-apart traces, vertical traces

Bounty Claim

This PR addresses issue #29: combine same-net trace segments that are close together.

BSC Wallet: 0xdaE5d307339074A24F579dB48e7c639359D94904

BossChaos and others added 2 commits April 20, 2026 23:35
- The simplifyPath function had two identical passes that both removed collinear points
- The second pass (lines 25-38) was redundant and could potentially introduce extra trace lines
- Removed the duplicate loop, keeping only the first simplification pass

Fixes tscircuit#78
…e net

Fixes tscircuit#29 - Implements a new pipeline solver that combines close trace
segments on the same net. Uses proximity-based detection and parallel
trace matching to identify mergeable segments.

- SameNetTraceCombiningSolver: Core algorithm
- SameNetTraceCombiningSolverWrapper: Pipeline integration
- 4 test cases covering parallel, vertical, different-net, and far-apart scenarios
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 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 15, 2026 8:42am

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.

1 participant