test(streaming): expose world reveal lifecycle

This commit is contained in:
Erik 2026-07-20 22:32:23 +02:00
parent b60cb67009
commit db45b81f75
6 changed files with 532 additions and 11 deletions

View file

@ -148,6 +148,8 @@ public sealed class GameWindow : IDisposable
private AcDream.App.Rendering.EquippedChildRenderController? _equippedChildRenderer;
private AcDream.App.Streaming.StreamingController? _streamingController;
private AcDream.App.Streaming.WorldRevealReadinessBarrier? _worldRevealReadiness;
private readonly AcDream.App.Streaming.WorldRevealLifecycleTelemetry _worldRevealTelemetry =
new(message => Console.WriteLine(message));
private int _streamingRadius = 2; // default 5×5 (kept for debug overlay getStreamingRadius callback)
private int _nearRadius = 4; // Phase A.5 T16: two-tier near ring (default 4 → 9×9)
private int _farRadius = 12; // Phase A.5 T16: two-tier far ring (default 12 → 25×25)
@ -3615,6 +3617,7 @@ public sealed class GameWindow : IDisposable
// login must not inherit the dispatcher's default/previous composite
// readiness and expose a terrain-only or partially uploaded world.
_worldRevealReadiness?.Begin();
_worldRevealTelemetry.Begin(AcDream.App.Streaming.WorldRevealKind.Login);
// Streaming is normally gated until this point, so the next loaded-
// landblock callback will materialize deferred records. Also cover an
@ -7538,6 +7541,7 @@ public sealed class GameWindow : IDisposable
_teleportHoldSeconds = 0f;
_teleportForced = false;
_worldRevealReadiness?.Begin();
_worldRevealTelemetry.Begin(AcDream.App.Streaming.WorldRevealKind.Portal);
if (_streamingController is not null)
{
_streamingController.PriorityLandblockId =
@ -7561,7 +7565,10 @@ public sealed class GameWindow : IDisposable
private void ResetTeleportTransitState(bool clearSession = false)
{
if (clearSession)
{
_teleportTransit.ClearSession();
_worldRevealTelemetry.Cancel();
}
else
_teleportTransit.EndActive();
_pendingTeleportPos = default;
@ -7608,12 +7615,20 @@ public sealed class GameWindow : IDisposable
/// loudly rather than holding forever.
/// </summary>
private bool TeleportWorldReady(uint destCell)
=> _worldRevealReadiness?.IsReady(destCell) == true;
=> EvaluateWorldRevealReadiness(destCell).IsReady;
private bool LoginWorldReady()
{
return TryGetLoginWorldCell(out uint cell)
&& _worldRevealReadiness?.IsReady(cell) == true;
&& EvaluateWorldRevealReadiness(cell).IsReady;
}
private AcDream.App.Streaming.WorldRevealReadinessSnapshot EvaluateWorldRevealReadiness(
uint destinationCell)
{
var snapshot = _worldRevealReadiness?.Evaluate(destinationCell) ?? default;
_worldRevealTelemetry.ObserveReadiness(snapshot);
return snapshot;
}
private bool TryGetLoginWorldCell(out uint cell)
@ -9742,6 +9757,7 @@ public sealed class GameWindow : IDisposable
{
case AcDream.Core.World.TeleportAnimEvent.Place:
PlaceTeleportArrival(_pendingTeleportPos, _pendingTeleportCell, _teleportForced);
_worldRevealTelemetry.ObserveMaterialized();
if (_streamingController is not null)
{
_streamingController.PriorityLandblockId = 0u;
@ -9761,6 +9777,7 @@ public sealed class GameWindow : IDisposable
// each portal transition.
_liveSession?.SendGameAction(
AcDream.Core.Net.Messages.GameActionLoginComplete.Build());
_worldRevealTelemetry.Complete();
ResetTeleportTransitState();
break;
default:
@ -10118,7 +10135,10 @@ public sealed class GameWindow : IDisposable
? loginCell
: 0u;
if (revealCell != 0)
{
_worldRevealReadiness?.Prepare(revealCell);
EvaluateWorldRevealReadiness(revealCell);
}
_particleRenderer?.BeginFrame(_gpuFrameFlights.CurrentSlot);
}
if (_frameDiag)
@ -10176,7 +10196,11 @@ public sealed class GameWindow : IDisposable
_particleVisibility.BeginFrame(camPos);
_terrain?.BeginVisibilityFrame();
if (!IsLiveModeWaitingForLogin)
{
_particleVisibility.UseWorldView();
_worldRevealTelemetry.ObserveWorldViewportVisible();
_worldRevealTelemetry.Complete();
}
// L.0 Audio tab: push the SettingsVM's live AudioDraft into the
// engine each frame, so volume sliders preview audibly while