From 35631d1ec0de2ae17a78bd2f9044f3ff647e1da0 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 21 May 2026 18:34:55 +0200 Subject: [PATCH] =?UTF-8?q?feat(physics):=20A6.P1=20=E2=80=94=20instrument?= =?UTF-8?q?=20FindCollisions=20with=20[push-back-disp]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires LogPushBackDispatch into the modern FindCollisions overload at the entry block (after path/collisions/obj locals + movement computed). Legacy overload at line ~1895 delegates to modern, so single instrumentation site covers all dispatches. returnState=-1 sentinel marks "entry log" — A6.P2 analysis pairs each entry with subsequent [push-back] adjust-sphere lines and the eventual return state. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.Core/Physics/BSPQuery.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/AcDream.Core/Physics/BSPQuery.cs b/src/AcDream.Core/Physics/BSPQuery.cs index a6fb497..bdff8f4 100644 --- a/src/AcDream.Core/Physics/BSPQuery.cs +++ b/src/AcDream.Core/Physics/BSPQuery.cs @@ -1611,6 +1611,23 @@ public static class BSPQuery var movement = sphere0.Center - localCurrCenter; + // A6.P1: snapshot dispatcher entry for the [push-back-disp] probe. + // Emitted before path selection so the captured state reflects + // the inputs the dispatcher routes on. The returnState=-1 sentinel + // marks "entry log" — A6.P2 analysis pairs entry with the + // subsequent [push-back] adjust-sphere lines and inferred return. + if (PhysicsDiagnostics.ProbePushBackEnabled) + { + PhysicsDiagnostics.LogPushBackDispatch( + sphereCenter: sphere0.Center, + movement: movement, + collide: path.Collide, + insertType: (int)path.InsertType, + objState: unchecked((int)obj.State), + walkInterpEntry: path.WalkInterp, + returnState: -1); + } + // Helper: transform a local-space vector to world space. // ACE: path.LocalSpacePos.LocalToGlobalVec(v) Vector3 L2W(Vector3 v) => Vector3.Transform(v, localToWorld);