perf(streaming): quiesce retired generations and budget teardown

Publish the retail blocking-for-cells edge before deferred recenter work, freeze old-world presentation/simulation/audio, and advance full-window retirement from exact metered entity and owner cursors. This removes synchronous portal teardown without allowing retained owners to remain observable.
This commit is contained in:
Erik 2026-07-24 18:29:52 +02:00
parent b8f6317fe1
commit bb16f74fd4
38 changed files with 1691 additions and 170 deletions

View file

@ -141,8 +141,9 @@ public sealed class LandblockPresentationPipeline
}
_onLandblockLoaded = onLandblockLoaded;
_ensureEnvCellMeshes = ensureEnvCellMeshes;
_retirements = new LandblockRetirementCoordinator(
_retirements = LandblockRetirementCoordinator.CreateBudgeted(
state,
retirementOwner.AdvanceOne,
retirementOwner.Advance);
}
@ -162,6 +163,7 @@ public sealed class LandblockPresentationPipeline
_staticPublisher?.Diagnostics ?? default);
public int PendingRetirementCount => _retirements.PendingCount;
internal bool UsesBudgetedRetirementSteps => _retirements.UsesBudgetedSteps;
public int PendingPublicationCount => _publications.Count;
internal bool MatchesState(GpuWorldState state) =>
@ -189,10 +191,27 @@ public sealed class LandblockPresentationPipeline
public void AdvanceRetirements() => _retirements.Advance();
public void BeginFullRetirement(uint landblockId) =>
public void AdvanceRetirements(StreamingWorkMeter meter) =>
_retirements.Advance(meter);
public void BeginFullRetirement(uint landblockId)
{
_retirements.BeginFull(landblockId);
if (_retirements.UsesBudgetedSteps)
_retirements.Advance();
}
public void BeginNearLayerRetirement(uint landblockId)
{
_retirements.BeginNearLayer(landblockId);
if (_retirements.UsesBudgetedSteps)
_retirements.Advance();
}
internal void EnqueueFullRetirement(uint landblockId) =>
_retirements.BeginFull(landblockId);
public void BeginNearLayerRetirement(uint landblockId) =>
internal void EnqueueNearLayerRetirement(uint landblockId) =>
_retirements.BeginNearLayer(landblockId);
public void PublishLoaded(LandblockStreamResult.Loaded loaded)