fix: scope the overlap-shift oscillation guard to the bouncing net pair (closes #1102) - #1103
Open
tcsenpai wants to merge 1 commit into
Open
fix: scope the overlap-shift oscillation guard to the bouncing net pair (closes #1102)#1103tcsenpai wants to merge 1 commit into
tcsenpai wants to merge 1 commit into
Conversation
TraceOverlapShiftSolver stopped the whole solve the first time a net pair's corrections bounced A -> B -> A. Every other cross-net overlap still queued at that moment was left in the output even though those pairs are independent and correctable. Track the oscillating net pair instead and skip only that pair in findNextOverlapIssue, so the remaining overlaps keep being corrected. On the reduced repro this takes the unresolved cross-net pairs from 2 to 1 (the genuinely oscillating pair). On board-1273 it goes from 6 to 1, routing the same 135 traces with none added or dropped. Closes tscircuit#1102
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
@mohan-bee @MustafaMulla29 when you have a moment, could one of you review this? It is a 26 line change in TraceOverlapShiftSolver plus a repro test; on board-1273 it takes the unresolved cross-net pairs from 6 to 1 with no trace added or dropped. Happy to adjust scope if you would rather see the oscillation guard handled differently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1102
Problem
TraceOverlapShiftSolverused its A -> B -> A oscillation guard as a global stop condition. The first net pair that oscillated ended the entire solve, so every cross-net overlap still queued at that moment stayed in the output, even though those pairs were independent of the oscillation and would have been corrected within a few more iterations.Fix
Record the oscillating net pair in
oscillatingNetPairKeysand skip that pair infindNextOverlapIssue, then keep stepping. The retained trace states are reset so the next pair is judged on its own history rather than the previous pair's. Nets that genuinely oscillate are still left alone, so the original non-termination guard is preserved.Results
Reduced repro (5 chips, derived from
board-1273): unresolved cross-net collinear pairs go from 2 to 1. The remaining pair is the one that actually oscillates; the independentRTS/DTRpair is now separated.board-1273: unresolved pairs go from 6 to 1. The same 135 traces are routed, with none added or dropped, and 17 of 135 paths shift. The shift solver now runs 38 iterations instead of 27, still well under the 100 iteration cap the repro test sets.Tests
tests/repros/repro-overlap-shift-cycle-abandons-independent-overlaps.test.ts, which fails onmainwith the extraconnectivity_net3::connectivity_net4overlap present.tests/repros/board-1273-trace-overlap-cycle.test.ts: iteration count updated 27 -> 38 and the snapshot regenerated for the intended geometry change.bun run format:checkandbunx tsc --noEmitclean.Written with AI assistance.