feat(render): Phase A8 — kill-switch ACDREAM_A8_INDOOR_BRANCH (default OFF)

After 5 visual-gate failures with speculative fixes that each addressed
plausible-looking symptoms without resolving the chaos (texture flicker,
missing walls, GPU 100%, ~10 FPS), this commit stops the speculation and
ships a kill-switch that reverts default behavior to pre-A8.

The user's verbatim authorization at session start said "no quickfixes
or fixes that might cause issues down the line ... no band-aids." The
post-Wave-5 fix stream WAS band-aids — each fix was pattern-matched
against possible RR7-era causes without confirming the actual root
cause from evidence. Five failures in a row is the signal to stop.

ACDREAM_A8_INDOOR_BRANCH gate:
- Unset or != "1" (DEFAULT): cameraInsideBuilding forced false. Outdoor
  Draw(All) path runs for indoor cells too. Pre-A8 depth-clear-if-inside
  workaround at line ~7314 is restored. Visual behavior = pre-A8.
- Set to "1": indoor branch (RenderInsideOutAcdream) runs. All A8 code
  exercises. Probes ([envcells]/[stencil]/[draworder]/[buildings]) emit.

All Phase A8 scaffolding (Waves 1-5 + post-Wave-5 fix commits) remains
in tree, accessible for the next-session apparatus to test against.
~1,830 LOC of WB-extracted infrastructure preserved.

Handoff doc at docs/research/2026-05-28-a8-wb-port-shipped-but-broken-handoff.md
captures the full chronicle: which fixes were applied, what each
visual-gate launch reported, the root-cause hypotheses tested and
falsified, the remaining unknowns, and the recommended apparatus
approaches (frame-replay harness / per-step GL state probe / WB-renderer
side-by-side / mesh-data audit).

Next session's mission: NO MORE LIVE LAUNCHES until apparatus is built.
This is the same trap the issue #98 saga fell into before the
trajectory-replay harness shipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-27 16:26:40 +02:00
parent 2bf5013c2f
commit 3d0ffaa794
2 changed files with 312 additions and 4 deletions

View file

@ -7107,8 +7107,20 @@ public sealed class GameWindow : IDisposable
// existing cameraInsideCell flag stays — it's still used by the sky /
// weather suppression code paths which gate on "any indoor cell" (including
// dungeon cells without BuildingId).
bool cameraInsideBuilding =
visibility?.CameraCell is not null
//
// KILL-SWITCH (2026-05-28 PM after 5 failed visual gates): the indoor
// branch (RenderInsideOutAcdream) is broken in ways speculative fixes
// haven't resolved (texture flicker + missing walls + GPU 100%).
// Default behavior reverts to pre-A8 outdoor Draw(All) path. Set
// ACDREAM_A8_INDOOR_BRANCH=1 to re-enable indoor branch for further
// investigation (probe data still emits in that mode).
// The depth-clear-if-inside workaround at line ~7314 is restored when
// the kill-switch is OFF, so pre-A8 visual behavior is preserved.
bool a8IndoorBranchEnabled = string.Equals(
Environment.GetEnvironmentVariable("ACDREAM_A8_INDOOR_BRANCH"), "1",
StringComparison.Ordinal);
bool cameraInsideBuilding = a8IndoorBranchEnabled
&& visibility?.CameraCell is not null
&& AcDream.App.Rendering.CellVisibility.PointInCell(camPos, visibility.CameraCell)
&& visibility.CameraCell.BuildingId is not null;
@ -7304,8 +7316,11 @@ public sealed class GameWindow : IDisposable
MaybeFlushTerrainDiag();
// Phase A8 (2026-05-28): the pre-A8 "depth clear when inside" workaround
// is deleted. RenderInsideOutAcdream below handles indoor visibility via
// stencil-gated portals instead.
// is deleted when the indoor branch is enabled. When the indoor branch
// is OFF (default kill-switch state), restore the pre-A8 workaround so
// indoor visuals match pre-A8 behavior.
if (!a8IndoorBranchEnabled && cameraInsideCell)
_gl!.Clear(ClearBufferMask.DepthBufferBit);
// L-fix1 (2026-04-28): pass the set of animated-entity ids so
// the renderer keeps remote players / NPCs / monsters