Preserve pad geometry and repair constrained via clearances - #91
Merged
seveibar merged 31 commits intoSep 7, 2026
Conversation
Benchmark This PRRun benchmarks by commenting on this PR: Everything after Examples:
Any PR whose title contains |
imrishabh18
changed the base branch from
main
to
codex/srj18-sample9-snapshot-baseline
September 5, 2026 15:41
seveibar
reviewed
Sep 5, 2026
…ify-pr91-srj-tests
Contributor
Video reviewComplete Reviewing commit This comment updates as work progresses. Job: 1219379415-issue_comment-5571720665 |
seveibar
approved these changes
Sep 7, 2026
seveibar
approved these changes
Sep 7, 2026
seveibar
merged commit Sep 7, 2026
832b748
into
codex/srj18-sample9-snapshot-baseline
4 checks passed
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
imrishabh18
deleted the
codex/include-via-pad-clearance-in-repair-acceptance
branch
September 7, 2026 18:22
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.
Rotated pads were checked as axis-aligned copper, and some repair candidates moved a via away from one trace into another. The route converter also skipped the outgoing wire immediately after a via, so that copper was missing from the DRC input.
Preserve the original pad dimensions and rotation in the checker and Circuit JSON conversion. Use
transformation-matrixfor coordinate transforms and@tscircuit/math-utilsfor geometry; there are no stored sine/cosine fields. Candidate construction keeps the existing routing obstacles. The repair does not change obstacle approximations or topology construction.The repair now checks both wires adjoining a via and considers the clearance boundaries of neighboring traces when moving it. Pad checks cover every layer traversed by the via. Existing local displacement candidates remain available when unrelated DRC errors are present, within the same candidate limit. Newly introduced wires and vias must also respect the board outline. Terminal escape candidates retain the existing selection order and full-board DRC acceptance.
This PR is based on tests-only PR #98, stacked on the upstream stage-handoff fix #97. It keeps a small set of real-SRJ regressions: SRJ18 samples 5 and 9, plus the existing dataset01 circuit143 test. Their actual routed output is snapshotted. The existing converter test also checks the outgoing wire after a via.
The same real SRJ18 sample 9 input shows 15 remaining DRC errors → 0, preserving all 256 routes and their endpoints. With the corrected pad geometry and via conversion, its initial count is 8.
Both snapshots render the same original pad outlines, including the rotated pads around the central chip. The checker now measures those outlines correctly.
Validation at
37d2b7af008c3a79c1a794e2ca307583a0f19c98:70284cdcversus mainfb6c6d77: 85/85 complete and 85/85 relaxed-DRC clean on both revisions, zero timeouts, and no per-board regressions. Benchmark run. The SRJ18 comparison also has no per-board completion, timeout, or relaxed-DRC regressions: 13/16 complete, 8/16 relaxed-DRC clean, and one timeout on both revisions. Total DRC errors fall from 98 to 64, with no board gaining errors. Median time is +2.5%, P95 +4.7%. SRJ18 benchmark. Final integration CI passes one27f1c8b: all nine test shards, build, TypeScript, formatting, ID checks, and deployment checks. The benchmark revision70284cdchas identical production source and dependencies; the final follow-up only records native macOS/Linux bugreport90 snapshots.Additional pad-geometry illustrations