Repository navigation
Step only near-straight wall joins on retry, within 20 degrees (WOR-878) - #420
Merged
Merged
Conversation
The step walks the thinner band's corner until it clears the thicker band's cap, whose line runs between two rounded points. Where the retry steps a nearly square corner, that line can lean off square by more than the bands lean off 90 degrees apart, so the corner runs along it and never clears. The walk now stops at the thin segment's length, where the band is gone and the graph is rejected, as it was before the retry.
The retry stepped every two-wall join beside a failed band whose walls pointed more than 90 degrees apart, square corners included, and some short chains came out past the miter bound. It now steps only joins within about 15 degrees of straight, decided exactly in Int128. A step whose thin corner can never clear the cap by walking jumps to the wall's length after a few millimetres instead of walking there. The short-chain sweep runs 40,000 draws, which covers the inputs that failed.
A 500 mm wall joining another thickness at both ends fails without the retry up to about 18.5 degrees off straight, past the 15 degree gate, so legal walls were rejected again. At 20 degrees such a wall resolves as a miter on its own.
kcjonson
marked this pull request as ready for review
November 15, 2026 17:40
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.
WOR-878, second part. Stacked on PR 419 (the bounded walk), which it includes until that merges.
PR 417 gave
resolveWallBandsa retry: when a wall's corner cut overruns the wall, the junctions at that wall's ends are redrawn as steps. It was written for a short wall meeting a wall of another thickness a few degrees off straight. Its condition was much wider than that: any wedge beside a failed band whose two walls point more than 90 degrees apart, square corners included.Two things followed. At near-square corners the step code's walk did not terminate (PR 419 bounds it). And some inputs the code used to reject were "resolved" with wrong shapes: in a 40,000-draw sweep of short chains, 5 of 11,982 non-folding inputs failed the tiling checks (a junction vertex past the miter bound, or a 3.6 mm gap), at corners about 100 to 105 degrees apart.
What changes
withinRetryBend(dirL, dirR): the wedge's two walls must be within 20 degrees of straight, tested exactly in 128-bit integers (|cross| * 11 <= -dot * 4; 4/11 is tan of 19.98 degrees). It gates the whole stepping condition. Anything further from straight is rejected, as it was before the retry existed.The invariant
Every input the pre-retry code accepted produces identical output.
WallProperties.NearStraightRetryKeepsEveryAcceptedJoin(about 160,000 inputs against a copy of the pre-retry logic) passes untouched with the same counts as before this change: 155,909 accepted, 3,216 rescued, 18 excused as main's own step geometry. So nothing the retry was written for is lost. A reviewer rebuilt both versions outside the repo and recounted the same numbers, comparing pieces and outline on every accepted input.How checked
WallProperties.ShortMixedChainsRejectOrTilenow runs 40,000 draws with nothing excused (1.4 s). With the gate switched off the same run fails exactly the five inputs above.WallProperties.ShortWallJoiningOtherThicknessAtBothEndsResolves: a 500 or 600 mm wall between two walls of another thickness, every thickness pairing, as a Z and as a C, each end from 3 to 20 degrees off straight (15,552 inputs, 2.2 s). With the gate at 15 degrees it fails on 66.What 20 degrees costs
On 6,000 short-armed T and star inputs (arms 150 to 750 mm), 4 are rescued with wrong shapes at 20 degrees against 1 at 15. The three new ones are T-junctions with the through-run bent 16 to 20 degrees and an arm of 162 to 268 mm, under the legal wall length; a T-junction split can leave arms that short. Example:
(0,0)->(162,0) h100; (-403,128)->(0,0) h150; (0,0)->(-199,-199) h75. It is the family already tracked on WOR-877 (a stem on a stepped through-run).Perf: nothing on layouts that resolve. On the retry path, one exact comparison per wedge, and the walk is at most 4 steps in the no-progress cases. Nothing was timed beyond the reviewer's single-input measurements above.