acdream/tests/AcDream.Core.Tests/Streaming
Erik 315af02f8a fix(streaming): recover the player from the pending bucket — invisible-player / world-not-loading bug
Root cause (confirmed live via ACDREAM_PROBE_ENT): a persistent server-spawned
entity that spawns into a not-yet-loaded landblock is parked in
GpuWorldState._pendingByLandblock. RelocateEntity — called every frame to keep
the player homed to its current landblock so it draws — scanned ONLY _loaded, so
it silently no-op'd on a pending entity. The player then fell through ALL of the
recovery paths: the AddLandblock pending-drain had already run (empty) before the
cold-spawn churn re-parked the player; the server-object re-hydrate excludes the
player by design ("persistent-rescue owns it"); and RelocateEntity couldn't reach
a pending entity. Net: the player stayed stranded in pending, hidden forever.

Probe evidence (cold-spawn at 0xADAF): `[ent] APPEND guid=0x5000000A
lb=0xADAFFFFF -> PENDING(hidden)`, no later `DRAWSET PRESENT` — while the sibling
NPCs `re-hydrated 3 server object(s) into landblock 0xADAFFFFF` and drew fine.

This is the mechanism behind BOTH reported symptoms: cold-spawn "everything gone
/ invisible" AND "character disappears running out of Holtburg far enough" — both
are "player parked in pending, never recovered" (run-out crosses into a
still-streaming landblock; cold-spawn spawns into one).

Fix: RelocateEntity now removes the entity from whichever bucket it occupies
(_loaded OR _pendingByLandblock) via RemoveEntityFromAllBuckets, then re-appends
to its current landblock — promoting a stranded pending entity to drawn as soon
as its landblock is loaded. Keeps the fast-path early-return for a settled
entity (no per-frame churn).

NOT R5-V2: verified line-by-line that the voyeur/target wiring is read-only w.r.t.
position/cell/landblock/streaming — this is a pre-existing streaming bug. The
separate cold-spawn `cells=0` (outdoor spawn placed before Near-tier cells load,
no re-snap) is benign for outdoor placement (terrain-Z is used) and filed
separately; it does not block visibility, which this fix restores.

Test: GpuWorldStateTests.RelocateEntity_StrandedInPending_MovesToLoadedTarget
(red before, green after). Full suite 4007 green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 22:03:44 +02:00
..
DungeonStreamingGateTests.cs fix(streaming): #145 — teleport re-use via server-authoritative placement 2026-06-20 21:38:00 +02:00
GpuWorldStateActivatorTests.cs refactor(physics #145): Slice 1 — rename Frame->CellFrame to avoid DatReaderWriter.Types.Frame collision 2026-06-21 10:34:36 +02:00
GpuWorldStateTests.cs fix(streaming): recover the player from the pending bucket — invisible-player / world-not-loading bug 2026-07-03 22:03:44 +02:00
GpuWorldStateTwoTierTests.cs feat(render): Phase A8 — indoor visibility + streaming fixes batch 2026-05-29 10:14:50 +02:00
LandblockEntityRehydratorTests.cs fix(streaming): #138 — re-hydrate server objects from the retained spawn table on reload 2026-06-21 08:06:41 +02:00
LandblockStreamerTests.cs feat(render): Phase A8 — indoor visibility + streaming fixes batch 2026-05-29 10:14:50 +02:00
StreamingControllerDungeonGateTests.cs fix(G.3): pre-collapse dungeon streaming at login/teleport — kill the login FPS ramp (#135) 2026-06-14 16:46:56 +02:00
StreamingControllerPriorityApplyTests.cs refactor(teleport A): O(N) deferred drain + never-arrives test (review fixes) 2026-06-22 13:03:20 +02:00
StreamingControllerTests.cs feat(A.5 T13): StreamingController two-tier Tick 2026-05-10 07:56:57 +02:00
StreamingControllerTwoTierTests.cs feat(render): Phase A8 — indoor visibility + streaming fixes batch 2026-05-29 10:14:50 +02:00
StreamingRegionTests.cs feat(A.5 T4): StreamingRegion ComputeFirstTickDiff 2026-05-09 22:34:55 +02:00
StreamingRegionTwoTierTests.cs fix(A.5 T4-T6): bootstrap guard + dead enum + test cleanups 2026-05-09 22:49:35 +02:00