acdream/tests/AcDream.Core.Tests/Physics
Erik de129bc164 feat(motion): L.3 M1 — fresh InterpolationManager port + retail spec
Rewrites src/AcDream.Core/Physics/InterpolationManager.cs from the spec
in docs/research/2026-05-04-l3-port/04-interp-manager.md. Public API
preserved (Vector3-returning AdjustOffset, Enqueue, Clear, IsActive,
Count) so PositionManager + GameWindow callers continue to compile;
internals are full retail spec.

Bug fixes vs prior port (audit 04-interp-manager.md § 7):

  #1  progress_quantum accumulates dt (sum of frame deltas), not step
      magnitude. Retail line 353140; the prior port's `+= step` made
      the secondary stall ratio meaningless.

  #3  Far-branch Enqueue (dist > AutonomyBlipDistance = 100m) sets
      _failCount = StallFailCountThreshold + 1 = 4, so the next
      AdjustOffset call's post-stall check fires an immediate blip-to-
      tail snap. Retail line 352944. Prior port silently drifted
      toward far targets at catch-up speed instead of teleporting.

  #4  Secondary stall test ports the retail formula verbatim:
      cumulative / progress_quantum / dt < CREATURE_FAILED_INTERPOLATION_PERCENTAGE.
      Audit notes the units are 1/sec (likely Turbine bug or x87 FPU
      misread by Binary Ninja) — mirrored byte-for-byte regardless.

  #5  Tail-prune is a tail-walking loop, not a single-tail compare.
      Multiple consecutive stale tail entries within DesiredDistance
      (0.05 m) of the new target collapse together. Retail line 352977.

  #6  Cap-eviction at the HEAD when count reaches 20 (already correct
      in the prior port; verified).

New API: Enqueue gains an optional `currentBodyPosition` parameter so
the far-branch detection can reference the body when the queue is
empty. Backward-compatible (default null = pre-far-branch behavior).

UseTime collapsed into AdjustOffset's tail (post-stall blip check)
since acdream has no per-tick UseTime call separate from
adjust_offset; identical semantic outcome.

State fields renamed to retail names with sentinel values:
  _frameCounter, _progressQuantum, _originalDistance (init = 999999f
  sentinel per retail line 0x00555D30 ctor), _failCount.

Tests:
- 17/17 InterpolationManagerTests green.
- New test Enqueue_FarBranch_PrearmsImmediateBlipOnNextAdjustOffset
  pins the bug #3 fix: enqueueing 150 m away triggers a same-tick
  blip (delta length ≈ 150 m), and the queue clears.

Spec tree: 17 research docs (00–14) under docs/research/2026-05-04-l3-port/.
00-master-plan + 00-port-plan describe the 8-phase rollout. 01-per-tick,
03-up-routing, 04-interp-manager, 05-position-manager-and-partarray,
06-acdream-audit, 14-local-player-audit are the L.3 spec used by this
commit and the M2 follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:56:42 +02:00
..
AnimationCommandRouterTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
AnimationHookRouterTests.cs feat(anim): Phase E.1 hook router + GameWindow wiring 2026-04-18 16:30:23 +02:00
AnimationSequencerTests.cs fix(anim): Phase L.1c sequencer cycle fallback for missing MoveTo motion 2026-04-29 10:33:48 +02:00
BSPQueryTests.cs feat(physics): PhysicsDataCache + BSP sphere query 2026-04-13 23:28:39 +02:00
BSPStepUpFixtures.cs feat(physics): Phase L.2.1+L.2.2 — BSP step-up and rooftop landing 2026-04-29 16:16:39 +02:00
BSPStepUpTests.cs fix(physics): L.4 — steep airborne hits slide-tangent (interim, deviates from retail) 2026-04-30 13:22:07 +02:00
CellSurfaceTests.cs feat(core): Phase B.3 — CellSurface (indoor floor polygon projection) 2026-04-12 09:51:22 +02:00
CollisionExemptionTests.cs feat(physics): retail PvP exemption + viewer/creature/missile gates (Commit C) 2026-04-29 13:21:36 +02:00
CollisionPrimitivesTests.cs feat(physics): port 9 collision primitives from acclient.exe (chunk_00530000.c) 2026-04-12 23:53:47 +02:00
EntityCollisionFlagsTests.cs feat(physics): live-entity collision plumbing (Commit A) 2026-04-29 13:12:56 +02:00
InterpolationManagerTests.cs feat(motion): L.3 M1 — fresh InterpolationManager port + retail spec 2026-05-05 14:56:42 +02:00
MotionCommandResolverTests.cs fix(anim): Phase L.1b route motion commands 2026-04-28 10:46:22 +02:00
MotionInterpreterTests.cs test(physics): MyRunRate fallback test for GetMaxSpeed (L.3.1 Task 2 polish) 2026-05-02 19:20:39 +02:00
PhysicsBodyTests.cs feat(core): port decompiled AC client physics — CollisionPrimitives + PhysicsBody 2026-04-12 23:54:51 +02:00
PhysicsEngineTests.cs fix(physics): L.4 — steep airborne hits slide-tangent (interim, deviates from retail) 2026-04-30 13:22:07 +02:00
PlayerWeenieTests.cs feat(physics): PlayerWeenie with retail Run/Jump formulas 2026-04-13 23:15:25 +02:00
PortalPlaneTests.cs feat(core): Phase B.3 — PortalPlane (plane math + crossing detection) 2026-04-12 18:17:48 +02:00
PositionManagerTests.cs feat(physics): PositionManager combiner class + 6 unit tests (L.3.2) 2026-05-03 10:13:02 +02:00
RemoteMoveToDriverTests.cs fix(anim): Phase L.1c clamp approach velocity to prevent overshoot 2026-04-29 10:14:35 +02:00
ServerControlledLocomotionTests.cs fix(anim): Phase L.1c match MoveTo run speed 2026-04-28 20:58:22 +02:00
ShadowObjectRegistryTests.cs feat(physics): live-entity collision plumbing (Commit A) 2026-04-29 13:12:56 +02:00
TerrainSurfaceTests.cs fix(physics): #32 L.2c precipice edge-slide context 2026-04-30 08:04:37 +02:00
TransitionTests.cs feat(physics): Transition.FindTransitionalPosition core algorithm 2026-04-13 23:52:45 +02:00