refactor(render): remove Campaign FW probes
This commit is contained in:
parent
b8befded8b
commit
4808d4d10b
10 changed files with 1 additions and 241 deletions
|
|
@ -268,13 +268,6 @@ public sealed unsafe partial class ParticleRenderer : IDisposable
|
|||
return;
|
||||
|
||||
bool defers = renderPass == ParticleRenderPass.Scene && _alphaQueue?.IsCollecting == true;
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[walk-part] finish pass={renderPass} n={_submissionScratch.Count} "
|
||||
+ $"branch={(defers ? "defer" : "immediate")} "
|
||||
+ $"phase={AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase}");
|
||||
}
|
||||
if (defers)
|
||||
DeferToRetailAlphaQueue(camera);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -146,12 +146,6 @@ internal sealed class RetailAlphaQueue : IWorldSceneAlphaFrame
|
|||
{
|
||||
if (!IsCollecting)
|
||||
throw new InvalidOperationException("Retail alpha flush requires an active frame.");
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled && _submissions.Count > 0)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[walk-alpha] flush n={_submissions.Count} "
|
||||
+ $"phase={AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase}");
|
||||
}
|
||||
|
||||
Exception? drawFailure = null;
|
||||
List<Exception>? resetFailures = null;
|
||||
|
|
|
|||
|
|
@ -159,8 +159,6 @@ internal sealed partial class RetailPViewPassExecutor
|
|||
int count = Math.Min(vertices.Length, world.Length);
|
||||
for (int vertex = 0; vertex < count; vertex++)
|
||||
world[vertex] = vertices[vertex];
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
WalkLookInPunchCountThisFrame++;
|
||||
_portalDepthMask.DrawDepthFan(
|
||||
world[..count],
|
||||
frame.ViewProjection,
|
||||
|
|
|
|||
|
|
@ -109,10 +109,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
private readonly TerrainDrawDiagnosticsController _terrainDiagnostics;
|
||||
private readonly RetailPViewParticleClassifications _particleClassifications = new();
|
||||
private readonly HashSet<uint> _noSceneParticleEntityIds = [];
|
||||
// ACDREAM_PROBE_WALK_ROOT / cathedral FW4: observation-only counter for
|
||||
// the walk-owned far-Z portal punches.
|
||||
internal int WalkLookInPunchCountThisFrame { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Borrowed until the next late landscape pass. The outdoor-root post-world
|
||||
/// particle pass consumes this synchronously before another PView frame.
|
||||
|
|
@ -155,11 +151,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
public void BeginFrame()
|
||||
{
|
||||
_particleClassifications.BeginFrame();
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
{
|
||||
AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase = "pre";
|
||||
WalkLookInPunchCountThisFrame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Campaign FW3.2b-2: the shared dispatcher, for
|
||||
|
|
@ -331,7 +322,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
DisableClipDistances();
|
||||
|
||||
_particleClassifications.ReplaceOutdoor(context.ParticleOwnerIds);
|
||||
ProbeWalkParticleRoute("static-owners", _particleClassifications.Outdoor);
|
||||
if (_particleClassifications.Outdoor.Count > 0
|
||||
&& _particles is not null
|
||||
&& _particleRenderer is not null)
|
||||
|
|
@ -350,8 +340,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
|
||||
public void ClearInteriorDepth()
|
||||
{
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase = "post";
|
||||
_surface.ClearInteriorDepth();
|
||||
}
|
||||
|
||||
|
|
@ -376,8 +364,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
// hardware clip slot made effects vanish by view direction (zero
|
||||
// outside slices in view = zero submissions) — invented behavior.
|
||||
DisableClipDistances();
|
||||
ProbeWalkParticleRoute(
|
||||
outdoorCells ? "unattached-outdoor" : "unattached-interior", null);
|
||||
_particleRenderer.DrawForOwners(
|
||||
frame.Camera,
|
||||
frame.CameraWorldPosition,
|
||||
|
|
@ -390,53 +376,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
: UnattachedEmitterCellScope.InteriorCells);
|
||||
}
|
||||
|
||||
/// <summary>ACDREAM_PROBE_WALK_ROOT companion (throwaway, dies with the
|
||||
/// cathedral falls investigation): logs each particle submission route
|
||||
/// with its owner count + the pre/post-depth-clear phase tag.</summary>
|
||||
private static void ProbeWalkParticleRoute(string route, IReadOnlySet<uint>? owners)
|
||||
{
|
||||
if (!AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
return;
|
||||
string ids = "";
|
||||
if (owners is not null)
|
||||
{
|
||||
var sb = new System.Text.StringBuilder();
|
||||
int shown = 0;
|
||||
foreach (uint id in owners)
|
||||
{
|
||||
if (shown++ == 6) { sb.Append(",…"); break; }
|
||||
if (sb.Length > 0) sb.Append(',');
|
||||
sb.Append(id.ToString("x"));
|
||||
}
|
||||
ids = $" n={owners.Count} ids=[{sb}]";
|
||||
|
||||
// Phase I cathedral instrumentation: the REAL falls owners
|
||||
// (outdoor landblock statics 0xCF418000-13 per the DAT-geometry
|
||||
// report) — print EVERY submission that carries one, with the
|
||||
// exact watched ids, unconditionally (never rate-limited; these
|
||||
// are the money lines the six fix rounds never had).
|
||||
System.Text.StringBuilder? falls = null;
|
||||
foreach (uint id in owners)
|
||||
{
|
||||
if (id >= 0xCF418000u && id <= 0xCF418014u)
|
||||
{
|
||||
falls ??= new System.Text.StringBuilder();
|
||||
if (falls.Length > 0) falls.Append(',');
|
||||
falls.Append(id.ToString("x"));
|
||||
}
|
||||
}
|
||||
if (falls is not null)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[falls] route={route} phase="
|
||||
+ $"{AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase} "
|
||||
+ $"ids=[{falls}]");
|
||||
}
|
||||
}
|
||||
Console.WriteLine(
|
||||
$"[walk-part] {route}{ids} phase={AcDream.Core.Rendering.RenderingDiagnostics.WalkRootPhase}");
|
||||
}
|
||||
|
||||
public void FlushLandscapeAlpha() => _alpha.Flush();
|
||||
|
||||
public void DrawCellParticles(
|
||||
|
|
@ -457,7 +396,6 @@ internal sealed partial class RetailPViewPassExecutor :
|
|||
return;
|
||||
|
||||
DisableClipDistances();
|
||||
ProbeWalkParticleRoute("cell-owners", visible);
|
||||
// Retail never clips cell particles to a portal view: the owner
|
||||
// cell's walls own occlusion via the depth test at the alpha flush.
|
||||
_particleRenderer.DrawForOwners(
|
||||
|
|
|
|||
|
|
@ -53,13 +53,6 @@ internal sealed class RetailPViewRenderer
|
|||
private RetailPViewFrameInput? _activeWalkFrame;
|
||||
private ClipFrameAssembly? _activeWalkClipAssembly;
|
||||
|
||||
// ACDREAM_PROBE_WALK_ROOT (FW3 visual-gate apparatus, throwaway): the
|
||||
// previous frame's root kind + a post-flip frame countdown so each
|
||||
// interior/outdoor transition dumps 8 frames of rooting facts.
|
||||
private bool? _probeWalkRootPrevOutdoor;
|
||||
private int _probeWalkRootFramesLeft;
|
||||
private ulong _probeWalkRootFrame;
|
||||
|
||||
// Campaign FW3.2b-2: the walk's production world-data registries
|
||||
// (published/retired by LandblockRenderPublisher) plus the per-frame
|
||||
// driver state. Null until the composition passes them; the static
|
||||
|
|
@ -256,11 +249,6 @@ internal sealed class RetailPViewRenderer
|
|||
}
|
||||
walkDriver = _walkFrameDriverScratch;
|
||||
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
{
|
||||
AcDream.Core.Rendering.RenderingDiagnostics.WalkPortalProbeThisFrame =
|
||||
_probeWalkRootFrame % 90 == 0;
|
||||
}
|
||||
try
|
||||
{
|
||||
walkDriver.Collect(
|
||||
|
|
@ -272,8 +260,6 @@ internal sealed class RetailPViewRenderer
|
|||
ClearWalkFrameBindings();
|
||||
throw;
|
||||
}
|
||||
AcDream.Core.Rendering.RenderingDiagnostics.WalkPortalProbeThisFrame = false;
|
||||
|
||||
// FW4 slice 1: an interior root's terrain/sky/punch clip slices
|
||||
// come from THE WALK'S OWN outside_view — retail's one
|
||||
// visibility structure. See ClipFrameAssembler.
|
||||
|
|
@ -296,57 +282,6 @@ internal sealed class RetailPViewRenderer
|
|||
_drawableCellsScratch.UnionWith(walkDriver.VisitedCells);
|
||||
walkDriver.CopyVisibleCellsTo(_visibleCellsScratch);
|
||||
|
||||
// Phase I cathedral instrumentation (synthesis §Phase I.3): the
|
||||
// continuous rooting line SEPARATES the true root flood
|
||||
// (InteriorFloodCells) from the visited union (root + look-ins —
|
||||
// the conflation the review corpus indicted), and adds the
|
||||
// walk's OWN exit-view count. [walk-cam] dumps a replayable
|
||||
// camera every ~300 frames and at every root flip.
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled)
|
||||
{
|
||||
_probeWalkRootFrame++;
|
||||
bool outdoorNow = ctx.RootCell.IsOutdoorNode;
|
||||
bool flipped = _probeWalkRootPrevOutdoor is bool prev && prev != outdoorNow;
|
||||
if (flipped)
|
||||
{
|
||||
_probeWalkRootFramesLeft = 8;
|
||||
Console.WriteLine(
|
||||
$"[walk-root] ---- FLIP {(outdoorNow ? "IN->OUT" : "OUT->IN")} at frame {_probeWalkRootFrame} ----");
|
||||
}
|
||||
_probeWalkRootPrevOutdoor = outdoorNow;
|
||||
bool sample = _probeWalkRootFramesLeft > 0 || _probeWalkRootFrame % 30 == 0;
|
||||
if (_probeWalkRootFramesLeft > 0)
|
||||
_probeWalkRootFramesLeft--;
|
||||
if (sample)
|
||||
{
|
||||
List<uint> rootFlood = walkDriver.InteriorFloodCells;
|
||||
string flood = string.Join(",", rootFlood
|
||||
.GetRange(0, Math.Min(rootFlood.Count, 8))
|
||||
.ConvertAll(c => c.ToString("x8")));
|
||||
int walkOv = outdoorNow ? -1 : _frameWalk.InteriorOutsideView.ViewCount;
|
||||
Vector3 fwd = walkContext.CyPlane.Normal;
|
||||
Console.WriteLine(
|
||||
$"[walk-root] f={_probeWalkRootFrame} out={(outdoorNow ? 1 : 0)} "
|
||||
+ $"viewer=0x{ctx.ViewerCellId:X8} root=0x{ctx.RootCell.CellId:X8} "
|
||||
+ $"res={ctx.CameraCellResolution} slices={clipAssembly.OutsideViewSlices.Length} "
|
||||
+ $"walkOv={walkOv} rootFlood={rootFlood.Count}[{flood}] "
|
||||
+ $"visited={walkDriver.VisitedCells.Count} bld={walkDriver.VisitedBuildings.Count} "
|
||||
+ $"eye=({ctx.ViewerEyePos.X:F2},{ctx.ViewerEyePos.Y:F2},{ctx.ViewerEyePos.Z:F2}) "
|
||||
+ $"fwd=({fwd.X:F3},{fwd.Y:F3},{fwd.Z:F3})");
|
||||
}
|
||||
if (flipped || _probeWalkRootFrame % 300 == 0)
|
||||
{
|
||||
Matrix4x4 vp = ctx.ViewProjection;
|
||||
Console.WriteLine(
|
||||
$"[walk-cam] viewer=0x{ctx.ViewerCellId:X8} "
|
||||
+ $"eye=({ctx.ViewerEyePos.X:R},{ctx.ViewerEyePos.Y:R},{ctx.ViewerEyePos.Z:R}) "
|
||||
+ $"vw={viewportWidth:R} vh={viewportHeight:R} vp=["
|
||||
+ $"{vp.M11:R},{vp.M12:R},{vp.M13:R},{vp.M14:R},"
|
||||
+ $"{vp.M21:R},{vp.M22:R},{vp.M23:R},{vp.M24:R},"
|
||||
+ $"{vp.M31:R},{vp.M32:R},{vp.M33:R},{vp.M34:R},"
|
||||
+ $"{vp.M41:R},{vp.M42:R},{vp.M43:R},{vp.M44:R}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FW4 slice 1: the ONE clip-region publication, after any walk
|
||||
|
|
@ -593,8 +528,7 @@ internal sealed class RetailPViewRenderer
|
|||
/// #456 cathedral seam band (its never-drawn panel family), leaving
|
||||
/// aperture depth unsealed after the interior clear; the end-of-frame
|
||||
/// alpha drain (cell-owned emitters — retail's own timing) then
|
||||
/// z-passes across the whole opening (the falls shine-through,
|
||||
/// probe-pinned via ACDREAM_PROBE_WALK_ROOT's phase tags). Per-cell
|
||||
/// z-passes across the whole opening (the falls shine-through). Per-cell
|
||||
/// slice clips still come from the old assembly where present; a cell
|
||||
/// the old apparatus missed seals unclipped (the depth fan is the exact
|
||||
/// dat aperture polygon and z-tests, so over-coverage is benign).</summary>
|
||||
|
|
|
|||
|
|
@ -166,23 +166,6 @@ public sealed class ViewconeCuller
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <summary>ACDREAM_PROBE_WALK_ROOT companion (throwaway): a cell's
|
||||
/// lifted-plane shape for the [dyn-route] admission trace — "none"
|
||||
/// (culls), or per-slice plane counts ("0" = a pass-all zero-plane
|
||||
/// slice, the scissor-fallback trapdoor).</summary>
|
||||
internal string ProbeDescribeCell(uint cellId)
|
||||
{
|
||||
if (!_cellPlanes.TryGetValue(cellId, out PlaneSet? set))
|
||||
return "none";
|
||||
var sb = new System.Text.StringBuilder();
|
||||
for (int s = 0; s < set.Slices.Count; s++)
|
||||
{
|
||||
if (sb.Length > 0) sb.Append('+');
|
||||
sb.Append(set.Slices[s].Count);
|
||||
}
|
||||
return sb.Length == 0 ? "empty" : sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>Sphere-vs-the-cell's-views: visible when any slice passes.
|
||||
/// A cell with no views culls (not in the draw list ⇒ never reached in
|
||||
/// retail). A zero-plane slice is pass-all.</summary>
|
||||
|
|
|
|||
|
|
@ -119,14 +119,6 @@ public sealed class WalkPView
|
|||
flags.InView = true; // portal polygon faces the viewer
|
||||
}
|
||||
}
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.WalkPortalProbeThisFrame)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[walk-portal] init cell={cell.CellId:x8} i={i} "
|
||||
+ $"dest={cell.Portals[i].OtherCellId:x8} d={d:F3} "
|
||||
+ $"pside={cell.Portals[i].PortalSide} "
|
||||
+ $"inview={(flags.InView ? 1 : 0)}");
|
||||
}
|
||||
}
|
||||
|
||||
if (flags.InView)
|
||||
|
|
@ -209,12 +201,6 @@ public sealed class WalkPView
|
|||
cell, portal.PortalSide,
|
||||
cell.PortalPolygons[portal.PolygonIndex],
|
||||
doClip: true, ctx, _clipScratch);
|
||||
if (AcDream.Core.Rendering.RenderingDiagnostics.WalkPortalProbeThisFrame)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[walk-portal] clip cell={cell.CellId:x8} view={i} j={j} "
|
||||
+ $"dest={portal.OtherCellId:x8} n={n}");
|
||||
}
|
||||
if (n == 0) continue;
|
||||
|
||||
if (portal.OtherCellId == 0xFFFFFFFFu)
|
||||
|
|
|
|||
|
|
@ -160,43 +160,6 @@ public static class RenderingDiagnostics
|
|||
public static bool ProbeClipRouteEnabled { get; set; } =
|
||||
Environment.GetEnvironmentVariable("ACDREAM_PROBE_CLIPROUTE") == "1";
|
||||
|
||||
/// <summary>
|
||||
/// Campaign FW3.2b-2 flip apparatus (2026-08-30): when true and the walk
|
||||
/// registries are wired, RetailPViewRenderer runs the PRODUCTION retail
|
||||
/// frame walk per frame in SHADOW (no draws change) and emits one
|
||||
/// [walk-shadow] line per frame whose cell/building sets diverge from the
|
||||
/// old visibility path — the I5 dual-shadow pattern applied to the FW3
|
||||
/// static cutover. Throwaway apparatus — dies with the flip commit.
|
||||
/// </summary>
|
||||
public static bool ProbeWalkShadowEnabled { get; set; } =
|
||||
Environment.GetEnvironmentVariable("ACDREAM_PROBE_WALK_SHADOW") == "1";
|
||||
|
||||
/// <summary>
|
||||
/// FW3 visual-gate apparatus (2026-08-30, throwaway — dies with the
|
||||
/// stairwell-transition fix): when true, RetailPViewRenderer prints one
|
||||
/// <c>[walk-root]</c> line per frame for the 8 frames after every
|
||||
/// interior/outdoor ROOT flip — viewer cell, resolution, slice count,
|
||||
/// and the walk's visited cell list — pinning which frames draw grass
|
||||
/// over floor openings during a doorway crossing and why.
|
||||
/// </summary>
|
||||
public static bool ProbeWalkRootEnabled { get; set; } =
|
||||
Environment.GetEnvironmentVariable("ACDREAM_PROBE_WALK_ROOT") == "1";
|
||||
|
||||
/// <summary>Companion scratch for <see cref="ProbeWalkRootEnabled"/>
|
||||
/// (throwaway, same investigation): the frame phase relative to the
|
||||
/// interior depth clear ("pre"/"post"), stamped by the pass executor so
|
||||
/// particle/alpha probe lines can tag WHEN a submission or drain ran.
|
||||
/// Written only while the probe is on.</summary>
|
||||
public static string WalkRootPhase = "";
|
||||
|
||||
/// <summary>Companion scratch for <see cref="ProbeWalkRootEnabled"/>
|
||||
/// (throwaway, same investigation): true on the frames (~every 90th)
|
||||
/// where the walk's PView logs its per-portal seen/in-view/clip
|
||||
/// decisions as <c>[walk-portal]</c> lines — pins WHY an exit view
|
||||
/// collapses at a given camera pose. Set by the renderer before
|
||||
/// Collect; read by WalkPView.</summary>
|
||||
public static bool WalkPortalProbeThisFrame;
|
||||
|
||||
/// <summary>
|
||||
/// 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,
|
||||
|
|
|
|||
|
|
@ -321,9 +321,6 @@ public sealed class ParticleSystem : IParticleSystem
|
|||
rangeMultiplier = 1f;
|
||||
|
||||
LastRetailViewEmitterVisitCount = 0;
|
||||
_probeAdmissionDumpThisCall =
|
||||
AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled
|
||||
&& ++_probeAdmissionCallCounter % 120 == 0;
|
||||
foreach (int handle in _worldSimulationHandles)
|
||||
{
|
||||
if (!_byHandle.TryGetValue(handle, out ParticleEmitter? emitter))
|
||||
|
|
@ -349,33 +346,9 @@ public sealed class ParticleSystem : IParticleSystem
|
|||
|| float.IsNaN(maxDistance)
|
||||
|| distance <= maxDistance);
|
||||
RefreshRenderableIndex(emitter, wasRenderable);
|
||||
|
||||
// ACDREAM_PROBE_WALK_ROOT companion (Phase I cathedral
|
||||
// instrumentation, throwaway): admission verdicts for the F418
|
||||
// watch set — the real falls owners 0xCF418000-13 and every
|
||||
// F418-cell emitter — every ~120th ApplyRetailView pass.
|
||||
if (_probeAdmissionDumpThisCall
|
||||
&& AcDream.Core.Rendering.RenderingDiagnostics.ProbeWalkRootEnabled
|
||||
&& ((emitter.AttachedObjectId >= 0xCF418000u
|
||||
&& emitter.AttachedObjectId <= 0xCF418014u)
|
||||
|| (emitter.OwnerCellId >> 16) == 0xF418u))
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[falls-adm] owner={emitter.AttachedObjectId:x} "
|
||||
+ $"cell={emitter.OwnerCellId:x8} "
|
||||
+ $"pos=({emitter.OwnerPosition.X:F1},{emitter.OwnerPosition.Y:F1},{emitter.OwnerPosition.Z:F1}) "
|
||||
+ $"dist={distance:F1} max={maxDistance:F1} "
|
||||
+ $"inSet={(visibleCellIds.Contains(emitter.OwnerCellId) ? 1 : 0)} "
|
||||
+ $"eligible={(emitter.ViewEligible ? 1 : 0)} "
|
||||
+ $"active={emitter.ActiveCount} pass={emitter.RenderPass}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Phase I instrumentation rate limiter (see the probe block above).
|
||||
private static uint _probeAdmissionCallCounter;
|
||||
private static bool _probeAdmissionDumpThisCall;
|
||||
|
||||
/// <summary>
|
||||
/// Changes only render presentation. Logical lifetime is unaffected.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue