feat(rendering): journal static scene projections

Append exact static and EnvCell-shell projection deltas only at committed spatial activation and detach receipts. Same-landblock rehydrate now reconciles retained, new, and omitted presentation identities without constructing or drawing the shadow scene in production.

Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
Erik 2026-07-24 21:57:33 +02:00
parent dbd8318417
commit 5d19c56d15
10 changed files with 997 additions and 10 deletions

View file

@ -1,6 +1,7 @@
using System.Collections.Immutable;
using System.Numerics;
using AcDream.App.Rendering;
using AcDream.App.Rendering.Scene;
using AcDream.App.Rendering.Wb;
using AcDream.App.Streaming;
using AcDream.App.World;
@ -989,6 +990,40 @@ public sealed class LandblockPresentationPipelineTests
Assert.Equal(2, meshes.PinAttempts);
}
[Fact]
public void StaticRenderProjection_ReconcilesOnlyAfterSuccessfulSpatialActivation()
{
const uint landblockId = 0x6363FFFFu;
var meshes = new FailFirstPreparedPinAdapter();
var state = new GpuWorldState(new LandblockSpawnAdapter(meshes));
var journal = new RenderProjectionJournal(
RenderSceneGeneration.FromRaw(1));
var statics = new StaticRenderProjectionJournal(journal);
LandblockBuild build = BuildWithShell(landblockId, Entity(32));
var result = new LandblockStreamResult.Loaded(
landblockId,
LandblockStreamTier.Near,
build,
EmptyMesh());
var pipeline = new LandblockPresentationPipeline(
static (_, _) => { },
state,
staticProjectionSink: statics);
Assert.Throws<InvalidOperationException>(
() => pipeline.PublishLoaded(result));
Assert.Equal(0, journal.Count);
Assert.Equal(0, statics.ProjectionCount);
pipeline.PublishLoaded(result);
Assert.Equal(2, journal.Count);
Assert.Equal(2, statics.ProjectionCount);
Assert.Equal(2, meshes.PinAttempts);
pipeline.PublishLoaded(result);
Assert.Equal(2, journal.Count);
}
[Fact]
public void PriorityFailure_PreservesFailingResultAndUntouchedDrainedSuffix()
{