refactor(streaming): complete landblock presentation cutover

Remove the legacy GameWindow apply path and make the concrete render, physics, and static publishers the only production owner graph. Serialize full-window retirement with shared-origin teleport and session boundaries so old coordinate-frame resources cannot survive into a new world or login.
This commit is contained in:
Erik 2026-07-21 22:47:30 +02:00
parent 801d8a189c
commit c79d0a49da
12 changed files with 1373 additions and 402 deletions

View file

@ -101,6 +101,66 @@ public sealed class LiveSessionResetPlanTests
Assert.Equal(2, secondCalls);
}
[Fact]
public void Execute_BlocksNextSessionUntilOriginRetirementConverges()
{
const uint sourceId = 0x5353FFFFu;
var state = new GpuWorldState();
state.AddLandblock(new LoadedLandblock(
sourceId,
new LandBlock(),
Array.Empty<WorldEntity>()));
var origin = new LiveWorldOriginState();
Assert.True(origin.TryInitialize(0x53, 0x53));
bool failRetirement = true;
var controller = new StreamingController(
enqueueLoad: static (_, _) => { },
enqueueUnload: static _ => { },
drainCompletions: static _ => Array.Empty<LandblockStreamResult>(),
applyTerrain: static (_, _) => { },
state,
nearRadius: 0,
farRadius: 0,
removeTerrain: _ =>
{
if (failRetirement)
throw new InvalidOperationException("injected ending-session failure");
});
var recenter = new StreamingOriginRecenterCoordinator(controller, origin);
int identityResets = 0;
var plan = new LiveSessionResetPlan(
[
new("teleport transit", () =>
{
if (!recenter.Reset(sessionEnding: true))
{
throw new InvalidOperationException(
"streaming-origin retirement remains pending");
}
}),
new("session identity", () =>
{
identityResets++;
origin.Reset();
}),
]);
AggregateException blocked = Assert.Throws<AggregateException>(plan.Execute);
LiveSessionResetStageException failure = Assert.IsType<LiveSessionResetStageException>(
Assert.Single(blocked.InnerExceptions));
Assert.Equal("teleport transit", failure.StageName);
Assert.Equal(1, identityResets);
failRetirement = false;
plan.Execute();
Assert.Equal(2, identityResets);
Assert.False(recenter.IsPending);
Assert.False(origin.IsKnown);
Assert.True(origin.TryInitialize(0x61, 0x62));
Assert.Equal((0x61, 0x62), (origin.CenterX, origin.CenterY));
}
[Fact]
public void Execute_ReentrantAttemptIsReportedButLaterStagesStillRun()
{