From 3e641339e9d52ebdb8bae2380a661f4656707e4f Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 14 Jun 2026 14:27:45 +0200 Subject: [PATCH] chore(G.3): strip the #133 temp diagnostics Remove the throwaway probes added to diagnose the dungeon FPS/grey issues now that they're fixed: the ACDREAM_LOG_FPS headless line + [cellreg] registration line (GameWindow), and the [pv-trace] 0x0007 gate-widen + raw-NDC bbox addition to the flap probe (PortalVisibilityBuilder, reverted to the pre-#133 form). The permanent Phase-U.4c [flap]/[pv-trace] probes (ACDREAM_PROBE_FLAP) are kept as-is. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 25 ------------------- .../Rendering/PortalVisibilityBuilder.cs | 25 +------------------ 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index 3eb7d8aa..e45101dc 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -61,7 +61,6 @@ public sealed class GameWindow : IDisposable // though the title-bar FPS is only updated every 0.5s. private double _lastFps = 60.0; private double _lastFrameMs = 16.7; - private string _lastCellRegSig = ""; // TEMP #133 ramp-flood-collapse [cellreg] dedup // Phase I.2: per-frame counters surfaced through the ImGui DebugPanel // VM closures. Computed once per render pass alongside the frustum @@ -7701,25 +7700,6 @@ public sealed class GameWindow : IDisposable playerCellId: playerRoot?.CellId ?? 0u, lights: Lighting); - // TEMP (#133 ramp-flood-collapse): cell-registration completeness for the - // player's dungeon landblock. If the ramp neighbour (0x....014D in 0x0007) - // is absent from _cellVisibility, the portal flood can't admit it (lookup-miss - // at PortalVisibilityBuilder.cs:369) and the grey clear shows through. Logs only - // when the count or ramp-presence changes (dedup) — pairs with [pv-trace] skip=. - if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeFlapEnabled && playerRoot is not null) - { - uint plb = playerRoot.CellId >> 16; - int reg = _cellVisibility.GetCellsForLandblock(plb).Count; - uint rampId = (plb << 16) | 0x014Du; - bool hasRamp = _cellVisibility.TryGetCell(rampId, out _); - string sig = plb.ToString("X4") + ":" + reg + ":" + hasRamp; - if (sig != _lastCellRegSig) - { - _lastCellRegSig = sig; - Console.WriteLine($"[cellreg] lb=0x{plb:X4} registered={reg} hasRamp0x{rampId:X8}={hasRamp} playerCell=0x{playerRoot.CellId:X8}"); - } - } - // Never cull the landblock the player is currently on. uint? playerLb = null; if (_playerMode && _playerController is not null) @@ -8494,11 +8474,6 @@ public sealed class GameWindow : IDisposable } _lastFps = fps; _lastFrameMs = avgFrameTime; - // TEMP (A7 FPS measurement, strip after): headless FPS/frame-time so the - // launch log can be correlated against the [WB-DIAG] draw stats. - if (Environment.GetEnvironmentVariable("ACDREAM_LOG_FPS") == "1") - Console.WriteLine( - $"[FPS] {fps:F1} fps | {avgFrameTime:F2} ms | lb {visibleLandblocks}/{totalLandblocks} | ent {entityCount} anim {animatedCount}"); _perfAccum = 0; _perfFrameCount = 0; } diff --git a/src/AcDream.App/Rendering/PortalVisibilityBuilder.cs b/src/AcDream.App/Rendering/PortalVisibilityBuilder.cs index d31ea93d..38f263b8 100644 --- a/src/AcDream.App/Rendering/PortalVisibilityBuilder.cs +++ b/src/AcDream.App/Rendering/PortalVisibilityBuilder.cs @@ -759,13 +759,7 @@ public static class PortalVisibilityBuilder private static bool IsHoltburgIndoorProbeCell(uint cellId) { - uint lb = cellId & 0xFFFF0000u; - // TEMP (#133 ramp-flood-collapse diagnosis): widen the [pv-trace] gate to the - // 0x0007 Town Network dungeon so the per-portal skip= reason (lookup-miss / - // clip-empty / reciprocal-empty / side) is emitted for the ramp neighbour. - if (lb == 0x00070000u) - return true; - if (lb != 0xA9B40000u) + if ((cellId & 0xFFFF0000u) != 0xA9B40000u) return false; uint low = cellId & 0xFFFFu; return low >= 0x016F && low <= 0x0175; @@ -827,7 +821,6 @@ public static class PortalVisibilityBuilder // genuinely off-screen; the ndc coords (post-clip, bounded) show where on screen it lands. int projN = -1, clipN = -1; string ndcText = ""; - string rawText = ""; if (i < cameraCell.PortalPolygons.Count) { var poly = cameraCell.PortalPolygons[i]; @@ -837,21 +830,6 @@ public static class PortalVisibilityBuilder projN = clip.Length; if (clip.Length >= 3) { - // Raw projected-NDC bbox (pre-screen-clip): WHERE the portal lands on screen, - // even when ClipToRegion drops it to empty. A clip=0 portal whose raw bbox is - // inside [-1,1] is on-screen-but-wrongly-dropped (the bug); a bbox outside - // [-1,1] is genuinely off-screen (correct). Distinguishes the two. - float rminX = float.MaxValue, rminY = float.MaxValue, rmaxX = -float.MaxValue, rmaxY = -float.MaxValue; - foreach (var cv in clip) - { - if (cv.W <= 1e-6f) continue; - float nx = cv.X / cv.W, ny = cv.Y / cv.W; - rminX = MathF.Min(rminX, nx); rmaxX = MathF.Max(rmaxX, nx); - rminY = MathF.Min(rminY, ny); rmaxY = MathF.Max(rmaxY, ny); - } - if (rminX <= rmaxX) - rawText = FormattableString.Invariant($" raw=[{rminX:F1},{rminY:F1}..{rmaxX:F1},{rmaxY:F1}]"); - var ndc = PortalProjection.ClipToRegion(clip, FullScreenQuad); clipN = ndc.Length; var ns = new System.Text.StringBuilder(48); @@ -864,7 +842,6 @@ public static class PortalVisibilityBuilder sb.Append(" D=").Append(float.IsNaN(d) ? "na" : d.ToString("F2")); sb.Append(side ? " TRV" : " CULL"); sb.Append(" proj=").Append(projN).Append(" clip=").Append(clipN); - if (rawText.Length > 0) sb.Append(rawText); if (ndcText.Length > 0) sb.Append(" ndc=").Append(ndcText); } sb.Append(" || outPolys=").Append(frame.OutsideView.Polygons.Count);