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

@ -1161,7 +1161,7 @@ public sealed class EquippedChildProjectionWithdrawalTests
(Cell & 0xFFFF0000u) | 0xFFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
Live = new LiveEntityRuntime(
Live = LiveEntityRuntimeFixture.Create(
Spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }),
_lifecycle);

View file

@ -17,7 +17,7 @@ public sealed class LiveAppearanceAnimationTests
public void Capture_UsesCanonicalRecordEntityAndAnimationOwner()
{
const uint guid = 0x70000002u;
var runtime = new AcDream.App.World.LiveEntityRuntime(
var runtime = LiveEntityRuntimeFixture.Create(
new AcDream.App.Streaming.GpuWorldState(),
new AcDream.App.World.DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
var spawn = new AcDream.Core.Net.WorldSession.EntitySpawn(
@ -118,7 +118,7 @@ public sealed class LiveAppearanceAnimationTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
var runtime = new LiveEntityRuntime(
var runtime = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
WorldSession.EntitySpawn first = Spawn(guid, cell, instance: 1);

View file

@ -440,7 +440,7 @@ public sealed class LiveEntityAnimationPresenterTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
return Add(live, guid, partCount, scale, withSequencer);

View file

@ -679,7 +679,7 @@ public sealed class LiveEntityAnimationSchedulerTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
LiveEntityRecord record = live.RegisterAndMaterializeProjection(
@ -800,7 +800,7 @@ public sealed class LiveEntityAnimationSchedulerTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
var live = new LiveEntityRuntime(
var live = LiveEntityRuntimeFixture.Create(
spatial,
new DelegateLiveEntityResourceLifecycle(_ => { }, _ => { }));
LiveEntityRecord record = live.RegisterAndMaterializeProjection(

View file

@ -286,7 +286,7 @@ public sealed class LiveEntityCreateSupersessionRecoveryTests
0x0101FFFFu,
new DatReaderWriter.DBObjs.LandBlock(),
Array.Empty<WorldEntity>()));
return new LiveEntityRuntime(
return LiveEntityRuntimeFixture.Create(
spatial,
resources,
new DelegateLiveEntityRuntimeComponentLifecycle(_ => { }));

View file

@ -357,7 +357,7 @@ public sealed class LiveRenderProjectionJournalTests
var resources = new DelegateLiveEntityResourceLifecycle(
static _ => { },
entity => sink?.OnResourceUnregister(entity));
var runtime = new LiveEntityRuntime(state, resources);
var runtime = LiveEntityRuntimeFixture.Create(state, resources);
var journal = new RenderProjectionJournal(
RenderSceneGeneration.FromRaw(1));
var projections = new LiveRenderProjectionJournal(

View file

@ -55,7 +55,7 @@ public sealed class EntityEffectControllerTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
Runtime = new LiveEntityRuntime(
Runtime = LiveEntityRuntimeFixture.Create(
Spatial,
new NoopResources(),
record => _controller?.OnLiveEntityUnregistered(record));

View file

@ -151,7 +151,7 @@ public sealed class LiveEntityLightControllerTests
0x0101FFFFu,
new LandBlock(),
Array.Empty<WorldEntity>()));
Runtime = new LiveEntityRuntime(Spatial, new NoopResources(), _ => { });
Runtime = LiveEntityRuntimeFixture.Create(Spatial, new NoopResources(), _ => { });
Sink = new LightingHookSink(Lights, Poses);
Controller = new LiveEntityLightController(
Runtime,