Skip to content

Add conservative same-net trace segment merge phase#422

Open
iyop666 wants to merge 1 commit into
tscircuit:mainfrom
iyop666:fix-same-net-trace-segment-merge
Open

Add conservative same-net trace segment merge phase#422
iyop666 wants to merge 1 commit into
tscircuit:mainfrom
iyop666:fix-same-net-trace-segment-merge

Conversation

@iyop666
Copy link
Copy Markdown

@iyop666 iyop666 commented May 23, 2026

Summary

  • add a conservative SameNetTraceSegmentMergeSolver phase after trace cleanup
  • snap only close, overlapping, parallel segments that share the same globalConnNetId
  • preserve terminal pin segments so component endpoints are not moved
  • feed the merged trace output into the final net-label placement and downstream phases

Safety

The merge is intentionally narrow: segments must be same-net, same orientation, within the merge distance, and overlap most of the shorter run. Different nets, terminal-only pin segments, and small partial overlaps are left unchanged.

Verification

  • npx --yes bun test tests/solvers/SameNetTraceSegmentMergeSolver/same-net-trace-segment-merge-solver.test.ts tests/examples/example29.test.ts tests/examples/example30.test.ts tests/examples/example34.test.ts
  • npx --yes -p typescript@5.9.3 tsc --noEmit --pretty false
  • npm run build

Closes #29
/claim #29

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 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 23, 2026 10:49pm

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.

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

1 participant