fix: straighten segments left slightly off-axis by imprecise pin input - #722
Open
DPS0340 wants to merge 1 commit into
Open
fix: straighten segments left slightly off-axis by imprecise pin input#722DPS0340 wants to merge 1 commit into
DPS0340 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 25, 2026
Two boards render a visibly skewed trace because a pin coordinate in the input is off by a fraction of a mil from its neighbour (5.3999378 against 5.4). Schematic traces are orthogonal by construction, so the solvers never correct it and the skew survives to the output. Adds a TraceCleanupSolver pass that snaps segments within 1e-3 of an axis onto it exactly. The threshold sits two orders of magnitude below the smallest deliberate jog in the solvers (LABEL_SEARCH_STEP, 0.1), so a real diagonal is never flattened. Diagonal segments across the imported bug reports: 2 -> 0. Label placement and trace crossing counts are unchanged.
DPS0340
force-pushed
the
fix/near-orthogonal-segments
branch
from
July 26, 2026 04:37
59d55cd to
de9e981
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.
The defect
Two boards render a visibly skewed trace. Measured across every imported bug report:
Schematic traces are orthogonal by construction, so any non-axis-aligned segment is a bug. The offenders:
Identical
dxon both, which pointed at the input rather than the routing. It is:A pin coordinate arrives a fraction of a mil off its neighbour. Tracing it through the pipeline, the skew is present from
schematicTraceLinesSolveronward and no stage corrects it — the solvers assume orthogonality rather than enforcing it, so nothing notices.Fix
A
TraceCleanupSolverpass that snaps segments within1e-3of an axis onto it exactly, collapsing the smaller deviation and moving the later point so the trace's starting pin stays where the input put it.On the threshold:
1e-3is two orders of magnitude belowLABEL_SEARCH_STEP(0.1), the smallest deliberate jog any solver makes. A genuine diagonal is never flattened — the guard requires one axis to be within tolerance while the other is not.I put it in
TraceCleanupSolverrather than incloneAndCorrectInputProblemdeliberately. Snapping pins at input time would move the pins themselves, which affects chip bounds and every downstream placement decision; snapping the rendered segment fixes the symptom without perturbing the problem the solvers were given.Result
And confirming nothing else moved:
Verification
tsc --noEmitclean, biome clean.biome check --writereformats 9 unrelated files in this directory; I reverted those so the diff stays reviewable.Diff: 1 new file, 1 source file touched, plus the 4 snapshots. Independent of my other open PRs.