Clear grounded load pairs from bodies level with the pair - #214
Open
zkasuran wants to merge 1 commit into
Open
Conversation
GroundedLoadPairSolver stacks each grounded two-component chain vertically under its main-chip pin, then drops the pair down to clear bodies sitting in its column. The clearance pass skipped any body whose top edge was not above the pair's top edge, so a chip parked level with the pair (top at or below the pair top) was ignored and left overlapping. Drop the pair below every body it still overlaps while keeping the existing guard against bodies that already sit fully beneath it. A wider requested chip gap can no longer stack a pair on top of a neighbour. Adds a repro built from the repro44 e2e circuit at a wider chip gap, where the R3/D1 grounded load pair used to land on top of R2.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
GroundedLoadPairSolverre-stacks each grounded two-component load chain (a two-pin part feeding another two-pin part down to ground) vertically under its main-chip pin, then callsmovePairBelowObstaclesto drop the pair down until it clears any body sitting in its column.That clearance pass used the wrong guard. It only treated a body as an obstacle when the body's top edge was above the pair's top edge:
A body that ended up level with the pair (its top at or below the pair top) was skipped even when it overlapped the pair, so the pair was left sitting on top of it.
Repro
tests/repros/repro-grounded-load-pair-neighbor-overlap.test.tsruns the existing repro44 e2e circuit with the requestedchipGapwidened to 1. At that gap the packer parks R2 level with the R3/D1 grounded load pair. Before this change the pair landed directly on top of R2, an overlap of about 0.29 in area. A larger requested gap producing overlapping chips is clearly wrong.This is not specific to repro44. I found it by widening
chipGapon the fixtures, then reproduced the same guard failing on many small generated circuits at the defaultchipGapof 0.2.Fix
Skip a body only when it already sits entirely below the pair, since dropping the pair further would move it toward that body rather than clear it. Any body that still overlaps the pair's vertical span, including one level with the pair, is now cleared:
Verification
On this branch:
bun test: 90 pass, 1 skip, 0 fail. The new repro fails without the fix and passes with it.bunx tsc --noEmit: clean.bun run format:check: clean.No existing snapshots changed.
AI assistance
I authored and verified this change. AI assistance (Claude, Anthropic) was used while writing the fix and the test. I reviewed the diff and traced the overlap through the pipeline to
GroundedLoadPairSolver, then verified locally before submitting.bun test,bunx tsc --noEmitandbun run format:checkall pass.