fix(core): stabilize collinear wall junction ordering - #596
Conversation
|
Approved and merging — thank you @tomatotomata, and welcome. This is the right fix and the right size for it. Verified rather than assumed:
Full gate green locally: Agreed on scoping out the near-equal-angle epsilon, and on reflection it belongs out of scope for a stronger reason than "different change": it isn't a determinism gap at all. I raised it in the issue as an open question, and working through your fix answers it. One note on your validation commands: |
|
Merged as One process note for next time: this was open as a draft, which is why CI didn't run until I approved the workflow (first-time contributor from a fork needs that regardless) and why the merge initially bounced. The body read as a finished submission — full validation output and an explicit scope note — so I marked it ready myself rather than bouncing it back to you. If a PR is ready for review, opening it undrafted gets it looked at sooner. Thanks again. If you want another in the same area, #588 (batching a level's static walls per material) is labelled |
Summary
Closes #581
Validation
npx --yes bun@1.3.0 test packages/core/src/systems/wall/wall-mitering.test.tspassed: 12 tests, 0 failures, 145 expectationsnpx --yes bun@1.3.0 x biome lint packages/core/src/systems/wall/wall-mitering.ts packages/core/src/systems/wall/wall-mitering.test.tspassedgit diff --checkpassedThe near-equal-angle epsilon behavior mentioned in the issue is intentionally out of scope.
Note
Low Risk
Small, localized change to junction sort order in wall rendering geometry; behavior only affects equal-angle cases and is covered by a new test.
Overview
Wall miter junctions at shared corners now sort connected walls by outgoing angle and, when angles match (collinear overlaps), by wall ID so adjacent-wall pairing and intersection geometry no longer depend on how walls are ordered in the input array.
A regression test asserts that
calculateLevelMitersyields identicaljunctionDatafor the same wall set in forward vs reversed order at a multi-wall junction.Reviewed by Cursor Bugbot for commit 02aae8d. Bugbot is set up for automated code reviews on this repo. Configure here.