acdream/src/AcDream.Core/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
..
DerethDateTime.cs fix(time): retail-canonical month enum + absolute Portal Year + title-bar calendar 2026-04-27 14:43:49 +02:00
LandblockLoader.cs fix(world #53): namespace stab Ids globally for Tier 1 cache safety 2026-05-10 20:07:19 +02:00
LoadedLandblock.cs feat(core): add LandblockLoader with Stab+Building → WorldEntity mapping 2026-04-10 17:58:30 +02:00
MeshRef.cs feat(net+app): TextureChanges applied via Surface→OrigTex resolution (Phase 5a) 2026-04-11 16:22:23 +02:00
PaletteOverride.cs feat(net+app): SubPalette overlays applied to palette-indexed textures (Phase 5b) 2026-04-11 16:30:08 +02:00
SceneryGenerator.cs phase(N.1): delete legacy scenery code path; WB is the only path 2026-05-08 10:37:55 +02:00
SkyDescLoader.cs feat(vfx): Phase C.1 — PES particle renderer + post-review fixes 2026-04-28 22:47:11 +02:00
SkyState.cs fix(sky): retail-faithful sun-vector magnitude for SunColor / AmbientColor 2026-04-27 22:42:53 +02:00
WbSceneryAdapter.cs phase(N.1): document LandBlock length-81 invariant on adapter 2026-05-08 09:20:53 +02:00
WeatherState.cs weather(phase-7): gut WeatherSystem.Snapshot — passthrough keyframe fog 2026-04-24 12:55:19 +02:00
WorldEntity.cs feat(A.5 T8): WorldEntity AABB cache + dirty flag 2026-05-09 22:54:25 +02:00
WorldView.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00