fix(portal): synchronize destination presentation state

This commit is contained in:
Erik 2026-07-16 21:17:13 +02:00
parent 4b1bceefbb
commit e95f55f25b
42 changed files with 2815 additions and 288 deletions

View file

@ -11,12 +11,11 @@ namespace AcDream.App.Rendering.Wb;
/// <para>
/// <b>Key composition:</b> entries are keyed by the tuple
/// <c>(EntityId, LandblockHint)</c>, NOT by <c>EntityId</c> alone. Issue #53
/// uncovered that <c>entity.Id</c> is NOT globally unique across all
/// static-entity hydration paths: scenery (<c>0x80XXYY00 + localIndex</c>)
/// and interior cells (<c>0x40XXYY00 + localCounter</c>, X-byte fixed
/// 2026-06-11 — it used to be discarded entirely, #119) overflow at >256
/// items per landblock, wrapping into the <c>lbY</c> byte and producing
/// cross-LB collisions in dense forest/urban LBs outside Holtburg. Keying
/// uncovered that older hydration IDs were not globally unique across all
/// static-entity paths: their former byte-aligned counters overflowed at
/// more than 256 items per landblock and wrapped into the <c>lbY</c> byte.
/// The current <c>0x8XXYYIII</c> scenery and <c>0x4XXYYIII</c> interior
/// allocators reserve 12-bit counters and fail before aliasing. Keying
/// by the tuple is correct-by-construction ONLY when the hint identifies the
/// entity's OWNING landblock — callers must derive it via
/// <c>WbDrawDispatcher.ResolveCacheLandblockHint</c> (the entity's
@ -64,8 +63,8 @@ internal sealed class EntityClassificationCache
/// <summary>
/// Look up an entity's cached classification. Keyed by both
/// <paramref name="entityId"/> AND <paramref name="landblockHint"/> to
/// disambiguate entities whose Ids collide across landblocks (e.g.,
/// scenery's <c>0x80LLBB00 + localIndex</c> overflow at >256 items/LB).
/// preserve defensive isolation if a future hydration path introduces an
/// entity-id collision across landblocks.
/// Returns <c>true</c> with the entry on hit; <c>false</c> with
/// <paramref name="entry"/> set to <c>null</c> on miss.
/// </summary>