Skip to content

Add same-net trace merging phase#291

Open
chacu wants to merge 2 commits into
tscircuit:mainfrom
chacu:fix-same-net-trace-merging
Open

Add same-net trace merging phase#291
chacu wants to merge 2 commits into
tscircuit:mainfrom
chacu:fix-same-net-trace-merging

Conversation

@chacu
Copy link
Copy Markdown

@chacu chacu commented May 9, 2026

/claim #29

Closes #29

Summary

  • add a dedicated SameNetTraceMergingSolver pipeline phase after overlap shifting
  • align nearby same-net horizontal/vertical internal trace segments onto a shared axis when their ranges overlap
  • keep endpoint-only trace segments anchored and avoid creating colinear overlaps with different-net traces
  • add focused unit coverage for same-net merging behavior and the different-net guard
  • add a Cosmos visual fixture for before/after inspection of same-net trace merging

Reproduction / Verification

The focused test reproduces the core failure mode from the bounty: two routed same-net traces have close, overlapping horizontal runs on separate axes. The new solver collapses those runs onto a shared axis while preserving anchored endpoint-only traces.

The test suite also covers the guard case where the tempting merge axis would create a colinear overlap with a different net, so the solver leaves both traces untouched.

The visual fixture at site/SameNetTraceMergingSolver/SameNetTraceMergingSolver.page.tsx shows the same scenario side-by-side: before merging and after the solver collapses the same-net runs.

Test Plan

  • ./node_modules/.bin/bun test tests/solvers/SameNetTraceMergingSolver/SameNetTraceMergingSolver.test.ts
  • npm run format:check
  • ./node_modules/.bin/bun test
  • npm run build

@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 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 10, 2026 9:51am

Request Review

@chacu chacu marked this pull request as ready for review May 10, 2026 09:52
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.

New Phase To combine same-net trace segments that are close together

1 participant