fix #435 (part 1): delete 17 probes that outlived their closed investigations

Each of these was temporary apparatus added to chase one bug, and each was
supposed to be deleted in the commit that fixed it. Fourteen closed issues
later they were still here: #337's support/wire-mesh trio, #171's sticky
timeline, #119's viewer and entity dumps, #113's phantom probe, and a dozen
more. 3,493 lines removed; the client now reads 144 environment variables
instead of 161, and 47 temporary probes remain instead of 64.

This is not only tidying. Every probe leaves a branch on its hot path when
unset, several re-read the environment per call rather than caching, and
the volume buries the diagnostics that are actually load-bearing. It is
also a headless correctness matter: HeadlessStaticStateAudit reflects over
PhysicsDiagnostics' flags to refuse a multi-session host when any is set,
and cannot see probes that live outside that owner.

Four files went entirely — WalkMissDiagnostic.cs, CollisionMeshWireframe.cs
and two test files whose only subject was a deleted probe.
TransitionTypes.SetContactPlane also sheds its CallerMemberName /
CallerLineNumber parameters, which existed solely for #337's cpSrc=
attribution and carried the instruction to strip them with the probe
family; no call site passed them, so no behavior changes. F2's collision
overlay survives and reverts to its proxy-cylinder form, which is what
removing the ACDREAM_WIRE_MESH upgrade means.

LaunchOptionsDocumentationTests earned its keep here: it refused the
deletion until docs/launch-options.md moved the 17 rows into Retired and
the frozen direct-read counts came down (PhysicsEngine.cs to zero,
TransitionTypes.cs 3 to 2). The documentation could not drift during a
cleanup this wide.

The 14 probes that name no owning issue are deliberately NOT deleted.
Nothing records when they became safe to remove, and guessing is how a
future investigation loses apparatus it needed; #435 stays open for their
attribution.

Full hermetic suite 15,321 passed / 0 failed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-24 11:41:20 +02:00
parent 05bfe8d162
commit 0c5057c9ff
34 changed files with 57 additions and 3495 deletions

View file

@ -1,120 +0,0 @@
using System.Numerics;
using AcDream.Core.Physics;
using Xunit;
namespace AcDream.Core.Tests.Physics;
/// <summary>
/// #337 (2026-08-06 — TEMPORARY, delete with the <c>[support]</c> probe).
///
/// <para>
/// The <c>[support]</c> line's whole value is its <c>support=</c> verdict:
/// terrain, an object surface, or nothing. If that classifier is wrong, a
/// capture does not merely fail to answer — it answers CONFIDENTLY WRONG, and
/// this campaign has already spent two diagnoses on confident wrong answers.
/// These cover the decision boundaries directly, so the live capture can be
/// read at face value.
/// </para>
/// </summary>
public sealed class SupportProbeClassifierTests
{
private const float FlatNormalZ = 1f;
[Fact]
public void NoContactPlane_IsUnsupported()
{
Assert.Equal(
"none",
PhysicsDiagnostics.ClassifySupport(
contactPlaneValid: false,
terrainSampled: true,
contactPlaneZAtXY: 100f,
contactPlaneNormalZ: FlatNormalZ,
terrainZ: 100f,
terrainNormalZ: FlatNormalZ));
}
[Fact]
public void PlaneAtTerrainHeightAndTilt_IsTerrain()
{
Assert.Equal(
"terrain",
PhysicsDiagnostics.ClassifySupport(
contactPlaneValid: true,
terrainSampled: true,
contactPlaneZAtXY: 41.25f,
contactPlaneNormalZ: 0.94f,
terrainZ: 41.26f,
terrainNormalZ: 0.94f));
}
[Fact]
public void PlaneWellAboveTerrain_IsObject()
{
// The rock-plateau shape: the body rests six metres above the ground.
Assert.Equal(
"object",
PhysicsDiagnostics.ClassifySupport(
contactPlaneValid: true,
terrainSampled: true,
contactPlaneZAtXY: 47.5f,
contactPlaneNormalZ: FlatNormalZ,
terrainZ: 41.5f,
terrainNormalZ: 0.9f));
}
[Fact]
public void SameHeightDifferentTilt_IsReportedSeparately()
{
// A collision surface lying flat against sloped ground. This must NOT
// collapse into either answer: it is precisely the ambiguous case, and
// guessing between them is what the probe exists to avoid.
Assert.Equal(
"coplanar-tilt-mismatch",
PhysicsDiagnostics.ClassifySupport(
contactPlaneValid: true,
terrainSampled: true,
contactPlaneZAtXY: 41.5f,
contactPlaneNormalZ: 1.0f,
terrainZ: 41.5f,
terrainNormalZ: 0.72f));
}
[Fact]
public void NoTerrainUnderTheBody_SaysSoRatherThanGuessing()
{
Assert.Equal(
"no-terrain",
PhysicsDiagnostics.ClassifySupport(
contactPlaneValid: true,
terrainSampled: false,
contactPlaneZAtXY: 12f,
contactPlaneNormalZ: FlatNormalZ,
terrainZ: float.NaN,
terrainNormalZ: float.NaN));
}
[Fact]
public void PlaneHeightIsEvaluatedAtTheBodysOwnXy()
{
// A 45-degree ramp through the origin: height must track X, or a body
// standing on a slope would read as displaced from its own support.
var slope = new Plane(Vector3.Normalize(new Vector3(-1f, 0f, 1f)), 0f);
Assert.True(PhysicsDiagnostics.TryPlaneZAt(slope, 0f, 0f, out float atOrigin));
Assert.Equal(0f, atOrigin, 3);
Assert.True(PhysicsDiagnostics.TryPlaneZAt(slope, 10f, 0f, out float atTen));
Assert.Equal(10f, atTen, 3);
}
[Fact]
public void VerticalPlaneHasNoHeight()
{
// A wall is never a floor. Reporting a height for one would read as a
// wildly displaced surface and manufacture a false positive.
var wall = new Plane(new Vector3(1f, 0f, 0f), -5f);
Assert.False(PhysicsDiagnostics.TryPlaneZAt(wall, 0f, 0f, out _));
}
}

View file

@ -137,12 +137,8 @@ public sealed class TransitFailProbeTests
string log = sw.ToString();
// The probe's own families must be completely silent on a healthy
// moving tick. (Console.Out may still carry unrelated one-shot
// process diagnostics — e.g. the #338 AnnounceStepHeightProbeOnce
// self-report, which fires unconditionally on the first IsPlayer
// resolve in the process regardless of any flag — so this checks
// the probe's own tag rather than asserting total silence.)
// The probe's own family must be completely silent on a healthy
// moving tick.
Assert.DoesNotContain("[transit-fail", log);
float actualDy = result.Position.Y - 0.00f;

View file

@ -1,119 +0,0 @@
using AcDream.Core.Physics;
using DatReaderWriter.Enums;
using System.Collections.Generic;
using System.Numerics;
using Xunit;
namespace AcDream.Core.Tests.Physics;
/// <summary>
/// Tests for the ISSUES #83 H-disambiguation probe spike (spec
/// 2026-05-21-indoor-walk-miss-probe-design.md).
///
/// Covers:
/// 1. PhysicsDiagnostics.ProbeWalkMissEnabled flag get/set roundtrip.
/// 2. WalkMissDiagnostic.AggregateNearestWalkable selects the nearest
/// walkable polygon by |dz| when the foot XY lies inside a poly's
/// local XY bounding box.
/// 3. WalkMissDiagnostic.AggregateNearestWalkable falls back to the
/// nearest poly by |dz| when no walkable poly XY-contains the foot,
/// reporting ContainsFootXY=false.
/// </summary>
public class WalkMissDiagnosticTests
{
[Fact]
public void ProbeWalkMiss_StaticApi_Roundtrip()
{
bool initial = PhysicsDiagnostics.ProbeWalkMissEnabled;
try
{
PhysicsDiagnostics.ProbeWalkMissEnabled = true;
Assert.True(PhysicsDiagnostics.ProbeWalkMissEnabled);
PhysicsDiagnostics.ProbeWalkMissEnabled = false;
Assert.False(PhysicsDiagnostics.ProbeWalkMissEnabled);
}
finally
{
PhysicsDiagnostics.ProbeWalkMissEnabled = initial;
}
}
private static ResolvedPolygon MakeFloorPoly(
Vector3 v00, Vector3 v10, Vector3 v11, Vector3 v01)
{
var verts = new[] { v00, v10, v11, v01 };
var normal = Vector3.Normalize(Vector3.Cross(v10 - v00, v01 - v00));
float d = -Vector3.Dot(normal, v00);
return new ResolvedPolygon
{
Vertices = verts,
Plane = new System.Numerics.Plane(normal, d),
NumPoints = 4,
SidesType = CullMode.None,
};
}
/// <summary>
/// Foot at (0,0,1). Two walkable polys: a low one at Z=0 (foot is
/// 1 m above) and a high one at Z=0.8 (foot is 0.2 m above).
/// Aggregator picks the high one — smaller |dz|.
/// </summary>
[Fact]
public void AggregateNearestWalkable_PicksNearestByDz_WhenFootXYInsideMultiplePolys()
{
var lowFloor = MakeFloorPoly(
new Vector3(-5f, -5f, 0f),
new Vector3( 5f, -5f, 0f),
new Vector3( 5f, 5f, 0f),
new Vector3(-5f, 5f, 0f));
var highFloor = MakeFloorPoly(
new Vector3(-2f, -2f, 0.8f),
new Vector3( 2f, -2f, 0.8f),
new Vector3( 2f, 2f, 0.8f),
new Vector3(-2f, 2f, 0.8f));
var resolved = new Dictionary<ushort, ResolvedPolygon>
{
[1] = lowFloor,
[2] = highFloor,
};
var result = WalkMissDiagnostic.AggregateNearestWalkable(
resolved,
footLocal: new Vector3(0f, 0f, 1f),
floorZ: PhysicsGlobals.FloorZ);
Assert.True(result.Found);
Assert.Equal((ushort)2, result.PolyId);
Assert.True(result.ContainsFootXY);
Assert.Equal(0.2f, result.Dz, precision: 5);
Assert.Equal(1.0f, result.NormalZ, precision: 5);
}
/// <summary>
/// Foot at (10,10,1) — outside both poly XY bboxes. Aggregator
/// returns the poly with smallest |dz| but with ContainsFootXY=false.
/// </summary>
[Fact]
public void AggregateNearestWalkable_FallsBackByDz_WhenFootXYOutsideAllBboxes()
{
var poly = MakeFloorPoly(
new Vector3(-1f, -1f, 0.5f),
new Vector3( 1f, -1f, 0.5f),
new Vector3( 1f, 1f, 0.5f),
new Vector3(-1f, 1f, 0.5f));
var resolved = new Dictionary<ushort, ResolvedPolygon> { [42] = poly };
var result = WalkMissDiagnostic.AggregateNearestWalkable(
resolved,
footLocal: new Vector3(10f, 10f, 1f),
floorZ: PhysicsGlobals.FloorZ);
Assert.True(result.Found);
Assert.Equal((ushort)42, result.PolyId);
Assert.False(result.ContainsFootXY);
Assert.Equal(0.5f, result.Dz, precision: 5);
}
}