Repository navigation
Conversation
…s pieces from wallSpans (WOR-876)
…or nav and sight to share (WOR-876)
…eir trimmed bands with wallSpans (WOR-876)
…ole millimetres (WOR-876)
…pin a backwards and a diagonal door wall (WOR-876)
…lamped to the trimmed band (WOR-876)
…graphs # Conflicts: # libs/geometry/offset/WallOffset.test.cpp
wallSpans indexed the trims of bands it only asserted were resolved, so a release build handed a rejected graph would read past them. It now gives every segment an empty list, which keeps its one-list-per-segment shape for callers. The header also states that one segment's gaps must not overlap, and how the spans are tagged when they do.
l, r, dir, and h in the span and graph code and its tests become whole words, as the coding standards ask. Names that were already on main stay as they are, and so does the reference copy of extractWalls.
…ore door walls (WOR-876) LayoutsHoldWhatTheirNamesSay could pass with a door layout that put no polygon on the door's opening; it now asks for one per door, except on the rejected graph, whose raw bands carry none. Two layouts join the trimmed-band checks: two doors on one room wall, and a door whose jamb lands 3 mm past the corner trim, where the door span takes the sliver. The trimmed-band check now expects that, moving a door span's end to the band's end when the run between is under the 6 mm the offsetter keeps.
…hort names wallSpans returns empty for bands that are not Ok, which is a legitimate input. Bands that are Ok but whose trims do not match the segments can only be a caller passing bands for other segments, so that case now asserts in a debug build; the release guard stays. In extractWalls, prov becomes provenance and ji becomes junctionIndex.
kcjonson
marked this pull request as ready for review
November 16, 2026 03:44
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-876. Two faults in how navigation reads built walls:
nav::extractWallsput every Built wall into oneresolveWallBandscall. If any connected wall graph in the colony was rejected by the offsetter, every wall fell back to a raw band and no corner junction was emitted anywhere: one bad wall stripped every corner in the colony, and every door with them.What changes
In two steps, the first with no behaviour change:
libs/geometry/offset/WallOffset):connectedWallGraphs(segments)groups walls that share an endpoint;wallSpans(segments, gaps, bands)tiles each wall's trimmed band into solid spans and gap spans.wallPiecesAndOutlinetakes its pieces from the same code, and the render cache uses the shared grouping in place of its own union-find.libs/sim/nav/NavInputBuilder): walls are grouped and each graph resolved on its own; a rejected graph keeps the old raw-band path for its own walls only. In an accepted graph a wall with doors takes its rings fromwallSpans(doors only; windows stay solid): solid spans carry no opening, each door span carries its door's opening id. Gaps are whole millimetres from one sharedconstruction::openingGaps(libs/sim/construction/OpeningGeometry), moved out of the render cache, which now calls it.Unchanged: provenance tags, the junction list, portals, when the mesh rebuilds (a construction version change) and what it patches (only rings that changed). Sight's code is untouched; two comments there now say what its door gap matches.
The invariant
For a layout where every wall graph is accepted and no built door sits on a wall with a corner trim, nav's wall input is byte-identical to before. A door on a wall with free ends may move its rings by at most 1 mm (fractions of the wall became whole millimetres).
ExtractWallsReference.test.cppstates it layout by layout against a verbatim copy of the old function:Every layout with a door on an accepted graph must also give nav at least one polygon carrying that door's opening id.
wallPiecesAndOutlineis compared exactly against a copy of the pre-refactor function over 1,000 inputs with random gaps, on top of the existing sweep.How checked
NavWallTest.RejectedGraphElsewhere_LeavesRoomPolygonsUnchanged,NavigationSystemTest.RejectedGraphElsewhereKeepsRoomCornersAndDoor,NavigationSystemTest.DoorBesideCornerRoutesThroughDoorNotFlanks,WallProperties.PiecesFromSpansMatchTheReferenceWithGaps, and theWallGraphstests. The rejected-graph tests fail on the old code. The route test passes on the old code too (the mesh tolerated the overlapping rings, so routes through doors were already right) and is kept as a guard. The door-position check was seen to fire with a door's gap mirrored to the wrong end.Not checked: timing.
Perf: what could move is a construction edit, which rebuilds nav's wall input (twice per construction version: navigation and player visibility) and the render cache. Per graph instead of all at once, the same total resolve work; door walls now go through
wallSpans. Nothing here runs per frame. Nothing was timed: builds were running on the machine throughout.Behaviour to know about
What a player gains is the first fault: one rejected wall no longer breaks corners and doors colony-wide. Door routing itself was already right.
wallSpansgiven bands that did not resolve returns no spans for any segment (it asserted before). Its callers check the status first, so this only guards a release build. The gaps passed for one wall must not overlap; the header says what the spans are if they do.The render cache now groups walls with the shared
connectedWallGraphsin place of its own union-find, so the order graphs are drawn in can differ from before. It could show only where two separate wall graphs overlap each other. Not checked: whether placement lets two graphs overlap without joining.Known, on WOR-877: a door on a wall graph that is itself rejected is still solid to nav (old behaviour, now limited to that graph); a door sitting inside a corner trim has a portal but no walkable span.