acdream/tests/AcDream.Core.Tests/World
Erik 71d0edc3d7 fix(world #53): namespace stab Ids globally for Tier 1 cache safety
LandblockLoader.BuildEntitiesFromInfo restarted nextId at 1 per landblock,
producing colliding entity.Id values across landblocks. EntityClassificationCache
keys by entity.Id alone, so cross-LB collisions caused cache pollution:
multiple stabs sharing id=1 -> cache entry for id=1 ended up with the
CONCATENATION of multiple entities' batches -> buildings rendered up in the
air with wrong textures (visual gate observation 2026-05-10).

Audit at docs/research/2026-05-10-tier1-mutation-audit.md did not verify
entity.Id uniqueness - that was an unchecked assumption. Cache design
trusted entity.Id was globally unique; for stabs it wasn't.

Fix: optional landblockId parameter on BuildEntitiesFromInfo. When non-zero,
stab Ids are namespaced as 0xC0XXYY00 + nextId, matching the scenery
(0x80XXYY00) and interior (0x40XXYY00) namespacing already in GameWindow.cs.
The 0xC0 top byte distinguishes stabs from those. Existing tests pass
landblockId=0 and keep their legacy starting-from-1 behavior.

Known latent: if any one landblock has >256 stabs, nextId overflows the
low byte. Same pattern + same limitation as scenery/interior. Out of scope
for the immediate Tier 1 cache bug; not affecting current Holtburg play.

Adds 2 regression tests pinning the namespacing + the legacy fallback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 20:07:19 +02:00
..
DerethDateTimeCollection.cs test(world): serialize DerethDateTime offset tests 2026-04-28 11:58:50 +02:00
DerethDateTimeTests.cs test(world): serialize DerethDateTime offset tests 2026-04-28 11:58:50 +02:00
LandblockLoaderTests.cs fix(world #53): namespace stab Ids globally for Tier 1 cache safety 2026-05-10 20:07:19 +02:00
SceneryGeneratorTests.cs phase(N.1): delete legacy scenery code path; WB is the only path 2026-05-08 10:37:55 +02:00
SkyDescLoaderTests.cs feat(vfx): Phase C.1 — PES particle renderer + post-review fixes 2026-04-28 22:47:11 +02:00
SkyStateTests.cs test(world): serialize DerethDateTime offset tests 2026-04-28 11:58:50 +02:00
WbSceneryAdapterTests.cs phase(N.1): add LandBlock → TerrainEntry[] adapter 2026-05-08 09:11:59 +02:00
WeatherSystemTests.cs weather(phase-7): gut WeatherSystem.Snapshot — passthrough keyframe fog 2026-04-24 12:55:19 +02:00
WorldEntityAabbTests.cs feat(A.5 T8): WorldEntity AABB cache + dirty flag 2026-05-09 22:54:25 +02:00
WorldTimeDebugTests.cs Merge feature/animation-system-complete — Phase L.1c animation MVP 2026-04-29 10:50:59 +02:00
WorldViewTests.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00