Skip to content

feat: merge nearby parallel same-net traces (#34)#354

Open
ron1nrest wants to merge 6 commits into
tscircuit:mainfrom
ron1nrest:main
Open

feat: merge nearby parallel same-net traces (#34)#354
ron1nrest wants to merge 6 commits into
tscircuit:mainfrom
ron1nrest:main

Conversation

@ron1nrest
Copy link
Copy Markdown

@ron1nrest ron1nrest commented May 16, 2026

Implemented MergeParallelTracesSolver to merge nearby parallel same-net traces. Added unit tests.

Thanks for the clarification — re-read #34 and updated the example.

Issue #34 is about snapping same-net segments that are almost on the same Y or X onto a shared axis (remove the small jog between parallel runs), not collapsing two unrelated 2-point traces into one line.

Repro (example35)

  • tests/assets/example35.json — minimal C14/C15-style layout on V3_3
  • tests/assets/example35-pre-merge-traces.json — two routed paths whose internal horizontal runs are offset by ~0.12 (the jog from the screenshot)

Before / after

tests/examples/example35.test.ts runs MergeParallelTracesSolver on deep-cloned traces:

Before After
Parallel horizontal runs at y=1 and y=1.12 (visible jog) Internal horizontals snapped to y=1; pin legs unchanged
before after

Assertions: still 2 traces; tracePath[1].y and tracePath[2].y1 on both; endpoints at 0 / 0.12 preserved.

Sorry for the earlier repro — it demonstrated trace consolidation, not same-Y alignment.

Closes #34
/claim #34

Add MergeParallelTracesSolver to align and consolidate close parallel segments on the same net, wired into the pipeline after overlap shift.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 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 17, 2026 6:35pm

Request Review

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Minimal JP6-R1-SJ2 repro; snapshots at traceOverlapShift vs mergeParallelTracesSolver.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Use explicit pre-merge trace repro (two parallel same-net segments)

- Snapshot single MergeParallelTracesSolver before/after solve()

- Deep-clone traces in solver constructor to avoid shared refs

Co-authored-by: Cursor <cursoragent@cursor.com>
Reproduces offset parallel horizontal runs on same net snapping to shared y=1, not collapsing two traces into one.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Merge same-net trace lines that are close together (make at the same Y or same X)

1 participant