refactor(runtime): own canonical entity and object lifetime

Introduce one presentation-free RuntimeEntityObjectLifetime for the exact entity directory and ClientObjectTable. Make GameWindow, graphical projections, retained UI, interaction, session routing, create/delete integration, and reset borrow that owner while preserving synchronous retail ordering, dormant retention, and retry semantics.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-26 05:54:46 +02:00
parent d9bf4c4960
commit 5ef8b5371d
40 changed files with 712 additions and 170 deletions

View file

@ -315,7 +315,7 @@ public sealed class LiveEntityInboundAuthorityGateTests
accepted.VelocityAuthorityVersion));
}
private static LiveEntityRuntime Runtime() => new(
private static LiveEntityRuntime Runtime() => LiveEntityRuntimeFixture.Create(
new GpuWorldState(),
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));

View file

@ -23,7 +23,7 @@ public sealed class LiveEntityOrdinaryPhysicsUpdaterTests
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
spatial.AddLandblock(EmptyLandblock(0xAAB4FFFFu));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
LiveEntityRecord record = live.RegisterAndMaterializeProjection(
@ -90,7 +90,7 @@ public sealed class LiveEntityOrdinaryPhysicsUpdaterTests
{
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
LiveEntityRecord record = live.RegisterAndMaterializeProjection(

View file

@ -1457,7 +1457,7 @@ public sealed class ProjectileControllerTests
{
if (loadInitialLandblock)
Spatial.AddLandblock(EmptyLandblock(0x0101FFFFu));
Live = new LiveEntityRuntime(Spatial, Resources);
Live = LiveEntityRuntimeFixture.Create(Spatial, Resources);
Engine = physicsEngine ?? new PhysicsEngine();
Origin.Recenter(1, 1);
Controller = new ProjectileController(

View file

@ -692,7 +692,7 @@ public sealed class RemotePhysicsUpdaterTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
BindHiddenRemote(live, firstGuid);
@ -840,7 +840,7 @@ public sealed class RemotePhysicsUpdaterTests
0xA9B4FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
Live = new LiveEntityRuntime(
Live = LiveEntityRuntimeFixture.Create(
Spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }),
record =>

View file

@ -87,7 +87,7 @@ public sealed class RemoteTeleportControllerTests
const uint destinationCell = 0xAAB40001u;
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
var live = new LiveEntityRuntime(spatial, new Resources());
var live = LiveEntityRuntimeFixture.Create(spatial, new Resources());
live.RegisterLiveEntity(Spawn(guid, sourceCell));
WorldEntity entity = live.MaterializeLiveEntity(
guid,
@ -228,7 +228,7 @@ public sealed class RemoteTeleportControllerTests
const uint sourceCell = 0xA9B40039u;
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
var live = new LiveEntityRuntime(spatial, new Resources());
var live = LiveEntityRuntimeFixture.Create(spatial, new Resources());
live.RegisterLiveEntity(Spawn(guid, sourceCell));
WorldEntity entity = live.MaterializeLiveEntity(
guid,
@ -319,7 +319,7 @@ public sealed class RemoteTeleportControllerTests
Vector3 sourcePosition = new(191f, 10f, 50f);
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
var live = new LiveEntityRuntime(spatial, new Resources());
var live = LiveEntityRuntimeFixture.Create(spatial, new Resources());
live.RegisterLiveEntity(Spawn(guid, sourceCell));
WorldEntity entity = live.MaterializeLiveEntity(
guid,
@ -1101,7 +1101,7 @@ public sealed class RemoteTeleportControllerTests
]));
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
var live = new LiveEntityRuntime(spatial, resources);
var live = LiveEntityRuntimeFixture.Create(spatial, resources);
live.RegisterLiveEntity(Spawn(guid, sourceCell));
WorldEntity entity = live.MaterializeLiveEntity(
guid,
@ -1179,7 +1179,7 @@ public sealed class RemoteTeleportControllerTests
var spatial = new GpuWorldState();
spatial.AddLandblock(EmptyLandblock(0xA9B4FFFFu));
spatial.AddLandblock(EmptyLandblock(0xAAB4FFFFu));
var live = new LiveEntityRuntime(spatial, new Resources());
var live = LiveEntityRuntimeFixture.Create(spatial, new Resources());
live.RegisterLiveEntity(Spawn(guid, sourceCell));
WorldEntity entity = live.MaterializeLiveEntity(
guid,
@ -1383,7 +1383,7 @@ public sealed class RemoteTeleportControllerTests
internal RollbackFixture(bool celllessSource = false)
{
Spatial.AddLandblock(EmptyLandblock(SourceLandblock));
Live = new LiveEntityRuntime(Spatial, new Resources());
Live = LiveEntityRuntimeFixture.Create(Spatial, new Resources());
Live.RegisterLiveEntity(Spawn(Guid, SourceCell));
Entity = Live.MaterializeLiveEntity(
Guid,