refactor(runtime): own per-session physics simulation

Move the sole PhysicsEngine, production cache, collision admissions, canonical bodies and hosts, remote components, ordinary/remote worksets, simulation, cell commits, and shadow synchronization under RuntimeEntityObjectLifetime. Keep App as the prepared-asset, animation-input, and render-projection adapter while preserving the named-retail update and collision order.

Add exact-incarnation, object-clock, callback-reentrancy, GUID-reuse, two-runtime isolation, source ownership, collision publication, and graphical projection coverage. Release build and the complete 8,588-test solution pass.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-26 13:39:57 +02:00
parent 0dc3bfdeff
commit 7e6033d0ad
39 changed files with 3685 additions and 1722 deletions

View file

@ -56,7 +56,7 @@ public sealed class LiveEntityAnimationSchedulerTests
public void HiddenRemotePose_IsSampledOnceAfterAdmittedHiddenQuantum()
{
var (live, record, animation) = BuildHiddenAnimated(RemoteGuid);
var remote = new AcDream.App.Physics.RemoteMotion
var remote = new AcDream.Runtime.Physics.RemoteMotion
{
CellId = Cell,
};
@ -173,7 +173,7 @@ public sealed class LiveEntityAnimationSchedulerTests
var (live, record, entity) = BuildMaterialized(
RemoteGuid,
PhysicsStateFlags.Gravity);
var remote = new AcDream.App.Physics.RemoteMotion
var remote = new AcDream.Runtime.Physics.RemoteMotion
{
CellId = Cell,
Airborne = true,
@ -290,7 +290,7 @@ public sealed class LiveEntityAnimationSchedulerTests
var physics = new PhysicsEngine();
var projectiles = new ProjectileController(live, physics);
record.FinalPhysicsState = ProjectileState;
var remote = new AcDream.App.Physics.RemoteMotion
var remote = new AcDream.Runtime.Physics.RemoteMotion
{
CellId = Cell,
Airborne = false,
@ -602,9 +602,9 @@ public sealed class LiveEntityAnimationSchedulerTests
Assert.Equal(1, rootPublishes);
}
private static AcDream.App.Physics.RemoteMotion BuildRemote(WorldEntity entity)
private static AcDream.Runtime.Physics.RemoteMotion BuildRemote(WorldEntity entity)
{
var remote = new AcDream.App.Physics.RemoteMotion
var remote = new AcDream.Runtime.Physics.RemoteMotion
{
CellId = Cell,
};
@ -625,13 +625,13 @@ public sealed class LiveEntityAnimationSchedulerTests
PhysicsEngine? physics = null,
ProjectileController? projectiles = null)
{
physics ??= new PhysicsEngine();
physics ??= live.Physics.Engine;
var remotePhysics = new RemotePhysicsUpdater(
physics,
live.Physics,
(_, _) => (0.48f, 1.835f),
(_, _, _, _) => { });
var ordinaryPhysics = new LiveEntityOrdinaryPhysicsUpdater(
physics,
live.Physics,
(_, _) => (0.48f, 1.835f));
var identity = new LocalPlayerIdentityState { ServerGuid = localPlayerGuid };
var poses = new EntityEffectPoseRegistry();