feat: merge nearby same-net trace segments#335
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
digzrow-coder
left a comment
There was a problem hiding this comment.
This does not actually combine the close parallel same-net segments that #29/#34 are about. The merge criterion only looks at endpoint-to-endpoint Manhattan distance, then concatenates both paths with a bridge. For two duplicated same-net horizontal runs that overlap and are 0.05 apart, e.g.
[{ x: 0, y: 0 }, { x: 2, y: 0 }]
[{ x: 0, y: 0.05 }, { x: 2, y: 0.05 }]with the PR's maxEndpointGap: 0.12, the solver outputs a single path shaped like a loop/rectangle:
[
{ x: 0, y: 0 },
{ x: 2, y: 0 },
{ x: 2, y: 0.05 },
{ x: 0, y: 0.05 },
]That preserves both parallel runs and adds a vertical connector; it does not snap/merge them onto one shared X/Y axis, so the visual duplication from the bounty remains. The tests only cover an endpoint-gap join, not the near-overlapping parallel segment case shown in the issue screenshots.
The merge phase needs segment-level overlap/alignment logic: detect same-net H/H or V/V segments with small orthogonal separation and overlapping spans, choose a shared axis, and rewrite the duplicated runs onto that axis while preserving pin endpoints and avoiding unsafe crossings.
|
Thanks for the concrete review. I pushed a follow-up commit (87a787f) that handles the overlapping-parallel-segment case directly before falling back to endpoint bridging. What changed:
Verification run locally:
|
Closes #29.
/claim #29
Summary
SameNetTraceSegmentMergeSolveras a dedicated pipeline phase after trace cleanup and before the second net-label placement pass.userNetId, thenglobalConnNetId, thendcConnNetId).mspConnectionPairIdsandpinIdswithout duplicates.Validation
Prepared patch validation before submission:
npx tsc --noEmitpassednpx biome check --writepassed on the new solver/test filesgit diff --checkpassedSubmission-run validation:
origin/main(d81247e/ v0.0.57)bun testcould not be run in this environment becausebunis not installed