chore(motion): L.3 M6 — scrub stale ACDREAM_INTERP_MANAGER + dead fields

Cleans up dead code revealed by L.3 M2/M3:

GameWindow.cs:
- RemoteMotion.LastServerZ field deleted (only consumed by the M2-
  removed Step 5 landing fallback in TickAnimations; never read).
- RemoteMotion.TargetOrientation field deleted (audit § 1 flagged as
  DEAD; only ever written, never read).
- Stale ACDREAM_INTERP_MANAGER comments removed from RemoteMotion.Interp
  and OnLivePositionUpdated (the env-var no longer gates anything as
  of M2).
- Doc-comments on Interp + Position rewritten to describe the M2/M3
  production semantics (queue catch-up + REPLACE-style combiner).

CLAUDE.md:
- ACDREAM_INTERP_MANAGER env-var entry rewritten as a retirement note
  pointing at commit 40d88b9 (M2). The path it gated is now the
  default for player remotes.

Build green, dotnet test green (8 pre-existing failures unchanged on
this baseline).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-05 15:20:50 +02:00
parent 2365c8cd6e
commit d57ace0177
2 changed files with 13 additions and 53 deletions

View file

@ -552,17 +552,14 @@ via `PlayerMovementController.ApplyServerRunRate`) or from
diagnostics (`[UM_RAW]`, `[SCFAST]`, `[SCFULL]`, `[SETCYCLE]`, diagnostics (`[UM_RAW]`, `[SCFAST]`, `[SCFULL]`, `[SETCYCLE]`,
`[FWD_WIRE]`, `[OMEGA_DIAG]`, `[SEQSTATE]`, `[PARTSDIAG]`, `[FWD_WIRE]`, `[OMEGA_DIAG]`, `[SEQSTATE]`, `[PARTSDIAG]`,
`[VEL_DIAG]`, `[UPCYCLE]`). Heavy. `[VEL_DIAG]`, `[UPCYCLE]`). Heavy.
- ⚠️ `ACDREAM_INTERP_MANAGER=1`**DO NOT ENABLE.** This was an - *(retired 2026-05-05 by L.3 M2/M3)* `ACDREAM_INTERP_MANAGER` was an
experimental rewrite (e94e791) of the per-tick remote motion path. env-var gate on an experimental per-tick remote motion path. L.3 M2
It's regressed: the env-var path drops the per-tick collision sweep (commit 40d88b9) replaced both gates (`OnLivePositionUpdated` +
(`ResolveWithTransition`) that the default path retains, causing a `TickAnimations`) with `IsPlayerGuid(...)` so player remotes use the
visible "staircase" pattern when remotes run up/down slopes (body retail-faithful queue routing (InterpolationManager queue catch-up +
Z stays flat between UPs, snaps at each one) plus position blips PositionManager combiner) unconditionally. NPCs and airborne player
during steady-state motion. Default (env-var unset) uses the remotes still flow through the legacy `apply_current_movement` +
working retail-port chain. The PositionManager class itself is `ResolveWithTransition` path. The env-var no longer toggles anything.
fine and retail-faithful; only the integration into per-tick was
wrong. To be re-done in a future L.3 follow-up phase as additive
refinement on top of the working chain.
### Outbound motion wire format (acdream → ACE) ### Outbound motion wire format (acdream → ACE)

View file

@ -295,11 +295,6 @@ public sealed class GameWindow : IDisposable
/// </summary> /// </summary>
public double LastMoveToPacketTime; public double LastMoveToPacketTime;
/// <summary> /// <summary>
/// Legacy field — no longer used for slerp (retail hard-snaps
/// per FUN_00514b90 set_frame). Kept to avoid churn.
/// </summary>
public System.Numerics.Quaternion TargetOrientation = System.Numerics.Quaternion.Identity;
/// <summary>
/// Angular velocity seeded from UpdateMotion TurnCommand/TurnSpeed /// Angular velocity seeded from UpdateMotion TurnCommand/TurnSpeed
/// (π/2 × turnSpeed, signed). Applied per tick to body orientation /// (π/2 × turnSpeed, signed). Applied per tick to body orientation
/// via manual integration (bypassing <c>PhysicsBody.update_object</c>'s /// via manual integration (bypassing <c>PhysicsBody.update_object</c>'s
@ -334,34 +329,21 @@ public sealed class GameWindow : IDisposable
/// <summary> /// <summary>
/// Per-remote position-waypoint queue + catch-up math (retail's /// Per-remote position-waypoint queue + catch-up math (retail's
/// CPhysicsObj::InterpolateTo + InterpolationManager::adjust_offset). /// CPhysicsObj::InterpolateTo + InterpolationManager::adjust_offset).
/// Replaces the hard-snap-then-Euler-extrapolate path when /// Drives per-tick body translation for grounded player remotes
/// <c>ACDREAM_INTERP_MANAGER=1</c> — see Phase L.3.1 spec at /// via <see cref="Position"/>.
/// <c>docs/superpowers/specs/2026-05-02-l3-remote-entity-motion-design.md</c>.
/// Field exists from Task 3 onwards; consumed in Tasks 4 + 5.
/// </summary> /// </summary>
public AcDream.Core.Physics.InterpolationManager Interp { get; } = public AcDream.Core.Physics.InterpolationManager Interp { get; } =
new AcDream.Core.Physics.InterpolationManager(); new AcDream.Core.Physics.InterpolationManager();
/// <summary> /// <summary>
/// Per-frame combiner for animation root motion + InterpolationManager /// Per-frame combiner for animation root motion + InterpolationManager
/// correction (Phase L.3.2). Consumed in TickAnimations to compute the /// correction. Mirrors retail UpdatePositionInternal @ 0x00512c30:
/// per-frame body.Position delta. /// queue catch-up REPLACES anim when active; anim stands when queue
/// is idle.
/// </summary> /// </summary>
public AcDream.Core.Physics.PositionManager Position { get; } = public AcDream.Core.Physics.PositionManager Position { get; } =
new AcDream.Core.Physics.PositionManager(); new AcDream.Core.Physics.PositionManager();
/// <summary>
/// Most recent server-broadcast Z coordinate from any UpdatePosition
/// (including mid-arc airborne UPs). Used by the
/// <c>ACDREAM_INTERP_MANAGER=1</c> per-tick path as a landing-fallback
/// floor: if gravity drags the body's Z below this value while
/// <see cref="Airborne"/> is still set, force-land locally because
/// the server has effectively told us where the ground is even if
/// it never sent an IsGrounded=true UP. Initialized to NaN so the
/// fallback is a no-op until the first UP arrives.
/// </summary>
public float LastServerZ = float.NaN;
/// <summary> /// <summary>
/// Diagnostic-only (gated on <c>ACDREAM_REMOTE_VEL_DIAG=1</c>): the /// Diagnostic-only (gated on <c>ACDREAM_REMOTE_VEL_DIAG=1</c>): the
/// previous UpdatePosition's world position + timestamp. The per-tick /// previous UpdatePosition's world position + timestamp. The per-tick
@ -3444,30 +3426,12 @@ public sealed class GameWindow : IDisposable
// from ServerVelocity / ServerMoveTo which the legacy path // from ServerVelocity / ServerMoveTo which the legacy path
// already handles correctly. // already handles correctly.
// //
// Was previously gated on ACDREAM_INTERP_MANAGER=1; the env-var
// path's per-tick TickAnimations counterpart is regressed
// (issue #40). M2 keeps the OnLivePositionUpdated half (which
// is correct) and rewrites the per-tick half — see TickAnimations.
if (IsPlayerGuid(update.Guid)) if (IsPlayerGuid(update.Guid))
{ {
// Orientation always snaps on receipt — InterpolationManager walks // Orientation always snaps on receipt — InterpolationManager walks
// position only; heading would otherwise lag the queue. // position only; heading would otherwise lag the queue.
rmState.Body.Orientation = rot; rmState.Body.Orientation = rot;
// Track the most recent GROUNDED server-broadcast Z. Read by
// the per-tick landing-fallback in TickAnimations: if gravity
// drags the body more than 0.5 m below this floor while still
// airborne, we force-land locally even when the server never
// sent an IsGrounded=true UP for the actual landing frame.
//
// Only updated for grounded UPs — mid-arc airborne UPs would
// raise this value to the player's peak Z, then the body's
// descent would cross (peak - 0.5) and trigger a force-land
// mid-air, producing the user-reported "small landing in the
// air before landing on the ground" when jumping while moving.
if (update.IsGrounded)
rmState.LastServerZ = worldPos.Z;
// Diagnostic (ACDREAM_REMOTE_VEL_DIAG=1): roll the previous // Diagnostic (ACDREAM_REMOTE_VEL_DIAG=1): roll the previous
// server-pos snapshot forward AND print the per-UP comparison // server-pos snapshot forward AND print the per-UP comparison
// between the max sequencer speed observed since last UP and // between the max sequencer speed observed since last UP and
@ -3643,7 +3607,6 @@ public sealed class GameWindow : IDisposable
// a halved "observed" rate → visible slow-start. Formula-only // a halved "observed" rate → visible slow-start. Formula-only
// is stable and simple; hard-snap fixes any drift. // is stable and simple; hard-snap fixes any drift.
rmState.Body.Orientation = rot; rmState.Body.Orientation = rot;
rmState.TargetOrientation = rot;
rmState.LastServerPos = worldPos; rmState.LastServerPos = worldPos;
rmState.LastServerPosTime = nowSec; rmState.LastServerPosTime = nowSec;
// Align the body's physics clock with our clock so update_object // Align the body's physics clock with our clock so update_object