diff --git a/src/AcDream.Core/Rendering/RenderingDiagnostics.cs b/src/AcDream.Core/Rendering/RenderingDiagnostics.cs index 03621062..33ad9c97 100644 --- a/src/AcDream.Core/Rendering/RenderingDiagnostics.cs +++ b/src/AcDream.Core/Rendering/RenderingDiagnostics.cs @@ -143,6 +143,17 @@ public static class RenderingDiagnostics public static bool ProbePvInputEnabled { get; set; } = Environment.GetEnvironmentVariable("ACDREAM_PROBE_PVINPUT") == "1"; + /// + /// Bounded-propagation port apparatus (2026-06-08). When true, PortalVisibilityBuilder.Build emits + /// one [portal-churn] summary line per call: per-cell pop count (re-pops = churn), total re-enqueues, + /// max pop count, and — per re-enqueue — the reciprocal-clip pre→post region count + grew flag. Pins + /// whether the flap's churn is redundant reciprocal back-contributions producing non-empty drifted + /// slivers (the hypothesis) vs another source. Throwaway apparatus — strip once the bound ships. + /// Initial state from ACDREAM_PROBE_PORTAL_CHURN=1. + /// + public static bool ProbePortalChurnEnabled { get; set; } = + Environment.GetEnvironmentVariable("ACDREAM_PROBE_PORTAL_CHURN") == "1"; + // Cell-change gate for EmitVis. The probe fires once per distinct root cell // so launch.log stays readable under motion (the per-frame call is a no-op // when the root is unchanged). Sentinel 0 = "no root yet" — the first real diff --git a/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsTests.cs b/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsTests.cs index fc6e0708..86ff7ac8 100644 --- a/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsTests.cs +++ b/tests/AcDream.Core.Tests/Rendering/RenderingDiagnosticsTests.cs @@ -132,4 +132,11 @@ public sealed class RenderingDiagnosticsTests // playerCellId == 0 (unresolved) → treat as outside (safe default: outdoor render). Assert.False(RenderingDiagnostics.ShouldRenderIndoor(playerCellId: 0u, renderRootResolved: true)); } + + [Fact] + public void ProbePortalChurn_DefaultsFalse_WhenEnvUnset() + { + // Env var is absent in the test host, so the flag must default false (inert probe). + Assert.False(AcDream.Core.Rendering.RenderingDiagnostics.ProbePortalChurnEnabled); + } }