Address Aetheria SoA publications by generation

This commit is contained in:
Meta Vens 2026-07-13 20:03:53 +01:00
commit 9698e0cff3
6 changed files with 55 additions and 27 deletions

View file

@ -979,17 +979,38 @@ static async Task ProveDirectSoaPublicationPipeline()
if (cache.Get<EveEntitySoaViewDocument>(AetheriaRuntimeVerseRecordKeys.EveEntitySoaViewLatest) != null)
throw new InvalidOperationException("Building a CultMesh body publication made the Eve view visible before commit.");
frame.FrameId++;
var next = await publisher.PublishAsync(publisher.BuildCurrentZoneEntities(frame));
if (published.Body.RecordKey.Equals(next.Body.RecordKey))
throw new InvalidOperationException("Distinct SoA generations collided on one CultMesh body publication key.");
await cache.UpsertAsync(
published.Body,
new CultRecordHandle<CultMeshBodyPublicationDocument>(published.Body.RecordKey));
await cache.UpsertAsync(
next.Body,
new CultRecordHandle<CultMeshBodyPublicationDocument>(next.Body.RecordKey));
await cache.UpsertAsync(
next.Body,
new CultRecordHandle<CultMeshBodyPublicationDocument>(
CultMeshBodyPublicationDocument.CreateLatestRecordKey(next.Body.BodyId)));
if (cache.Get<EveEntitySoaViewDocument>(AetheriaRuntimeVerseRecordKeys.EveEntitySoaViewLatest) != null)
throw new InvalidOperationException("Publishing the body record alone made the Eve view visible.");
await cache.UpsertAsync(
published.View,
new CultRecordHandle<EveEntitySoaViewDocument>(AetheriaRuntimeVerseRecordKeys.EveEntitySoaViewLatest));
var body = cache.Get<CultMeshBodyPublicationDocument>(published.Body.RecordKey)
var bodyHandle = new CultMeshBodyPublicationHandle(
published.View.Buffers[0].BufferId,
published.View.ProducerEpoch,
published.View.Sequence);
var body = cache.Get<CultMeshBodyPublicationDocument>(bodyHandle.RecordKey)
?? throw new InvalidOperationException("Typed CultMesh body publication did not roundtrip through CultCache.");
bodyHandle.Validate(body);
var latest = cache.Get<CultMeshBodyPublicationDocument>(
CultMeshBodyPublicationDocument.CreateLatestRecordKey(body.BodyId));
if (latest == null || latest.Sequence != next.Body.Sequence || body.Sequence == latest.Sequence)
throw new InvalidOperationException("The view generation was substituted by the latest CultMesh body publication.");
var view = cache.Get<EveEntitySoaViewDocument>(AetheriaRuntimeVerseRecordKeys.EveEntitySoaViewLatest)
?? throw new InvalidOperationException("Typed Eve SoA view did not become visible after body publication.");
if (body.PreferredLocal.TransportKind != CultMeshBodyTransportKind.SharedMemory ||

View file

@ -686,9 +686,8 @@ static void RequireGameplaySourcePurity(string root)
static void RequireSharedEvePackagesImportedFromEveRepo(string root)
{
var manifestPath = Path.Combine(root, "Packages", "manifest.json");
var lockPath = Path.Combine(root, "Packages", "packages-lock.json");
var unityGeneratedProjectPath = Path.Combine(root, "GameCult.Aetheria.State.Unity.csproj");
var manifestPath = Path.Combine(root, "Aetheria.Unity", "Packages", "manifest.json");
var lockPath = Path.Combine(root, "Aetheria.Unity", "Packages", "packages-lock.json");
var unityAsmdefPath = Path.Combine(
root,
"Packages",
@ -758,9 +757,6 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
var packageLock = File.Exists(lockPath)
? File.ReadAllText(lockPath)
: throw new InvalidOperationException("Cannot verify shared Eve package ownership; packages-lock.json is missing.");
var unityGeneratedProject = File.Exists(unityGeneratedProjectPath)
? File.ReadAllText(unityGeneratedProjectPath)
: throw new InvalidOperationException("Cannot verify shared Eve package ownership; GameCult.Aetheria.State.Unity.csproj is missing.");
var unityAsmdef = File.Exists(unityAsmdefPath)
? File.ReadAllText(unityAsmdefPath)
: throw new InvalidOperationException("Cannot verify shared Eve package ownership; GameCult.Aetheria.State.Unity.asmdef is missing.");
@ -794,8 +790,9 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
var requiredManifestSymbols = new[]
{
"\"org.gamecult.eve.surface\": \"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.1.0\"",
"\"org.gamecult.eve.unity-uitoolkit\": \"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-uitoolkit#eveunity-uitoolkit-v0.1.0\""
"\"org.gamecult.cultlib\": \"https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.9\"",
"\"org.gamecult.eve.surface\": \"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0\"",
"\"org.gamecult.eve.unity-scene\": \"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.1\""
};
var missingManifestSymbols = requiredManifestSymbols
@ -811,8 +808,9 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
var requiredLockSymbols = new[]
{
"eveunity-surface-v0.1.0",
"eveunity-uitoolkit-v0.1.0",
"cultlib-unity-v1.0.9",
"eveunity-surface-v0.2.0",
"eveunity-scene-v0.2.1",
"\"source\": \"git\""
};
@ -839,9 +837,7 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
"The neighboring EveUnity repo is missing the shared Unity package roots Aetheria imports.");
}
if (!unityGeneratedProject.Contains("<Reference Include=\"GameCult.Eve.Surface\">", StringComparison.Ordinal) ||
!unityGeneratedProject.Contains("GameCult.Eve.Surface.dll", StringComparison.Ordinal) ||
!unityAsmdef.Contains("\"GameCult.Eve.Surface\"", StringComparison.Ordinal))
if (!unityAsmdef.Contains("\"GameCult.Eve.Surface\"", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Aetheria.State.Unity no longer references the shared Eve surface package assembly.");
@ -11668,7 +11664,8 @@ static void RequireDaemonVersePublication(string root)
"BuildCurrentZoneEntities(",
"new CultMeshFrameBodyPublisher(",
"new CultMeshNetworkBodyPublisher(",
"CultMeshBodyPublicationValidator.Validate(publication, BodyId)",
"new CultMeshBodyPublicationHandle(BodyId, publication.ProducerEpoch, publication.Sequence)",
".Validate(publication)",
"view.Buffers[0].BufferId, publication.BodyId",
"view.Columns.Any(column => !string.Equals(column.BufferId, publication.BodyId",
"ObserverWritable = false",
@ -11727,6 +11724,15 @@ static void RequireDaemonVersePublication(string root)
{
throw new InvalidOperationException("CultMesh body publication must precede the Eve entity SoA layout record.");
}
if (!smoke.Contains("new CultMeshBodyPublicationHandle(", StringComparison.Ordinal) ||
!smoke.Contains("published.View.ProducerEpoch", StringComparison.Ordinal) ||
!smoke.Contains("published.View.Sequence", StringComparison.Ordinal) ||
!smoke.Contains("CreateLatestRecordKey", StringComparison.Ordinal) ||
!smoke.Contains("bodyHandle.Validate(body)", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"The Aetheria pipeline smoke must prove view N resolves its generation record while latest points at N+1.");
}
if (File.Exists(legacyProviderAdvertisementPath))
{
throw new InvalidOperationException(

View file

@ -6,9 +6,9 @@
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.render-pipelines.universal": "17.4.0",
"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.8",
"org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.9",
"org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.1.1",
"org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0",
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.0"
"org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.1"
}
}

View file

@ -119,11 +119,11 @@
}
},
"org.gamecult.cultlib": {
"version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.8",
"version": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.9",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "b73e04e01173ff0fc753727c0dc9e2eff2ce10c7"
"hash": "b1fcd95c255cd3057894678ff7d2dba28c5eb29e"
},
"org.gamecult.eve.plugin-fields": {
"version": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.1.1",
@ -142,16 +142,16 @@
"hash": "010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac"
},
"org.gamecult.eve.unity-scene": {
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.0",
"version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.1",
"depth": 0,
"source": "git",
"dependencies": {
"org.gamecult.cultlib": "1.0.8",
"org.gamecult.cultlib": "1.0.9",
"org.gamecult.eve.plugin-fields": "0.1.1",
"org.gamecult.eve.surface": "0.2.0",
"com.unity.mathematics": "1.3.2"
},
"hash": "010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac"
"hash": "d9c1de9130419103d7421d95fb2c6789a0921f46"
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",

View file

@ -197,7 +197,8 @@ namespace GameCult.Aetheria.State.Verse
PreferredLocal = local,
NetworkFallback = network
};
CultMeshBodyPublicationValidator.Validate(publication, BodyId);
new CultMeshBodyPublicationHandle(BodyId, publication.ProducerEpoch, publication.Sequence)
.Validate(publication);
var view = AetheriaRuntimeEveEntitySoaProjection.Project(frame.View, generation);
if (view.Buffers.Length != 1 || !string.Equals(view.Buffers[0].BufferId, publication.BodyId, StringComparison.Ordinal) ||
view.Columns.Any(column => !string.Equals(column.BufferId, publication.BodyId, StringComparison.Ordinal)))

View file

@ -14,14 +14,14 @@ $manifest = Get-Content (Join-Path $ProjectPath "Packages/manifest.json") -Raw |
$lock = Get-Content (Join-Path $ProjectPath "Packages/packages-lock.json") -Raw | ConvertFrom-Json
$expected = @{
"org.gamecult.cultlib" = @(
"https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.8",
"b73e04e01173ff0fc753727c0dc9e2eff2ce10c7")
"https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.9",
"b1fcd95c255cd3057894678ff7d2dba28c5eb29e")
"org.gamecult.eve.surface" = @(
"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.0",
"010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac")
"org.gamecult.eve.unity-scene" = @(
"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.0",
"010ddeff90b70ce5278da373ce2dd0bb2c9eb9ac")
"https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.2.1",
"d9c1de9130419103d7421d95fb2c6789a0921f46")
}
foreach ($packageName in $expected.Keys) {