Revert "Campaign V slice V4a" - it lost world multisampling
This reverts ceec3bc4. Two independent reasons, either sufficient.
The rendering regression. The slice deleted TextRenderGlStateScope, which
saved GL_MULTISAMPLE and GL_SAMPLE_ALPHA_TO_COVERAGE on entry, disabled them
for the text pass, and restored them on exit (TextRenderGlStateScope.cs:111-112
and 153-154 at the parent commit). Its replacement bakes that state into the
text pipeline but nothing restores it, and GlGpuPassEncoder.Dispose does not
either. Every world renderer is still raw GL at this point in the campaign, so
from the first UI frame onward the world drew with multisampling disabled.
The offline pixel gate caught it: 1,791 of 563,200 compared pixels differed,
0.318% against a 0.001 threshold. The commit message attributed this to
wall-clock-driven ambient animation shifting phase, and committed through the
failure. That explanation does not survive its own control: capturing twice at
the reverted-to commit differs by 19 pixels and twice at the slice's own commit
by 8, while base-versus-head differs by 1,791 - a 224x gap that no shared-noise
source explains. An amplified difference image settles it visually: the changed
pixels are the silhouette edges of every tree, building and rock, with terrain
interiors, water and the entire UI untouched. That is the signature of losing
edge antialiasing, not of animated sprites.
This is the exact failure mode two existing memory notes already warn about -
a mid-frame renderer must set every GL state it uses rather than inherit it,
and issue #52's lesson that a rendering migration must audit per-pass GL state
before declaring itself done.
The scope. The brief was three small leaf renderers plus additive frame-
lifecycle wiring, roughly ten files. The commit changed 334 files with 3,665
insertions and 3,845 deletions, including 323 public-to-internal visibility
conversions across the App assembly, 55 test files, two retired conformance
tests, and a self-described temporary escape hatch for bridging raw-GL viewport
textures. Even without the regression, that is not separable into the part
worth keeping and the part worth dropping.
Reverting rather than patching because the good work here - the RHI frame
lifecycle wiring and a genuine render-state-cache staleness fix - is small
enough to redo cleanly against a tightened spec, while untangling it from 300+
files of unrelated churn is not.
Post-revert: Release build clean, App suite back to 3,843 passed / 3 skipped,
offline pixel gate passing at 19 differing pixels.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
ceec3bc440
commit
9aaf97e785
334 changed files with 3841 additions and 3661 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
|
@ -56,7 +56,7 @@ internal sealed record GpuLandblockSpatialPublication(
|
|||
/// Threading: not thread-safe. All calls must happen on the render thread.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
||||
public sealed class GpuWorldState : ILiveEntitySpatialQuery
|
||||
{
|
||||
private readonly LandblockSpawnAdapter? _wbSpawnAdapter;
|
||||
private readonly EntityScriptActivator? _entityScriptActivator;
|
||||
|
|
@ -194,7 +194,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
&& IsLiveEntityProjectionResident(key);
|
||||
|
||||
/// <summary>
|
||||
/// Try to grab the loaded record for a landblock — useful for callers
|
||||
/// Try to grab the loaded record for a landblock — useful for callers
|
||||
/// that need to enumerate entities before the landblock is dropped
|
||||
/// (e.g. unregistering dynamic lights on a RemoveLandblock).
|
||||
/// </summary>
|
||||
|
|
@ -1053,7 +1053,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Mark a server-GUID as persistent — this entity survives landblock unloads
|
||||
/// Mark a server-GUID as persistent — this entity survives landblock unloads
|
||||
/// and gets re-parked as pending for its current canonical landblock.
|
||||
/// </summary>
|
||||
public void MarkPersistent(uint serverGuid)
|
||||
|
|
@ -1093,7 +1093,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
|
||||
uint canonical = (newCanonicalLb & 0xFFFF0000u) | 0xFFFFu;
|
||||
|
||||
// Fast path: already drawn in the correct loaded bucket → nothing to do
|
||||
// Fast path: already drawn in the correct loaded bucket → nothing to do
|
||||
// (avoids per-frame list churn for a settled, stationary entity).
|
||||
bool hasCurrent = _projectionLocations.TryGetValue(
|
||||
entity,
|
||||
|
|
@ -1110,17 +1110,17 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
return;
|
||||
}
|
||||
|
||||
// Remove the entity from wherever it currently lives — a loaded bucket
|
||||
// OR a pending bucket — then re-append to its current landblock.
|
||||
// Remove the entity from wherever it currently lives — a loaded bucket
|
||||
// OR a pending bucket — then re-append to its current landblock.
|
||||
//
|
||||
// The projection-location index is the 2026-07-03 fix for the cold-spawn /
|
||||
// run-out "invisible player" bug: a persistent (server-spawned) entity
|
||||
// that spawned into a not-yet-loaded landblock sits in _pendingByLandblock,
|
||||
// and the old code scanned ONLY _loaded — so it silently no-op'd and left
|
||||
// and the old code scanned ONLY _loaded — so it silently no-op'd and left
|
||||
// the player stranded, hidden, even after its landblock finished loading
|
||||
// (the AddLandblock pending-drain had already run empty before the churn
|
||||
// re-parked the player, and the player is excluded from the server-object
|
||||
// re-hydrate — so RebucketLiveEntity was the ONLY path that could recover it,
|
||||
// re-hydrate — so RebucketLiveEntity was the ONLY path that could recover it,
|
||||
// and it couldn't reach a pending entity). The index now reaches either
|
||||
// residency class in O(1). Re-appending routes the entity
|
||||
// to _loaded (drawn) when its landblock is loaded, or back to pending to
|
||||
|
|
@ -1274,8 +1274,8 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
// landblock often hasn't streamed in yet, so the player lands in
|
||||
// _pendingByLandblock. If that same landblock is then unloaded (a
|
||||
// streaming churn / re-teleport before it finishes loading), the
|
||||
// pending entry was silently dropped here — violating the
|
||||
// "persistent ⇒ survives unload" contract and making the avatar
|
||||
// pending entry was silently dropped here — violating the
|
||||
// "persistent ⇒ survives unload" contract and making the avatar
|
||||
// vanish after a couple round-trips. Rescue them so DrainRescued
|
||||
// re-parks them at the next valid landblock.
|
||||
if (_pendingByLandblock.TryGetValue(canonical, out var pendingForLb))
|
||||
|
|
@ -1580,7 +1580,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
/// world withdrawal, or logical teardown. It owns no renderer/script
|
||||
/// lifecycle and is safe for a still-live incarnation.
|
||||
///
|
||||
/// Safe to call with a server guid that's not currently present — no-op.
|
||||
/// Safe to call with a server guid that's not currently present — no-op.
|
||||
/// </summary>
|
||||
public void RemoveLiveEntityProjection(uint serverGuid)
|
||||
{
|
||||
|
|
@ -1707,7 +1707,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
|
||||
if (_loaded.ContainsKey(canonicalLandblockId))
|
||||
{
|
||||
// Hot path — append directly to the render-thread-owned mutable
|
||||
// Hot path — append directly to the render-thread-owned mutable
|
||||
// resident bucket and flat view.
|
||||
AddLoadedProjection(canonicalLandblockId, entity, key);
|
||||
if (probePersistent)
|
||||
|
|
@ -1715,7 +1715,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
return;
|
||||
}
|
||||
|
||||
// Cold path — landblock not yet loaded. Park the entity in the
|
||||
// Cold path — landblock not yet loaded. Park the entity in the
|
||||
// pending bucket; AddLandblock will pick it up when the streamer
|
||||
// delivers the matching landblock.
|
||||
if (!_pendingByLandblock.TryGetValue(canonicalLandblockId, out var bucket))
|
||||
|
|
@ -1737,8 +1737,8 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
|
||||
/// <summary>
|
||||
/// Drop all entities from a landblock without removing the terrain. Used
|
||||
/// by two-tier streaming when a landblock crosses Near→Far hysteresis.
|
||||
/// Per Phase A.5 spec §4.4.
|
||||
/// by two-tier streaming when a landblock crosses Near→Far hysteresis.
|
||||
/// Per Phase A.5 spec §4.4.
|
||||
///
|
||||
/// <para>
|
||||
/// Only dat-static entity layers demote. Live server projections retain
|
||||
|
|
@ -1798,7 +1798,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
// for this landblock BEFORE we drop the entity list. The cache stores
|
||||
// canonical landblock ids (the dispatcher's _walkScratch carries
|
||||
// entry.LandblockId from GpuWorldState.LandblockEntries, whose keys are
|
||||
// canonicalized). Null when the cache isn't wired (tests). Per spec §5.3 W3b.
|
||||
// canonicalized). Null when the cache isn't wired (tests). Per spec §5.3 W3b.
|
||||
|
||||
// C.1.5b: stop DefaultScript for each dat-hydrated entity about to
|
||||
// be dropped. Demote-tier entities are always atlas-tier (ServerGuid==0
|
||||
|
|
@ -1852,14 +1852,14 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
|
||||
/// <summary>
|
||||
/// Merge entities into an existing-loaded landblock. Used by two-tier
|
||||
/// streaming for the Far→Near promotion case (terrain already loaded;
|
||||
/// streaming for the Far→Near promotion case (terrain already loaded;
|
||||
/// entity layer streaming in). Falls back to the pending bucket if the
|
||||
/// landblock isn't loaded yet (handles the rare "promote arrives before
|
||||
/// far load completes" race).
|
||||
/// Per Phase A.5 spec §4.4.
|
||||
/// Per Phase A.5 spec §4.4.
|
||||
///
|
||||
/// <para>
|
||||
/// <b>Landblock id is canonicalized</b> (low 16 bits forced to 0xFFFF) —
|
||||
/// <b>Landblock id is canonicalized</b> (low 16 bits forced to 0xFFFF) —
|
||||
/// callers may pass cell-resolved ids and they will key correctly.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
|
|
@ -1913,7 +1913,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
if (!parkIfMissing)
|
||||
return null;
|
||||
|
||||
// Park as pending — same pattern as live projections for not-yet-loaded LBs.
|
||||
// Park as pending — same pattern as live projections for not-yet-loaded LBs.
|
||||
if (!_pendingByLandblock.TryGetValue(canonical, out var bucket))
|
||||
{
|
||||
bucket = new List<WorldEntity>();
|
||||
|
|
@ -2023,7 +2023,7 @@ internal sealed class GpuWorldState : ILiveEntitySpatialQuery
|
|||
private readonly HashSet<uint> _persistentInFlatProbe = new();
|
||||
|
||||
// TEMP (#138-B): log when a persistent (player) entity enters/leaves the
|
||||
// drawn flat view. Transition-gated → low volume (fires at teleport
|
||||
// drawn flat view. Transition-gated → low volume (fires at teleport
|
||||
// boundaries, not every rebuild). Strip with EntityVanishProbe.
|
||||
private void ProbeFlatViewTransitions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue