refactor(streaming): compose landblock presentation transaction
Own render, physics, DAT-static presentation, and retained static-resource rebinds behind retryable receipts so a failed publication resumes its exact unfinished suffix without replaying retail create-time defaults. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
parent
e1110f7e54
commit
ea0da8c8ae
15 changed files with 1744 additions and 89 deletions
|
|
@ -35,6 +35,7 @@ public sealed class GpuWorldStateActivatorTests
|
|||
GpuWorldState State,
|
||||
PhysicsScriptRunner Runner,
|
||||
ParticleHookSink Sink,
|
||||
EntityEffectPoseRegistry Poses,
|
||||
RecordingSink Recording);
|
||||
|
||||
private static Pipeline BuildPipeline(uint scriptId)
|
||||
|
|
@ -57,7 +58,7 @@ public sealed class GpuWorldStateActivatorTests
|
|||
_ => new ScriptActivationInfo(scriptId, Array.Empty<Matrix4x4>()));
|
||||
|
||||
var state = new GpuWorldState(entityScriptActivator: activator);
|
||||
return new Pipeline(state, runner, sink, recording);
|
||||
return new Pipeline(state, runner, sink, poses, recording);
|
||||
}
|
||||
|
||||
private static LoadedLandblock MakeStubLandblock(uint canonicalId, params WorldEntity[] entities)
|
||||
|
|
@ -135,6 +136,45 @@ public sealed class GpuWorldStateActivatorTests
|
|||
Assert.Equal(0, p.Runner.ActiveScriptCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SameIdLandblockRehydrate_RebindsOwnerWithoutReplayingDefaultScript()
|
||||
{
|
||||
var p = BuildPipeline(scriptId: 0xAAu);
|
||||
WorldEntity first = DatHydrated(
|
||||
id: 0x40A9B401u,
|
||||
pos: new Vector3(1f, 2f, 3f));
|
||||
WorldEntity replacement = DatHydrated(
|
||||
id: first.Id,
|
||||
pos: new Vector3(8f, 9f, 10f));
|
||||
|
||||
p.State.AddLandblock(MakeStubLandblock(0xA9B4FFFFu, first));
|
||||
Assert.Equal(1, p.Runner.ActiveScriptCount);
|
||||
|
||||
p.State.AddLandblock(MakeStubLandblock(0xA9B4FFFFu, replacement));
|
||||
|
||||
Assert.Equal(1, p.Runner.ActiveScriptCount);
|
||||
Assert.True(p.Poses.TryGetRootPose(first.Id, out Matrix4x4 root));
|
||||
Assert.Equal(replacement.Position, root.Translation);
|
||||
p.Runner.Tick(0.001f);
|
||||
Assert.Single(p.Recording.Calls);
|
||||
Assert.Equal(replacement.Position, p.Recording.Calls[0].Pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SameLandblockRehydrate_OmittedStaticRetiresScriptAndPose()
|
||||
{
|
||||
var p = BuildPipeline(scriptId: 0xAAu);
|
||||
WorldEntity entity = DatHydrated(0x40A9B401u, Vector3.Zero);
|
||||
p.State.AddLandblock(MakeStubLandblock(0xA9B4FFFFu, entity));
|
||||
Assert.Equal(1, p.Runner.ActiveScriptCount);
|
||||
Assert.True(p.Poses.TryGetRootPose(entity.Id, out _));
|
||||
|
||||
p.State.AddLandblock(MakeStubLandblock(0xA9B4FFFFu));
|
||||
|
||||
Assert.Equal(0, p.Runner.ActiveScriptCount);
|
||||
Assert.False(p.Poses.TryGetRootPose(entity.Id, out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddEntitiesToExistingLandblock_FiresActivatorForEachPromoted()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue