fix(physics): TS-4 retired — Path-6 steep-poly shortcut deleted

Per docs/research/2026-07-30-ts4-116-oracle-plan.md §1, §4 item 2 (the
decisive TS-4 confirming run). Retail's BSP layer has NO steepness test at
all (acclient_2013_pseudo_c.txt:323783-323821, 0x0053a793) — every airborne
hit, steep or shallow, falls through to the same unconditional
`SetCollide` + `Adjusted`. The L.4 slide-tangent shortcut (worldNormal.Z <
FloorZ -> project-and-Slid, with its own SetSlidingNormal write) is deleted
from both BSPQuery.cs's and FlatBspQuery.cs's Path 6 sphere0 branch.

Fixing FlatBspQuery.cs (the flat/indexed engine Slice I6/I7 made
production-authoritative) was necessary in this same commit: it carried an
exact structural duplicate of the shortcut, caught by
FlatBspQueryDifferentialTests.InstalledDat_LargeRandomizedSweep_HasZeroBitMismatch
(graph=Adjusted vs flat=Slid) once the graph side was fixed alone. Its
sphere1 branch is also brought in line with the #116 shape-1 fix landed
in db2889af (direct Collided + SetCollisionNormal instead of the deferred
SetCollide/shortcut treatment) — that parity gap existed since shape-1's
commit only touched BSPQuery.cs and the randomized differential sweep
didn't happen to exercise the narrow foot-clear/head-hit case until this
session's broader change surfaced it.

DECISIVE CONFIRMING RUN (Ts4SteepRoofWedgeCaptureTests, per the plan's own
required test-first order): added
FallOntoSteepSlope_WithHorizontalVelocity_NeverFreezesForOverHalfASecond_AndReachesFloor
— the same steep-roof drop as the existing pure-vertical fixture, but with
a small residual horizontal velocity (vx=-0.3 m/s), matching the realistic
live-play input (WASD, jump momentum) that validated the shortcut on
2026-04-30. With the shortcut removed, this variant converges cleanly to
the flat floor with zero freeze. The pure-vertical fixture, run
shortcut-removed, DOES still freeze — per the oracle plan's root-cause
trace (§1.2 Step E), this is the DEGENERATE case: AdjustOffset's crease
projection (Cross(ContactPlane.Normal, SlidingNormal)) is mathematically
orthogonal to a purely-Z gravity offset, crushing it to zero every tick
before TransitionalInsert can run again — present identically in the raw
decomp, ACE's port, and this port. Renamed and re-asserted as a PINNED
known-degenerate test
(FallOntoSteepSlope_PureVertical_FreezesAtDegenerateFixedPoint_RetailParity)
rather than treated as a bug. Filed as register row AD-56.

BSPStepUpTests.C3_Path6_AirborneMoverHitsSteepSlope_ReturnsSlid pinned the
OLD shortcut's Slid-no-Collide behavior directly; renamed to
...ReturnsAdjustedAndSetsCollide and corrected to the retail-faithful
Adjusted/Collide=true outcome.

Register: TS-4 row retired (struck through, retirement note); AD-56 filed
for the pure-vertical degenerate case; the retire-next shortlist's TS-4
entry removed and renumbered.

Full AcDream.Core.Tests suite: 4060 passed / 2 skipped (D4 stays Skip-tagged
in this commit; its own un-skip is a separate, dependent test-only commit
for #116 shape-2), no regressions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-07-30 12:51:44 +02:00
parent db2889afda
commit 5e2be19b4e
5 changed files with 252 additions and 154 deletions

View file

@ -2034,24 +2034,18 @@ internal static class FlatBspQuery
localToWorld);
}
// TS-4 RETIRED (Campaign P final physics slice, 2026-07-30;
// docs/research/2026-07-30-ts4-116-oracle-plan.md §1, §4 item 2).
// Retail's BSP layer has no steepness test at this layer at all
// (acclient_2013_pseudo_c.txt:323783-323821, 0x0053a793) — every
// hit (steep or shallow) falls through to the same unconditional
// SetCollide. The old L.4 slide-tangent shortcut (worldNormal0.Z
// < FloorZ -> project-and-Slid with its own SetSlidingNormal
// write) is deleted; see BSPQuery.cs's Path 6 for the mirrored
// fix and full citation. Kept in parity with BSPQuery.cs per the
// FlatBspQueryDifferentialTests graph-vs-flat comparison.
Vector3 worldNormal0 = LocalToWorld(
tree.PolygonTable.Polygons[defaultHitPolygonIndex0].Plane.Normal);
if (worldNormal0.Z < PhysicsGlobals.FloorZ)
{
Vector3 currentWorld =
path.GlobalCurrCenter[0].Origin;
Vector3 endWorld =
path.GlobalSphere[0].Origin;
Vector3 globalDelta = endWorld - currentWorld;
float difference = Vector3.Dot(worldNormal0, globalDelta);
if (difference < 0f)
path.AddOffsetToCheckPos(-worldNormal0 * difference);
collisions.SetCollisionNormal(worldNormal0);
collisions.SetSlidingNormal(worldNormal0);
RecordDiagnosticHit(tree, defaultHitPolygonIndex0);
return TransitionState.Slid;
}
path.SetCollide(worldNormal0);
path.WalkableAllowance = PhysicsGlobals.LandingZ;
@ -2073,30 +2067,22 @@ internal static class FlatBspQuery
if (defaultHit1 || defaultHitPolygonIndex1 >= 0)
{
// #116 shape-1 fix (Campaign P final physics slice,
// 2026-07-30; docs/research/2026-07-30-ts4-116-oracle-plan.md
// §2.3-§2.4). Retail's airborne (not-yet-Contact)
// find_collisions dispatch, when the FOOT sphere is
// completely clear but the HEAD sphere hits or near-misses,
// records the head polygon's normal directly and hard-stops
// rather than deferring through SetCollide/Adjusted:
// pc:323824-323834 (0x0053a793/0x0053a7a4), cross-checked
// against ACE BSPTree.cs:221-230. See BSPQuery.cs's Path 6
// for the mirrored fix and full citation.
Vector3 worldNormal1 = LocalToWorld(
tree.PolygonTable.Polygons[defaultHitPolygonIndex1].Plane.Normal);
if (worldNormal1.Z < PhysicsGlobals.FloorZ)
{
Vector3 currentWorld =
path.GlobalCurrCenter[0].Origin;
Vector3 endWorld =
path.GlobalSphere[0].Origin;
Vector3 globalDelta = endWorld - currentWorld;
float difference =
Vector3.Dot(worldNormal1, globalDelta);
if (difference < 0f)
path.AddOffsetToCheckPos(-worldNormal1 * difference);
collisions.SetCollisionNormal(worldNormal1);
collisions.SetSlidingNormal(worldNormal1);
RecordDiagnosticHit(tree, defaultHitPolygonIndex1);
return TransitionState.Slid;
}
path.SetCollide(worldNormal1);
path.WalkableAllowance = PhysicsGlobals.LandingZ;
collisions.SetCollisionNormal(worldNormal1);
RecordDiagnosticHit(tree, defaultHitPolygonIndex1);
return TransitionState.Adjusted;
return TransitionState.Collided;
}
}