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>
46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using AcDream.Core.World;
|
|
|
|
namespace AcDream.Core.Tests.World;
|
|
|
|
public sealed class LandblockStaticEntityIdAllocatorTests
|
|
{
|
|
[Fact]
|
|
public void Base_PreservesFullCoordinatesAndStabNamespace()
|
|
{
|
|
var bases = new HashSet<uint>();
|
|
for (uint y = 0; y <= 255; y++)
|
|
for (uint x = 0; x <= 255; x++)
|
|
{
|
|
uint value = LandblockStaticEntityIdAllocator.Base(x, y);
|
|
Assert.True(LandblockStaticEntityIdAllocator.IsInNamespace(value));
|
|
Assert.True(bases.Add(value), $"duplicate base for ({x},{y})");
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void MaximumCounterDoesNotAliasAdjacentLandblock()
|
|
{
|
|
for (uint y = 0; y < 255; y++)
|
|
{
|
|
uint current = LandblockStaticEntityIdAllocator.Base(0, y);
|
|
uint next = LandblockStaticEntityIdAllocator.Base(0, y + 1);
|
|
Assert.True(current + LandblockStaticEntityIdAllocator.MaxCounter < next);
|
|
}
|
|
}
|
|
|
|
[Fact]
|
|
public void Allocate_AcceptsLastCounterThenFailsBeforeNamespaceWrap()
|
|
{
|
|
uint counter = LandblockStaticEntityIdAllocator.MaxCounter;
|
|
|
|
uint last = LandblockStaticEntityIdAllocator.Allocate(0xA9u, 0xB4u, ref counter);
|
|
|
|
Assert.Equal(
|
|
LandblockStaticEntityIdAllocator.Base(0xA9u, 0xB4u)
|
|
+ LandblockStaticEntityIdAllocator.MaxCounter,
|
|
last);
|
|
InvalidDataException error = Assert.Throws<InvalidDataException>(
|
|
() => LandblockStaticEntityIdAllocator.Allocate(0xA9u, 0xB4u, ref counter));
|
|
Assert.Contains("4096-entry", error.Message, StringComparison.Ordinal);
|
|
}
|
|
}
|