From 0149220506c0e35ffb96ad9965f44e5ab8625df7 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 30 Jul 2026 12:52:37 +0200 Subject: [PATCH] =?UTF-8?q?test(physics):=20#116=20shape-2=20=E2=80=94=20u?= =?UTF-8?q?n-skip=20D4=20airborne=20wall=20hard-stop=20pin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per docs/research/2026-07-30-ts4-116-oracle-plan.md §3, §3.3 step 1. Test-only change with zero production code in this commit: TS-4's retirement (5e2be19b, the previous commit) is what actually unblocks this test's routing. The plan's confirming instrumentation (probes added in 5e2be19b: which BSPQuery.cs path fires, whether Path 4's FindWalkableInternal finds a walkable candidate) traced D4's tall-vertical-wall scenario: Path 6 fires (SetCollide, no reposition, Adjusted) -> the retry routes to Path 4 (find_walkable), which finds NO candidate for this sheer wall (changed=false, confirmed) -> Path 4 returns OK -> TransitionalInsert's Phase 3 sp.Collide block runs (reachable now that Phase 1/2 both return OK): ContactPlaneValid is false (first airborne contact) so the reset branch fires, LastKnownContactPlaneValid is false too (first frame), so SetCollisionNormal(sp.StepUpNormal) runs and the function returns Collided -- a hard stop, in place, with the wall's real normal. This exactly reproduces the test's original (pre-Skip) expectation, confirming the oracle plan's §3.1/§3.2 structural finding without a live cdb trace. Full AcDream.Core.Tests suite: 4061 passed / 1 skipped (the remaining skip is the unrelated Pvs_CottageInterior_MatchesRetailCellDrawList), no regressions. Co-Authored-By: Claude Fable 5 --- .../Physics/BSPStepUpTests.cs | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/tests/AcDream.Core.Tests/Physics/BSPStepUpTests.cs b/tests/AcDream.Core.Tests/Physics/BSPStepUpTests.cs index 8ff68869..57232ab4 100644 --- a/tests/AcDream.Core.Tests/Physics/BSPStepUpTests.cs +++ b/tests/AcDream.Core.Tests/Physics/BSPStepUpTests.cs @@ -549,18 +549,33 @@ public class BSPStepUpTests /// does this with transient_state bit 2 + InitSlidingNormal. Without that, /// every frame replays the same hard stop and the character hangs in falling /// animation until another correction breaks the loop. + /// + /// + /// #116 shape-2 RESOLVED (Campaign P final physics slice, 2026-07-30; + /// docs/research/2026-07-30-ts4-116-oracle-plan.md §3, §3.3 step 1). This + /// pin was `Skip`-tagged because the engine slid IN-FRAME to Z=1.92 on + /// the first airborne wall frame instead of hard-stopping at Z=2.0. The + /// confirming instrumentation (a probe on which BSPQuery.cs path fires + /// and whether Path 4's FindWalkableInternal finds a candidate) showed: + /// Path 6 fires (`SetCollide`, no reposition, `Adjusted`) → the retry + /// routes to Path 4 (`find_walkable`), which finds NO candidate for this + /// sheer vertical wall (`changed=false`, confirmed) → Path 4 returns `OK` + /// → TransitionalInsert's Phase 3 `sp.Collide` block runs (finally + /// reachable since Phase 1/2 both returned OK): `ContactPlaneValid` is + /// false (first airborne contact), so the reset branch fires, + /// `LastKnownContactPlaneValid` is false too (first frame), so + /// `SetCollisionNormal(sp.StepUpNormal)` runs and the function returns + /// `Collided` — a hard stop, in place, with the wall's real normal. This + /// exactly matches this test's ORIGINAL (pre-Skip) expectation. Un-skipped + /// as a test-only change (landed one commit after TS-4's own retirement, + /// 5e2be19b, which is what actually unblocks Path 6's faithful + /// `SetCollide` for a single-sphere mover on a steep/vertical wall): + /// the routing this test now pins was already correct in + /// `BSPQuery.cs`/`TransitionTypes.cs`; only the now-deleted shortcut was + /// masking it. + /// /// - [Fact(Skip = "Issue #116 shape-2 — the engine slides IN-FRAME to Z=1.92 " + - "on the first airborne wall frame; this pin expects an L.2c hard stop " + - "at Z=2.0. Ghidra (2026-06-12) confirms retail CSphere::slide_sphere " + - "(0x00537440) applies the slide IN-FRAME (add_offset_to_check_pos → " + - "SLID_TS), so our 1.92 is faithful TO slide_sphere and the Z=2.0 " + - "expectation is the SUSPECT half — but whether retail's first " + - "airborne frame REACHES slide_sphere (→1.92) or hard-stops upstream " + - "(collide_with_environment dispatch / no last-known plane) needs a " + - "cdb trace of an airborne wall hit before flipping the assertion. The " + - "#116 threshold fix (EpsilonSq→F_EPSILON) did NOT change this — the D4 " + - "offset is a real slide, not degenerate. See docs/ISSUES.md #116.")] + [Fact] public void D4_AirborneMover_TallWall_PersistsSlidingNormalAcrossFrames() { var (root, resolved) = BSPStepUpFixtures.TallWall();