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
|
|
@ -141,10 +141,10 @@ public class LandblockLoaderTests
|
|||
var idsB = entitiesLbB.Select(e => e.Id).ToArray();
|
||||
Assert.Empty(idsA.Intersect(idsB));
|
||||
|
||||
// The namespace top byte is 0xC0 for stabs (distinct from 0x80 scenery,
|
||||
// 0x40 interior, low-range live entities).
|
||||
Assert.All(idsA, id => Assert.Equal(0xC0u, (id >> 24) & 0xFFu));
|
||||
Assert.All(idsB, id => Assert.Equal(0xC0u, (id >> 24) & 0xFFu));
|
||||
// The namespace top nibble is 0xC for stabs (distinct from 0x8
|
||||
// scenery, 0x4 interior, and low-range live entities).
|
||||
Assert.All(idsA, id => Assert.True(LandblockStaticEntityIdAllocator.IsInNamespace(id)));
|
||||
Assert.All(idsB, id => Assert.True(LandblockStaticEntityIdAllocator.IsInNamespace(id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -186,17 +186,34 @@ public class LandblockLoaderTests
|
|||
Assert.Equal(1u, entities[0].Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildEntitiesFromInfo_MoreThan255EntriesStayInTheOwningLandblockRange()
|
||||
{
|
||||
var info = new LandBlockInfo();
|
||||
for (uint i = 0; i < 300u; i++)
|
||||
info.Objects.Add(new Stab { Id = 0x01000001u, Frame = new Frame() });
|
||||
|
||||
IReadOnlyList<WorldEntity> entities =
|
||||
LandblockLoader.BuildEntitiesFromInfo(info, landblockId: 0xA9B40000u);
|
||||
|
||||
Assert.Equal(300, entities.Count);
|
||||
Assert.Equal(300, entities.Select(entity => entity.Id).Distinct().Count());
|
||||
Assert.All(entities, entity =>
|
||||
Assert.True(LandblockStaticEntityIdAllocator.IsInNamespace(entity.Id)));
|
||||
Assert.True(entities[^1].Id < LandblockStaticEntityIdAllocator.Base(0xA9u, 0xB5u));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildEntitiesFromInfo_NamespacedIdOverflowFailsBeforeCrossLandblockAlias()
|
||||
{
|
||||
var info = new LandBlockInfo();
|
||||
for (uint i = 0; i < 256u; i++)
|
||||
for (uint i = 0; i <= LandblockStaticEntityIdAllocator.MaxCounter + 1u; i++)
|
||||
info.Objects.Add(new Stab { Id = 0x01000001u, Frame = new Frame() });
|
||||
|
||||
InvalidDataException error = Assert.Throws<InvalidDataException>(
|
||||
() => LandblockLoader.BuildEntitiesFromInfo(info, landblockId: 0xA9B40000u));
|
||||
|
||||
Assert.Contains("255-entry", error.Message, StringComparison.Ordinal);
|
||||
Assert.Contains("4096-entry", error.Message, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue