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
|
|
@ -290,6 +290,45 @@ public sealed class ArchRenderSceneTests
|
|||
Assert.Equal(current.Bounds, stored.Bounds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TransformUpdateBatch_ReusesRetainedStorage()
|
||||
{
|
||||
const int count = 1_000;
|
||||
RenderSceneGeneration generation = Generation(11);
|
||||
using var scene = new ArchRenderScene(generation);
|
||||
var registrations = new RenderProjectionDelta[count];
|
||||
var updates = new RenderProjectionDelta[count];
|
||||
for (int index = 0; index < count; index++)
|
||||
{
|
||||
RenderProjectionRecord record = Record(
|
||||
(ulong)index + 1,
|
||||
1,
|
||||
RenderProjectionClass.ActiveAnimatedStatic,
|
||||
x: index);
|
||||
registrations[index] = RenderProjectionDelta.Register(
|
||||
generation,
|
||||
(ulong)index + 1,
|
||||
record);
|
||||
updates[index] = RenderProjectionDelta.Update(
|
||||
RenderProjectionDeltaKind.UpdateTransform,
|
||||
generation,
|
||||
(ulong)count + (ulong)index + 1,
|
||||
record with
|
||||
{
|
||||
Transform = new RenderTransform(
|
||||
Matrix4x4.CreateTranslation(index + 1, 0, 0)),
|
||||
});
|
||||
}
|
||||
|
||||
scene.Apply(registrations);
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
|
||||
scene.Apply(updates);
|
||||
|
||||
long allocated = GC.GetAllocatedBytesForCurrentThread() - before;
|
||||
Assert.True(allocated == 0, $"Allocated {allocated:N0} bytes.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Digest_IsStableAcrossRegistrationOrderAndBufferReuse()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue