fix: near-axis-aligned segments no longer escape obstacle collision - #1109
Open
tbontb-iaq wants to merge 1 commit into
Open
tbontb-iaq wants to merge 1 commit into
tbontb-iaq wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
segmentIntersectsRect declared any segment that is neither exactly vertical nor exactly horizontal collision-free. Real pin coordinates are not always exactly on the routing grid (e.g. x = 5.3999378 next to x = 5.4), so nearly axis-aligned segments sailed through chip bodies and were accepted by UnroutedTraceRecoverySolver as collision-free. Non-axis-aligned segments now run a slab (Liang-Barsky) clip against the rect. Axis-aligned fast paths keep their historical semantics: a real interior overlap counts, a segment that merely touches an edge or corner does not (tMax - tMin > eps for the slanted path). Fixes tscircuit#1099
tbontb-iaq
force-pushed
the
fix/near-axis-collision-escape
branch
from
September 9, 2026 03:14
30099d8 to
7786497
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.
Fixes #1099
/attempt #1099Root cause
segmentIntersectsRectreturnedfalsefor every segment that is neither exactly vertical nor exactly horizontal. Real pin coordinates are not always exactly on the routing grid — a pin atx = 5.3999378connected to one atx = 5.4produces a segment withdx = 6.22e-5: far below the schematic grid, yet five orders of magnitude above the1e-9axis-alignment EPS. Such segments passed every obstacle check, andUnroutedTraceRecoverySolveraccepted the first skewed candidate as collision-free.Fix
Non-axis-aligned segments now run a slab (Liang-Barsky) clip against the obstacle rect. The axis-aligned fast paths keep their historical semantics:
tMax - tMin > epson the slanted path).Verification
tests/solvers/SchematicTraceSingleLineSolver2/segment-intersects-rect-near-axis.test.tscover: near-vertical/near-horizontal segments crossing a chip body (previouslyfalse, nowtrue), near-axis segments outside the rect, slanted crossings, and corner-touching glances (still collision-free).