diag(phys): A6.P5 [cellset-build] probe — log BuildCellSetAndPickContaining output

One [cellset-build] line per call when ACDREAM_PROBE_CELLSET=1: seed cell,
sphere world XY, candidate count, full candidate id list. Used to prove
the cellSet for the player's start cell doesn't include the door's outdoor
cell across the over-penetration tick.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-25 12:40:58 +02:00
parent 2dc4cfd3e6
commit 7910d51e7a
2 changed files with 34 additions and 0 deletions

View file

@ -494,6 +494,11 @@ public static class CellTransit
}
}
if (PhysicsDiagnostics.ProbeCellSetEnabled)
{
PhysicsDiagnostics.LogCellSetBuild(currentCellId, worldSphereCenter, candidates);
}
// Containment test: for each candidate, transform worldSphereCenter to
// local and test PointInsideCellBsp.
foreach (uint candId in candidates)

View file

@ -69,6 +69,35 @@ public static class PhysicsDiagnostics
public static bool ProbeBuildingEnabled { get; set; } =
Environment.GetEnvironmentVariable("ACDREAM_PROBE_BUILDING") == "1";
/// <summary>
/// A6.P5 (2026-05-25) — dump the cellSet that
/// <c>BuildCellSetAndPickContaining</c> produces. One line per call:
/// seed cell, sphere world XY, candidate count, and the full candidate
/// list (hex). Pair with <c>[bsp-test]</c> / <c>[resolve]</c> to see
/// whether the door's outdoor cell is reachable from the player's
/// current indoor cell via the portal-walk.
/// </summary>
public static bool ProbeCellSetEnabled { get; set; }
= Environment.GetEnvironmentVariable("ACDREAM_PROBE_CELLSET") == "1";
public static void LogCellSetBuild(
uint seedCellId,
System.Numerics.Vector3 sphereCenter,
System.Collections.Generic.IReadOnlyCollection<uint> cellSet)
{
if (!ProbeCellSetEnabled) return;
var ids = new System.Text.StringBuilder();
bool first = true;
foreach (uint id in cellSet)
{
if (!first) ids.Append(',');
ids.Append(System.FormattableString.Invariant($"0x{id:X8}"));
first = false;
}
Console.WriteLine(System.FormattableString.Invariant(
$"[cellset-build] seed=0x{seedCellId:X8} sphere=({sphereCenter.X:F3},{sphereCenter.Y:F3},{sphereCenter.Z:F3}) count={cellSet.Count} ids={ids}"));
}
/// <summary>
/// L.2d slice 1 (2026-05-13). Diagnostic side-channel: the
/// <see cref="ResolvedPolygon"/> that <see cref="BSPQuery"/>