fix(rendering): reconcile shadow roots from live runtime
Recover ordinary live roots from LiveEntityRuntime's canonical active spatial workset instead of relying on already-retained derived records. Keep attached children callback-authoritative, cache immutable selection geometry fingerprints, and pin zero-allocation retained update paths with regression tests. Release gate: 3,733 App tests / 3 skips; 8,217 complete-solution tests / 5 skips. Co-Authored-By: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
056bbd4efd
commit
91463db551
7 changed files with 272 additions and 15 deletions
|
|
@ -244,6 +244,48 @@ public sealed class LiveRenderProjectionJournalTests
|
|||
Assert.Same(record, harness.Runtime.Records.Single());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SynchronizeActiveSources_RecoversCurrentRootFromCanonicalWorkset()
|
||||
{
|
||||
Harness harness = CreateHarness(loadLandblock: true);
|
||||
LiveEntityRecord record = Materialize(harness, Guid, instance: 8);
|
||||
Assert.True(harness.Projections.OnEntityReady(
|
||||
LiveEntityReadyCandidate.Capture(record)));
|
||||
harness.Journal.DrainTo(harness.Scene);
|
||||
harness.Projections.ResetTracking();
|
||||
|
||||
harness.Projections.SynchronizeActiveSources();
|
||||
|
||||
RenderProjectionDelta recovered =
|
||||
Assert.Single(harness.Journal.Pending.ToArray());
|
||||
Assert.Equal(RenderProjectionDeltaKind.Register, recovered.Kind);
|
||||
Assert.Equal(
|
||||
RenderProjectionClass.LiveDynamicRoot,
|
||||
recovered.Record.ProjectionClass);
|
||||
Assert.Equal(record.LocalEntityId, recovered.Record.Source.LocalEntityId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SynchronizeActiveSources_DoesNotResurrectRemovedAttachment()
|
||||
{
|
||||
Harness harness = CreateHarness(loadLandblock: true);
|
||||
LiveEntityRecord record = Materialize(
|
||||
harness,
|
||||
Guid,
|
||||
instance: 9,
|
||||
projectionKind: LiveEntityProjectionKind.Attached);
|
||||
Assert.True(harness.Projections.OnEntityReady(
|
||||
LiveEntityReadyCandidate.Capture(record)));
|
||||
harness.Journal.DrainTo(harness.Scene);
|
||||
harness.Projections.OnProjectionRemoved(record.WorldEntity!.Id);
|
||||
harness.Journal.DrainTo(harness.Scene);
|
||||
|
||||
harness.Projections.SynchronizeActiveSources();
|
||||
|
||||
Assert.Equal(0, harness.Journal.Count);
|
||||
Assert.Equal(0, harness.Projections.ProjectionCount);
|
||||
}
|
||||
|
||||
private static Harness CreateHarness(bool loadLandblock)
|
||||
{
|
||||
var state = new GpuWorldState();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue