Separate logical ownership, render publication, and GPU retirement across live entities, landblocks, particles, textures, mesh arenas, portal/UI teardown, and per-frame scratch storage. Add bounded DAT/texture caches, upload budgets, three-frame fence retirement, exact-incarnation appearance reconciliation, frame pacing, and extensive lifetime conformance coverage.\n\nThe seven-destination connected route now cuts peak working/private memory roughly in half, returns Caul to 125-153 FPS locally, and produces no WER or AMD reset.\n\nCo-authored-by: OpenAI Codex <codex@openai.com>
57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
using AcDream.App.World;
|
|
|
|
namespace AcDream.App.Tests.World;
|
|
|
|
public sealed class LiveEntityTeardownPlanTests
|
|
{
|
|
[Fact]
|
|
public void AdvanceRetriesOnlyFailedSteps()
|
|
{
|
|
int first = 0;
|
|
int middle = 0;
|
|
int last = 0;
|
|
var plan = new LiveEntityTeardownPlan(
|
|
[
|
|
() => first++,
|
|
() =>
|
|
{
|
|
middle++;
|
|
if (middle == 1)
|
|
throw new InvalidOperationException("middle failed");
|
|
},
|
|
() => last++,
|
|
]);
|
|
|
|
Assert.Throws<AggregateException>(() => plan.Advance());
|
|
Assert.Equal(2, plan.CompletedCount);
|
|
|
|
plan.Advance();
|
|
|
|
Assert.True(plan.IsComplete);
|
|
Assert.Equal(1, first);
|
|
Assert.Equal(2, middle);
|
|
Assert.Equal(1, last);
|
|
}
|
|
|
|
[Fact]
|
|
public void AdvanceAttemptsEveryIndependentFailureInOnePass()
|
|
{
|
|
int first = 0;
|
|
int last = 0;
|
|
var plan = new LiveEntityTeardownPlan(
|
|
[
|
|
() =>
|
|
{
|
|
first++;
|
|
throw new InvalidOperationException("first");
|
|
},
|
|
() => last++,
|
|
]);
|
|
|
|
Assert.Throws<AggregateException>(() => plan.Advance());
|
|
|
|
Assert.Equal(1, first);
|
|
Assert.Equal(1, last);
|
|
Assert.Equal(1, plan.CompletedCount);
|
|
}
|
|
}
|