acdream/tests/AcDream.Core.Tests/Rendering/Wb
Erik f7e38c214d fix(render #53): cache-hit fast path must fire per-entity, not per-tuple
Task 10 (commit 0cbef3c) called ApplyCacheHit inside the per-(entity, partIdx)
foreach loop, but cachedEntry.Batches is flat across all MeshRefs of the
entity. For a 3-MeshRef static building on frame 2: 3 tuples times 6 cached
batches per call = 18 instances drawn instead of 6. Severe Z-fighting and
3x perf hit on every multi-part static entity (buildings, statues, multi-
MeshRef NPCs).

This is the symmetric mirror of the Task 9 bug fixed at 00fa8ae. Both
spec section 5.2 and the plan describe the foreach as per-entity, but
_walkScratch has been per-tuple since Task 6. The implementation
faithfully ported the buggy spec.

Fix: track lastHitEntityId; the cache-hit fast path fires only on the
first tuple of each entity, and subsequent tuples skip the iteration
body via continue. Adds a regression test pinning the per-entity
amplification invariant.

Caught by code review (subagent-driven-development) before Phase 3
dispatched. The bug was invisible in the no-multi-frame-test 1702/8
baseline; would have manifested as visible Z-fighting on every multi-
part building on second-and-subsequent frames once Task 13 perf gate
captured live runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 19:15:20 +02:00
..
AcSurfaceMetadataTableTests.cs phase(N.4): AcSurfaceMetadata side-table for WB-pristine surface props 2026-05-08 13:08:56 +02:00
AnimatedEntityStateTests.cs phase(N.4) Tasks 16+18+19: AnimatedEntityState + AnimPartChange + HiddenParts 2026-05-08 14:37:09 +02:00
AnimPartChangeTests.cs phase(N.4) Tasks 16+18+19: AnimatedEntityState + AnimPartChange + HiddenParts 2026-05-08 14:37:09 +02:00
EntityClassificationCacheTests.cs feat(render #53): EntityClassificationCache.InvalidateLandblock + tests 2026-05-10 17:47:57 +02:00
EntitySpawnAdapterTests.cs phase(N.4) Task 17: EntitySpawnAdapter for server-spawned per-instance content 2026-05-08 14:46:34 +02:00
HiddenPartsTests.cs phase(N.4) Tasks 16+18+19: AnimatedEntityState + AnimPartChange + HiddenParts 2026-05-08 14:37:09 +02:00
LandblockSpawnAdapterTests.cs phase(N.4) Task 11: LandblockSpawnAdapter (atlas-tier ref-count bridge) 2026-05-08 13:53:38 +02:00
MatrixCompositionTests.cs phase(N.4) Tasks 22+23: WbDrawDispatcher + surface metadata side-table 2026-05-08 15:30:33 +02:00
MeshExtractionConformanceTests.cs test(N.4): conformance tests for mesh extraction + setup flatten 2026-05-08 13:14:36 +02:00
PendingSpawnIntegrationTests.cs phase(N.5): retirement amendment — InstancedMeshRenderer + StaticMeshRenderer + WbFoundationFlag deleted 2026-05-08 22:01:36 +02:00
SetupFlattenConformanceTests.cs test(N.4): conformance tests for mesh extraction + setup flatten 2026-05-08 13:14:36 +02:00
WbDispatcherDepthMaskTests.cs test(A.5 T21): lock in depth-write attribution per translucency kind 2026-05-10 08:27:03 +02:00
WbDrawDispatcherBucketingTests.cs fix(render #53): cache-hit fast path must fire per-entity, not per-tuple 2026-05-10 19:15:20 +02:00
WbDrawDispatcherIndirectBuilderTests.cs phase(N.5) Task 9 fixup: layout assertion + DrawCommandStride const 2026-05-08 20:42:49 +02:00
WbDrawDispatcherTranslucencyTests.cs phase(N.5) Task 11: translucency partition contract test 2026-05-08 20:53:36 +02:00
WbMeshAdapterTests.cs phase(N.4) Tasks 22+23: WbDrawDispatcher + surface metadata side-table 2026-05-08 15:30:33 +02:00