fix(rendering): bound portal resource lifetime
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>
This commit is contained in:
parent
3971997689
commit
749e8ceeb1
225 changed files with 29107 additions and 3914 deletions
63
tests/AcDream.App.Tests/Rendering/FramePacingPolicyTests.cs
Normal file
63
tests/AcDream.App.Tests/Rendering/FramePacingPolicyTests.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using AcDream.App.Rendering;
|
||||
|
||||
namespace AcDream.App.Tests.Rendering;
|
||||
|
||||
public sealed class FramePacingPolicyTests
|
||||
{
|
||||
[Fact]
|
||||
public void VSync_request_uses_driver_swap_without_software_limit()
|
||||
{
|
||||
var policy = FramePacingPolicy.Resolve(
|
||||
requestedVSync: true,
|
||||
uncappedRendering: false,
|
||||
monitorRefreshHz: 144);
|
||||
|
||||
Assert.True(policy.UseVSync);
|
||||
Assert.Null(policy.SoftwareLimitHz);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(60)]
|
||||
[InlineData(120)]
|
||||
[InlineData(144)]
|
||||
public void Normal_VSync_off_uses_active_monitor_refresh_limit(int refreshHz)
|
||||
{
|
||||
var policy = FramePacingPolicy.Resolve(
|
||||
requestedVSync: false,
|
||||
uncappedRendering: false,
|
||||
monitorRefreshHz: refreshHz);
|
||||
|
||||
Assert.False(policy.UseVSync);
|
||||
Assert.Equal((double)refreshHz, policy.SoftwareLimitHz);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData(0)]
|
||||
[InlineData(-1)]
|
||||
public void Missing_or_invalid_monitor_refresh_uses_safe_fallback(int? refreshHz)
|
||||
{
|
||||
var policy = FramePacingPolicy.Resolve(
|
||||
requestedVSync: false,
|
||||
uncappedRendering: false,
|
||||
monitorRefreshHz: refreshHz);
|
||||
|
||||
Assert.False(policy.UseVSync);
|
||||
Assert.Equal(FramePacingPolicy.FallbackRefreshHz, policy.SoftwareLimitHz);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(false)]
|
||||
[InlineData(true)]
|
||||
public void Explicit_uncapped_diagnostic_disables_both_pacing_mechanisms(
|
||||
bool requestedVSync)
|
||||
{
|
||||
var policy = FramePacingPolicy.Resolve(
|
||||
requestedVSync,
|
||||
uncappedRendering: true,
|
||||
monitorRefreshHz: 144);
|
||||
|
||||
Assert.False(policy.UseVSync);
|
||||
Assert.Null(policy.SoftwareLimitHz);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue