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:
Erik 2026-07-18 21:35:16 +02:00
parent 3971997689
commit 749e8ceeb1
225 changed files with 29107 additions and 3914 deletions

View file

@ -154,6 +154,31 @@ public sealed class EntityEffectPoseRegistryTests
Assert.Equal(0xA9B4000Bu, cellId);
}
[Fact]
public void ChangeNotifications_SuppressEquivalentStaticPublishes()
{
var poses = new EntityEffectPoseRegistry();
WorldEntity entity = Entity(13u, new Vector3(1, 2, 3));
var changed = new List<uint>();
poses.EffectPoseChanged += changed.Add;
Matrix4x4 part = Matrix4x4.CreateTranslation(0, 0, 1);
poses.Publish(entity, new[] { part });
poses.Publish(entity, new[] { part });
Assert.True(poses.UpdateRoot(entity));
Assert.Equal(new[] { 13u }, changed);
entity.SetPosition(new Vector3(4, 5, 6));
Assert.True(poses.UpdateRoot(entity));
Assert.Equal(new[] { 13u, 13u }, changed);
poses.Publish(entity, new[] { Matrix4x4.CreateTranslation(0, 0, 2) });
Assert.Equal(new[] { 13u, 13u, 13u }, changed);
Assert.True(poses.Remove(entity.Id));
Assert.Equal(new[] { 13u, 13u, 13u, 13u }, changed);
}
private static WorldEntity Entity(uint id, Vector3 position) => new()
{
Id = id,