Validate copper added by safe layer moves - #116
Open
seveibar wants to merge 11 commits into
Open
Conversation
Benchmark This PRRun benchmarks by commenting on this PR: Everything after Examples:
Any PR whose title contains |
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.
Safe layer moves could reduce the total DRC count while adding a wire or via annulus over foreign copper, or placing an interior-span via inside a pad. Validate newly added copper before committing the move. Existing copper may retain incoming violations, including terminal segments shortened by the layer move.
The operation checks canonical net aliases, physical endpoint widths, via layer spans, fixed routes, plated through-obstacle bodies, and rotated rectangular or rounded pads. New outside-pad vias preserve explicit pad clearance; same-net pads retain annulus non-overlap when no spacing is declared. Explicit via-in-pad operations keep their separate behavior. Search limits and the DRC evaluator are unchanged.
Retained copper is recognized by exact primitive keys or endpoint-disc containment within an original capsule. The containment calculation accounts for floating-point roundoff using coordinate magnitude; it does not add a PCB clearance tolerance. New extensions, thicker copper, and displaced contacts remain rejected.
Validation: 113 native tests / 4,030 assertions and TypeScript pass. Generic regressions cover foreign wire/via contacts, thick endpoint caps, plated bodies, translated interior-pad contacts, layer membership, same-net aliases, declared clearance, and split terminal copper at multiple rotations and translations. Native and Linux sample 9 remain DRC clean; the reviewed pad-feasibility snapshot removes one prior same-net via/pad contact.
Two small performance changes avoid unnecessary work without changing candidate decisions: existing expanded pad bounds skip exact distance transforms for separated points, and topology-only candidates skip constructing a force-movement index they never read. Generic tests compare legal via positions and eager-versus-sparse candidate geometry and acceptance.
Full installed-package SRJ18 samples 4, 6, and 15 remain reference DRC clean with the retained-copper correction. Sample 4 final geometry and regional search work are unchanged from the prior implementation. Full profiled runs were affected by system load and interruptions, so they are not used as benchmark speed claims; the autorouter PR will report its unchanged same-machine benchmark separately. Prior mock-based replay timings are excluded from validation evidence.
Stacked on #115; no dependency merge is requested by this PR.