refactor(app): key live projections by runtime identity

Move materialized live-object sidecars and presentation worksets to exact RuntimeEntityKey ownership. Runtime remains the only GUID/incarnation/local-ID authority while hydration, animation, effects, lights, equipped children, renderer resources, visibility, liveness, and teardown resolve exact projection identities. Preserve synchronous callbacks, local-ID allocation order, and current rendering behavior.
This commit is contained in:
Erik 2026-07-25 21:50:58 +02:00
parent e18df84437
commit 420e5eea70
73 changed files with 2939 additions and 1715 deletions

View file

@ -1,5 +1,6 @@
using AcDream.App.World;
using AcDream.Core.Net.Messages;
using AcDream.Runtime.Entities;
namespace AcDream.App.Tests.World;
@ -14,7 +15,9 @@ public sealed class LiveEntityLivenessControllerTests
Assert.Empty(tracker.Tick(10.0, samples));
Assert.Empty(tracker.Tick(34.999, samples));
Assert.Equal(
new LiveEntityPruneCandidate(0x7000_0001u, 4),
new LiveEntityPruneCandidate(
new RuntimeEntityKey(0x7000_0001u, 4),
0x7000_0001u),
Assert.Single(tracker.Tick(35.0, samples)));
Assert.Equal(0, tracker.DeadlineCount);
}
@ -47,7 +50,7 @@ public sealed class LiveEntityLivenessControllerTests
Assert.Empty(tracker.Tick(24.0, [Sample(1, 2, visible: false)]));
Assert.Empty(tracker.Tick(25.0, [Sample(1, 2, visible: false)]));
Assert.Equal(
new LiveEntityPruneCandidate(1, 2),
new LiveEntityPruneCandidate(new RuntimeEntityKey(1, 2), 1),
Assert.Single(tracker.Tick(49.0, [Sample(1, 2, visible: false)])));
}
@ -80,7 +83,11 @@ public sealed class LiveEntityLivenessControllerTests
ushort generation,
bool visible,
bool retained = false) =>
new(guid, generation, visible, retained);
new(
new RuntimeEntityKey(guid, generation),
guid,
visible,
retained);
private static CreateObject.ServerPosition Position(
uint cell,