From 84c4a7029696639d05006f1f84e4485654f1143a Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 27 May 2026 10:07:10 +0200 Subject: [PATCH] =?UTF-8?q?diag(render):=20Phase=20A8=20[vis]=20probe=20?= =?UTF-8?q?=E2=80=94=20light=20up=20dormant=20ProbeVisibilityEnabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires the dormant RenderingDiagnostics.ProbeVisibilityEnabled flag (added 2026-05-25 by Task 6 of the original A8 plan, no probe code) to per-frame [vis] log lines around the render-frame branch decision. Captures camera position, cameraInsideCell (lenient grace-aware), the strict PointInCell result, the visibility CameraCell id, and VisibleCellIds count/list. Enable via ACDREAM_PROBE_VIS=1. Used during A8 RR0 falsification spike (2026-05-26) — see docs/research/2026-05-26-a8-rr0-falsification-findings.md. Kept as long- term diagnostic for the upcoming RR8/RR10 visual verification gates. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index e132c65..32540b4 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -7011,6 +7011,44 @@ public sealed class GameWindow : IDisposable var visibility = _cellVisibility.ComputeVisibility(camPos); bool cameraInsideCell = visibility?.CameraCell is not null; + // SPIKE 2026-05-26: A8 transition investigation. Lights up the + // dormant RenderingDiagnostics.ProbeVisibilityEnabled flag (added + // by Task 6 of the original A8 plan). Per-frame state captures: + // camera position, lenient + strict inside flags side-by-side, + // CameraCell id, VisibleCellIds list. Branch markers inside + // indoor + outdoor branches complete the trace. + // Enable via ACDREAM_PROBE_VIS=1. + if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeVisibilityEnabled) + { + bool reallyInsideProbe = visibility?.CameraCell is not null + && CellVisibility.PointInCell(camPos, visibility.CameraCell); + int visCount = visibility?.VisibleCellIds?.Count ?? 0; + string visList; + if (visibility?.VisibleCellIds is null || visCount == 0) + { + visList = "[]"; + } + else + { + var sb = new System.Text.StringBuilder("["); + int shown = 0; + foreach (var id in visibility.VisibleCellIds) + { + if (shown >= 8) { sb.Append(",..."); break; } + if (shown > 0) sb.Append(','); + sb.Append($"0x{id:X8}"); + shown++; + } + sb.Append(']'); + visList = sb.ToString(); + } + string cellId = visibility?.CameraCell?.CellId.ToString("X8") ?? "null"; + Console.WriteLine( + $"[vis] pos=({camPos.X:F2},{camPos.Y:F2},{camPos.Z:F2}) " + + $"inside={cameraInsideCell} really={reallyInsideProbe} " + + $"cell=0x{cellId} visN={visCount} {visList}"); + } + // Lighting decisions (sun zeroed, indoor ambient applied) must // track the PLAYER's cell, not the camera's. In third-person // chase mode the camera enters interiors before the player body @@ -7174,6 +7212,8 @@ public sealed class GameWindow : IDisposable if (cameraReallyInside && _indoorStencilPipeline is not null && visibility?.CameraCell is not null) { + if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeVisibilityEnabled) + Console.WriteLine("[vis] branch=indoor"); // Phase A8 R3 — WB RenderInsideOut order. // // 1. Terrain has already drawn (color + depth) at line ~7104. @@ -7233,6 +7273,8 @@ public sealed class GameWindow : IDisposable } else { + if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeVisibilityEnabled) + Console.WriteLine("[vis] branch=outdoor"); // Outdoor path — unchanged from pre-A8: single dispatcher call // walks every entity with default EntitySet.All partition. _wbDrawDispatcher!.Draw(camera, _worldState.LandblockEntries, frustum,