acdream/tests/AcDream.Runtime.Tests/Physics
Erik fe6ee877d1 test(physics): measure whether the remote sweep alone tracks surface Z (AD-10 Stage 0)
AD-10 claims the remote slope projection is "relocated" out of the sweep
because "remote bodies don't run a full local transition sweep". That
justification is false at HEAD: RuntimeRemotePhysicsUpdater.Tick calls
PhysicsEngine.ResolveWithTransition with the remote's own body, and that
sweep runs acdream's verbatim port of CTransition::adjust_offset
(0x0050a370, pc:272271-272393) once per sub-step. So the boundary
projection is an EXTRA layer, not a relocation — and whether it is doing
anything the sweep does not is a measurement, never an argument.

This commit builds the fixture for that measurement and changes no
production code.

RuntimeRemoteSteepContactSlideTests' private Harness is extracted to
RemoteRampHarness so the new tests share it instead of cloning ~180 lines.
The extraction is behaviour-preserving; its only additions are the
fixture's own TerrainSurface (so an assertion about "is the body on the
surface" is answered by the surface geometry rather than by
re-implementing what the code under test computed), a SurfaceZ helper, and
a Tick overload that supplies a per-frame body-local root displacement —
the locomotion-cycle push a running remote actually carries. All ten Bug B
tests pass unchanged against it.

RuntimeRemoteSlopeProjectionTests then drives the production tick 30 ticks
down a 31-degree walkable ramp and asserts, on EVERY tick rather than at
the end, that the body's root stays within 5 mm of its settled offset from
the terrain beneath it. A staircase catching up on the final tick would
pass a start/end comparison; 30 unprojected ticks accumulate ~1.8 m.

Sabotage results, all from clean builds (bin/obj deleted), reported in
both directions:

  * Discard the sweep's answer (Body.Position = postIntegratePos instead
    of resolveResult.Position): RED at tick 1, body 0.05999 m off the
    surface. This is the tracking test's discriminating sabotage.
  * Flatten the ramp to gradient 0: RED on the anti-vacuity guard
    (dz = 0.0000 m). That guard exists because the tracking assertion
    passes trivially on flat ground, where Z never has to move.
  * Short-circuit Transition.AdjustOffset to `return offset;`: GREEN.
    Recorded, not hidden — it is the reason the contract's proposed T1
    sabotage was rejected. On terrain the sweep has a SECOND independent
    way to plant Z: ValidateWalkable's push-out re-seats the sphere at its
    natural resting distance from the terrain plane every sub-step.
    Removing the step-down probe as well does not change it either
    (measured). The tests therefore assert the OUTCOME the projection
    exists for, and say in their own doc comments that they are not unit
    tests of adjust_offset and must not be cited as such.

One test the contract asked for is deliberately absent. An uphill
counterpart was written, passed, and was then found VACUOUS: on this
fixture ResolveWithTransition returns ok=False for uphill motion and the
body does not move at all, so it "tracked the surface" by standing still.
That finding is filed separately rather than shipped as a green test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-06 09:34:56 +02:00
..
RemoteRampHarness.cs test(physics): measure whether the remote sweep alone tracks surface Z (AD-10 Stage 0) 2026-08-06 09:34:56 +02:00
RuntimeAuthoritativePositionRouteClassifierTests.cs fix(physics): C4 route 7 — child cell propagation moves from a render tick into Runtime 2026-08-04 23:53:05 +02:00
RuntimeCollisionMutationTransactionTests.cs feat(runtime): atomically replace collision generations 2026-08-01 17:33:34 +02:00
RuntimeCollisionPrefixQuiescenceTests.CornerLandblock.cs feat(runtime): C3c - production placement cutover: both hosts on the residence conductors (routes 1+8) 2026-08-02 18:10:33 +02:00
RuntimeCollisionPrefixQuiescenceTests.cs fix(physics): restore a cancelled park instead of leaving the entity withdrawn 2026-08-04 04:07:39 +02:00
RuntimeCollisionReportingStateTests.cs fix(runtime): preserve hidden setposition collision ownership 2026-08-01 18:22:45 +02:00
RuntimePhysicsOwnershipBoundaryTests.cs feat(runtime): atomically replace collision generations 2026-08-01 17:33:34 +02:00
RuntimePhysicsStateTests.cs wip(physics): collision O(changed) delta-commit (O1-O3) - ON HOLD, feel-test failed 2026-08-02 20:06:59 +02:00
RuntimePlacementProjectionSubscriptionTests.cs feat(app): observe canonical placement receipts 2026-08-01 15:22:52 +02:00
RuntimeRemoteFarSnapPositionTests.cs feat(physics): C4 route 4b-3 — remote teleport + cell-less through the canonical placement 2026-08-04 16:00:10 +02:00
RuntimeRemoteSlopeProjectionTests.cs test(physics): measure whether the remote sweep alone tracks surface Z (AD-10 Stage 0) 2026-08-06 09:34:56 +02:00
RuntimeRemoteSteadyStatePositionTests.cs feat(physics): C4 route 4b-3 — remote teleport + cell-less through the canonical placement 2026-08-04 16:00:10 +02:00
RuntimeRemoteSteepContactSlideTests.cs test(physics): measure whether the remote sweep alone tracks surface Z (AD-10 Stage 0) 2026-08-06 09:34:56 +02:00
RuntimeSetPositionMoverPreparationTests.cs fix(physics): #297 — keep the PWD bitfield live so PK status reaches the client 2026-08-03 20:59:01 +02:00
RuntimeSetPositionStateTests.cs fix(review): close the C5b architecture-review findings (D2/D3/D4, L1-L5, S1) 2026-08-05 22:08:46 +02:00
RuntimeWorldFrameTests.cs fix(runtime): name why a placement is parked and fail closed when it cannot resolve 2026-08-03 13:55:16 +02:00