chore(diag): [FRAME-DIAG] StreamingController counters (apparatus)

DeferredApplyBacklog / ForceReloadCount / LastForceReloadDropCount, read by
GameWindow's [FRAME-DIAG] rollup. Diagnostic scaffolding (ACDREAM_WB_DIAG=1);
strip with the rest of [FRAME-DIAG] when the FPS work fully lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-23 10:03:18 +02:00
parent 536f1c04cd
commit b3925f46e7

View file

@ -122,6 +122,16 @@ public sealed class StreamingController
/// </summary> /// </summary>
public int PriorityRadius { get; set; } public int PriorityRadius { get; set; }
// [FRAME-DIAG] (read by GameWindow's ACDREAM_WB_DIAG rollup): the standing
// deferred-LOAD backlog. A non-zero value during/after a teleport is the
// GPU-upload tail draining at MaxCompletionsPerFrame. Removable probe surface.
public int DeferredApplyBacklog => _deferredApply.Count;
// [FRAME-DIAG]: how many times ForceReloadWindow has fired (each one drops +
// re-uploads the WHOLE window) and the landblock count it dropped last time.
public int ForceReloadCount { get; private set; }
public int LastForceReloadDropCount { get; private set; }
// Completions that were drained past a priority item get buffered here // Completions that were drained past a priority item get buffered here
// so they still apply over subsequent frames without loss. // so they still apply over subsequent frames without loss.
private readonly List<LandblockStreamResult> _deferredApply = new(); private readonly List<LandblockStreamResult> _deferredApply = new();
@ -361,6 +371,8 @@ public sealed class StreamingController
_collapsed = false; _collapsed = false;
// Snapshot — RemoveLandblock mutates the loaded set we're iterating. // Snapshot — RemoveLandblock mutates the loaded set we're iterating.
var ids = new List<uint>(_state.LoadedLandblockIds); var ids = new List<uint>(_state.LoadedLandblockIds);
ForceReloadCount++; // [FRAME-DIAG] churn counter
LastForceReloadDropCount = ids.Count; // = upcoming re-upload volume
foreach (var id in ids) foreach (var id in ids)
{ {
_state.RemoveLandblock(id); _state.RemoveLandblock(id);