acdream/src/AcDream.App/Streaming
Erik 9217fd93cd fix(A.5): strip far-tier entities in worker (Bug A — far tier optimization)
Phase A.5's two-tier streaming spec promised that far-tier landblocks
ship terrain ONLY — no entities, no scenery, no interior cells. T13/T16
wired the controller side (RecenterTo emits ToLoadFar/ToLoadNear/ToPromote;
controller passes JobKind to the worker), but the worker's HandleJob
never branched on Kind: every load called BuildLandblockForStreaming
which runs the full hydration + scenery generation + interior cell path.

Result: at default radii (N₁=4 / N₂=12), 540 far-tier LBs each loaded
their full entity layer (~132 entities/LB → ~71K entities total) into
GpuWorldState. The dispatcher then walked all ~54K entities per frame
(post-frustum-cull), driving the entity dispatcher cpu_us from ~3.6ms
median (T24 baseline) to ~18-21ms (post-T22.5 horizon-test). User-
observed: 40 FPS / 25ms frame time at horizon-safe settings; system
crash at full High preset.

Minimum-diff fix: in LandblockStreamer.HandleJob, after
_loadLandblock returns, strip Entities to empty for LoadFar before
posting Loaded. Worker still does wasted hydration CPU (off the render
thread, harmless). Render-side dispatcher walk drops from ~54K to ~10K
entities/frame.

Math: post-fix entity dispatcher should drop to ~3-4ms median at N₁=4 /
N₂=12 (matches T24's 3.6ms at radius=5 single-tier, since N₁=4 has 33%
fewer near entities than N₁=5).

Future optimization (N.6 / A.6): plumb JobKind through
BuildLandblockForStreaming so the worker also skips the wasted CPU.
Out of A.5 scope.

Bug B (T17 WalkEntities allocation) is a smaller perf hit — defer if
post-Bug-A FPS is acceptable.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 09:10:42 +02:00
..
GpuWorldState.cs feat(A.5 T17): WbDrawDispatcher Change #1 — animated-walk fix + WalkEntities helper 2026-05-10 08:18:02 +02:00
LandblockStreamer.cs fix(A.5): strip far-tier entities in worker (Bug A — far tier optimization) 2026-05-10 09:10:42 +02:00
LandblockStreamJob.cs feat(A.5 T7): LandblockStreamResult.Loaded.Tier+MeshData; Promoted variant 2026-05-09 22:53:07 +02:00
LandblockStreamTier.cs feat(A.5 T1): LandblockStreamTier + LandblockStreamJobKind enums 2026-05-09 22:15:57 +02:00
StreamingController.cs fix(A.5 T13-T16): canonicalize ids; init-only radii; demote/promote tests 2026-05-10 08:08:23 +02:00
StreamingRegion.cs fix(A.5 T4-T6): bootstrap guard + dead enum + test cleanups 2026-05-09 22:49:35 +02:00
TwoTierDiff.cs feat(A.5 T2): TwoTierDiff record + LandblockStreamJob.Load.Kind 2026-05-09 22:20:48 +02:00