acdream/tests/AcDream.App.Tests/Rendering/Walk
Erik 4ee2866a7b feat(render): S3 chunk 3 — draw terrain per land cell in retail's interleave
Ports RenderDeviceD3D::DrawBlock @0x005a17c0's real per-cell order:
loop 1 (@0x005a1876) prepares shadow lists; loop 2 (@0x005a197d)
DrawLandCell(cell) @0x005a19c0 fires ONLY when the cell is in view,
STRICTLY BEFORE DrawSortCell(cell) @0x005a19e6, which fires whenever
alwaysDrawObjects (retail default 1 @0x00820ed4) or the cell is in
view. RetailFrameWalk.DrawLandscape now emits sink.OnLandCellTurn(
landblockId, side, cellIndex) at that exact point, per admitted cell,
before the existing DrawBuilding + OnLandscapeCellTurn (the
DrawSortCell half). WalkFrameDriver records one LandCell frame event
per turn and deletes the whole-stage TerrainSlice(0) emission and the
DrawTerrainSlice leaf outright — drawing all terrain before every
building let a nearer building's far-Z punch survive under farther
terrain drawn afterward, the doorway-behind-a-hill fragment bug from
the owner's G2 Holtburg screenshot; this chunk removes it by ORDER
alone, with no depth-compare change (S4's punch z-func question is
untouched, per the contract).

Index-run arithmetic (S3 §9.1 R3): the terrain mesh is cell-major
(LandblockMesh.Build: cy outer, cx inner, 6 indices/cell, 384/land-
block). A retail LOD cell (side n, LOD coords X,Y) covers cx in
[X*8/n,(X+1)*8/n), cy in [Y*8/n,(Y+1)*8/n) — one contiguous run per
covered cy row: side 8 -> one run of 6, side 4 -> two runs of 12,
side 2 -> four runs of 24; side 1's single coarse cell covers every
row contiguously so its 8 per-row runs collapse into ONE run of all
384 indices. TerrainModernRenderer.AppendCellIndexRuns (pure, no GPU,
no baked table) and DrawLandCellRuns (resolves the landblock's slot,
builds one DrawElementsIndirectCommand per run, reuses the existing
DrawRhi bind-and-submit path) implement this; TerrainModernRenderer
.Draw(...) is untouched and keeps serving non-walk callers (directional-
shadow receivers, the flat terrain path).

Order-preserving batching (S3 §9.2 B2): WalkFrameDriver.Replay merges
consecutive same-landblock LandCell events with no intervening event
into ONE DrawLandCellBatch leaf call; any other event splits the
batch. In production this rarely fires because retail's own
DrawSortCell (AlwaysDrawObjects=true) always interposes an object-
list turn between one cell's LandCell event and the next's — see
perfNote in the task report for the resulting command-count increase.

Deleted as dead: the _walkTerrainInViewLandcells field and
SetWalkTerrainInViewLandcells setter on RetailPViewPassExecutor (fed
only DrawWalkTerrainSlice's inViewLandcells filter, which no longer
exists — the walk's own per-cell CellInView admission is now the
sole terrain-visibility authority) and its two call sites in
RetailPViewRenderer.DrawWalkDrivenStatics.

Weather placement (S3 §9.1 R5): confirmed unchanged. GameSky's
weather pass (RenderWeather, gated on is_player_outside) already
runs after every LandCell event for both root kinds — for an
outdoor root, DrawLandscapeDynamicsPhase is called directly after
driver.Replay() completes (which processes the whole per-cell
_events list first); for an interior root with ov>0, it fires via
the LandscapeFlush leaf (RetailPViewRenderer.FlushWalkLandscape ->
_walkPreClearDynamics), and OnInteriorFloodDrawTurn only emits
LandscapeFlush AFTER DrawLandscape's per-cell loop has fully run
and recorded every LandCell event ahead of it in the same _events
list Replay walks in order. No code change needed; verified by
reading the call sites.

Tests: WalkEvents/RetailFrameWalk/WalkFrameDriver's existing pins
updated (every "TERRAIN:0" expectation deleted, matching the deleted
event); new coverage for T1 (WalkLandCellOrderTests — LandWalkOrder +
WalkLandscape.CalcDrawOrder + WalkLandscapeAssembler
.SideCellCountForRing reproduce both cathedral captures' frame-2
LC/SC sequences byte-for-byte, 533/698 arrival and 531/757 leak, cross-
verified against the retail ring-to-LOD table), T2 (a synthetic two-
block landscape with a real WalkVisibilityMath-driven out-of-view
column, proving LC-before-building/statics, far-to-near, no-LC-but-
keeps-SC for the excluded cells, and no TerrainSlice event of any
kind), T3 (TerrainLandCellIndexRunsTests — the index-run arithmetic
for every side/cell, disjoint and exhaustive over the 384-index
landblock), T4 (batching merge/split), and the RetailPViewPassExecutor
CompiledCallGraph pin retargeted at DrawWalkLandCellBatch /
DrawLandCellRuns. WalkOracleTrace gains LC/SC event kinds and a
Load(root, name) overload for the OH capture directory — the one
parser change this chunk needs, no validator, no other infrastructure.

App hermetic lane: 6,786/6,786 (6,765 baseline + 21 new). InstalledDat
lane: 241 passed, 3 accepted failures (2 pre-existing #383 layout
fixture-drift tests, 1 TowerAscent Status=KnownFailure) — unchanged
from baseline. Core terrain tests: 116/116 (Core untouched by this
chunk).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 09:57:34 +02:00
..
LandWalkOrderTests.cs feat(render) Campaign FW1: port the retail landscape draw-order machinery 2026-08-30 09:35:26 +02:00
OrderedDrawStreamTests.cs feat(render) Campaign FW2: OrderedDrawStream + walk-order submitter 2026-08-30 12:31:31 +02:00
OrderPreservingSubmitterTests.cs fix(render) Campaign FW3.4a: rebind sections per DrawOrderedRange - the device-lost fix 2026-08-30 17:07:29 +02:00
RetailFrameWalkTests.cs feat(render): S3 chunk 3 — draw terrain per land cell in retail's interleave 2026-09-03 09:57:34 +02:00
WalkBuildingJoinDiagnosticTests.cs feat(render) Campaign FW1: look-in adjudication - the GetVisible load gate 2026-08-30 10:43:27 +02:00
WalkBuildingPortalTests.cs feat(render) Campaign FW1: NINE of ten fixtures conformant - the degrade arm 2026-08-30 11:34:45 +02:00
WalkBuildingRegistryTests.cs feat(render) Campaign FW3.1: production walk world data behind the seam 2026-08-30 13:19:22 +02:00
WalkCopyViewTests.cs feat(render) Campaign FW1: port the view machinery (xformStart, polyClipFinish, copy_view) 2026-08-30 09:50:03 +02:00
WalkFrameDriverTests.cs feat(render): S3 chunk 3 — draw terrain per land cell in retail's interleave 2026-09-03 09:57:34 +02:00
WalkLandCellOrderTests.cs feat(render): S3 chunk 3 — draw terrain per land cell in retail's interleave 2026-09-03 09:57:34 +02:00
WalkLandscapeAssemblerTests.cs checkpoint: preserve user-gated FW closeout fixes 2026-08-31 08:27:37 +02:00
WalkLandscapeDatBuilder.cs feat(render) Campaign FW1: SIX OF TEN FIXTURES FULLY CONFORMANT 2026-08-30 11:07:29 +02:00
WalkLookInGateSweepTests.cs feat(render) Campaign FW1: SIX OF TEN FIXTURES FULLY CONFORMANT 2026-08-30 11:07:29 +02:00
WalkOracleTrace.cs feat(render): S3 chunk 3 — draw terrain per land cell in retail's interleave 2026-09-03 09:57:34 +02:00
WalkOracleTraceTests.cs test(render) Campaign FW0: walk-oracle replay helper + fixture goldens 2026-08-30 09:14:55 +02:00
WalkPortalGateDumpTests.cs feat(render) Campaign FW1: doorway-still conformant - deg_mul is dynamic 2026-08-30 11:49:27 +02:00
WalkProductionFrameContextTests.cs checkpoint: preserve user-gated FW closeout fixes 2026-08-31 08:27:37 +02:00
WalkProductionWorldConformanceTests.cs checkpoint(render): preserve pre-overhaul investigation state 2026-09-01 18:04:24 +02:00
WalkProductionWorldDataTests.cs feat(render): Campaign OVERHAUL S2 chunk 5 + closeout — registry is the only render membership owner 2026-09-03 01:01:47 +02:00
WalkPViewFloodTests.cs feat(render): S3 chunk 2 — gate the interior turn on the real outside-view count 2026-09-03 07:46:11 +02:00
WalkScreenClipTests.cs feat(render) Campaign FW1: port the view machinery (xformStart, polyClipFinish, copy_view) 2026-08-30 09:50:03 +02:00
WalkStaticStreamPopulatorTests.cs checkpoint(render): preserve pre-overhaul investigation state 2026-09-01 18:04:24 +02:00
WalkTraceConformanceTests.cs feat(render) Campaign FW1: doorway-still conformant - deg_mul is dynamic 2026-08-30 11:49:27 +02:00
WalkTraceReplay.cs feat(render) Campaign FW1: street fixture retail-exact except flood depth 2026-08-30 11:02:16 +02:00
WalkVisibilityMathTests.cs feat(render) Campaign FW1: flood decomp appendix + the visibility math port 2026-08-30 09:44:49 +02:00
WalkWorldDatAdapter.cs feat(render) Campaign FW1: SIX OF TEN FIXTURES FULLY CONFORMANT 2026-08-30 11:07:29 +02:00
WalkWorldDatAdapterTests.cs feat(render) Campaign FW1: the landscape replay world + first outdoor diff 2026-08-30 10:36:09 +02:00