Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tcsenpai
force-pushed
the
fix/near-axis-aligned-collision
branch
from
September 8, 2026 13:08
f2c7afb to
04ed04c
Compare
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 #1099
Problem
segmentIntersectsRectclassifies a segment as vertical or horizontal usingEPS = 1e-9, then returnsfalsefor anything that matches neither. Pin coordinates are not always exactly on the routing grid, so a segment can be skewed by ~6e-5: far below the schematic grid, but five orders of magnitude above1e-9. Those segments matched neither fast path and were reported as colliding with nothing.UnroutedTraceRecoverySolveraccepts the first candidate that passespathCollidesWithObstacles, so a skewed candidate was accepted and emitted as the final trace, running straight through a chip body it does not terminate on.Fix
When a segment matches neither fast path, classify it by its dominant axis if the off-axis deviation is under
1e-3and test it as the axis-aligned segment it was meant to be. Genuinely diagonal segments still returnfalse, so the change is limited to sub-grid skew.The
1e-3threshold sits below the schematic grid, so anything under it is float noise or an off-grid pin, never a deliberate diagonal.Tests
tests/repros/near-axis-aligned-trace-through-chip.test.tscovers both levels:Both assertions fail on
mainand pass with this change.bun test: 343 pass, 4 skip, 0 fail (mainis also 0 fail, so no regressions).bunx tsc --noEmit: clean.No snapshots changed.
Provenance
Found by differential fuzzing over the fixtures in
tests/bug-reportsandtests/examples, judging each mutated variant against its base fixture's baseline. Two independent fuzzed inputs reduce to this same root cause. The reproducer in the test is the delta-debugged minimum: 3 chips, 1 connection.This change was prepared with AI assistance and reviewed by the author.