Skip to content

feat: Add SameNetTraceCombiningSolver (#29)#305

Open
chenchong0215 wants to merge 17 commits into
tscircuit:mainfrom
chenchong0215:feature/same-net-trace-combining-solver
Open

feat: Add SameNetTraceCombiningSolver (#29)#305
chenchong0215 wants to merge 17 commits into
tscircuit:mainfrom
chenchong0215:feature/same-net-trace-combining-solver

Conversation

@chenchong0215
Copy link
Copy Markdown

@chenchong0215 chenchong0215 commented May 11, 2026

Summary

This PR adds a new SameNetTraceCombiningSolver that merges trace segments belonging to the same net when they are close together.

Changes

  1. New solver: SameNetTraceCombiningSolver.ts

    • Groups traces by globalConnNetId
    • Finds all trace segment endpoints within each group
    • Merges segments that are within 0.19mm (approximately 7.5px) of each other
    • Combines segments into straight traces
  2. Updated SchematicTracePipelineSolver.ts

    • Added sameNetTraceCombiningSolver property
    • Added pipeline step: sameNetTraceCombiningSolver runs after traceCleanupSolver
    • Updated netLabelPlacementSolver and example28Solver to use traces from sameNetTraceCombiningSolver

Algorithm

  1. Group all traces by globalConnNetId
  2. For each group, compute all trace segment endpoints
  3. Sort endpoints by position
  4. Merge segments within threshold distance
  5. Output combined straight traces

/claim #29

chenchong0215 and others added 2 commits May 11, 2026 12:51
- Add new SameNetTraceCombiningSolver that combines traces from the same net
- Solver is added after traceCleanupSolver in the pipeline
- Uses proximity threshold of 0.19 to determine which traces to consider for combining
- Only combines traces with the same globalConnNetId
- Includes comprehensive test coverage

Closes tscircuit#29
@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 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 16, 2026 9:35am

Request Review

@chenchong0215
Copy link
Copy Markdown
Author

Hi @seveibar 👋 All CI checks are passing. Would appreciate a review when you get a chance. Thanks! (fixes #29)

@chenchong0215
Copy link
Copy Markdown
Author

👋 @seveibar CI has been fixed! Updated snapshots and all tests now pass (64 pass, 0 fail). Ready for review. ✅

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.

1 participant