From 530561b9467cbf62ff0f54cbe8996a05035a3f72 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 06:54:33 +0100 Subject: [PATCH] Clarify embedded Ymir simulation boundary --- Aetheria.State.Daemon.Smoke/Program.cs | 2 +- .../AetheriaYmirPhysicalPayloadPhysics.cs | 2 +- .../AetheriaYmirWorldPhysics.cs | 2 +- Aetheria.State.Verify/Program.cs | 4 ++-- Aetheria.State/README.md | 5 +++-- ...ltmesh-ergonomics-staged-migration-plan.md | 3 ++- .../docs/daemon-code-map-for-rust-port.md | 17 +++++++++----- .../docs/rust-rebuild-freeze-checklist.md | 3 ++- .../Tests/DaemonRuntimeDocumentTests.cs | 4 ++-- .../AetheriaRuntimePhysicalPayloadPhysics.cs | 4 ++-- .../Runtime/AetheriaRuntimeWorldPhysics.cs | 2 +- docs/aetheria-current-codebase-model.md | 3 ++- docs/cockpit-doctrine-combat.md | 2 +- docs/deterministic-combat-resolution.md | 13 ++++++----- docs/original-game-specification.md | 6 +++-- docs/renderless-aetheria-architecture.md | 22 ++++++++++++++++++- 16 files changed, 63 insertions(+), 31 deletions(-) diff --git a/Aetheria.State.Daemon.Smoke/Program.cs b/Aetheria.State.Daemon.Smoke/Program.cs index 7233317b5..4439146d3 100644 --- a/Aetheria.State.Daemon.Smoke/Program.cs +++ b/Aetheria.State.Daemon.Smoke/Program.cs @@ -2264,7 +2264,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks var (run, zone, target) = Scenario(); var step = new AetheriaYmirPhysicalPayloadPhysics().Step(zone, zone.Entities, 0.1); - RequireEqual("ymir.core", new AetheriaYmirPhysicalPayloadPhysics().AuthorityId, "adapter must identify its owner"); + RequireEqual("ymir.core", new AetheriaYmirPhysicalPayloadPhysics().ImplementationId, "adapter must identify its spatial implementation"); RequireEqual(0, step.PhysicalPayloads.Count, "contacted projectile must not survive"); RequireEqual(1, step.Hits.Count, "Ymir must report one projectile contact"); RequireEqual(target.EntityIndex, step.Hits[0].TargetEntityIndex, "contact must resolve the daemon entity"); diff --git a/Aetheria.State.Daemon/AetheriaYmirPhysicalPayloadPhysics.cs b/Aetheria.State.Daemon/AetheriaYmirPhysicalPayloadPhysics.cs index f5543f34a..e2fc76d68 100644 --- a/Aetheria.State.Daemon/AetheriaYmirPhysicalPayloadPhysics.cs +++ b/Aetheria.State.Daemon/AetheriaYmirPhysicalPayloadPhysics.cs @@ -14,7 +14,7 @@ public sealed class AetheriaYmirPhysicalPayloadPhysics : IAetheriaRuntimePhysica _simulator = simulator ?? new YmirSimulator(); } - public string AuthorityId => "ymir.core"; + public string ImplementationId => "ymir.core"; public AetheriaRuntimePhysicalPayloadStep Step( AetheriaRuntimeZoneSnapshotCommit zone, diff --git a/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs b/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs index d240786af..f8b8db5e4 100644 --- a/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs +++ b/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs @@ -12,7 +12,7 @@ public sealed class AetheriaYmirWorldPhysics : IAetheriaRuntimeWorldPhysics private const string PickupPrefix = "aetheria.daemon.pickup."; private readonly YmirSimulator _simulator; public AetheriaYmirWorldPhysics(YmirSimulator? simulator = null) => _simulator = simulator ?? new YmirSimulator(); - public string AuthorityId => "ymir.core"; + public string ImplementationId => "ymir.core"; public AetheriaRuntimeWorldStep Step(AetheriaRuntimeZoneSnapshotCommit zone, IReadOnlyList entities, double deltaSeconds) { diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index a6cf96e84..c471f55f2 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -614,7 +614,7 @@ Console.WriteLine("Verse settings shell: client target edits and Verse-host visi Console.WriteLine("Main-menu Verse document access: the Unity Eve shell composes daemon-owned verse identity from typed documents instead of ad-libbing local menu copy"); Console.WriteLine("Unity observer authority: gameplay scenes restore daemon frames and do not tick local simulation"); Console.WriteLine("Shared simulation authority: Zone/Entity/Agent ticks stay out of Unity gameplay callers"); -Console.WriteLine("Ymir physics authority: gameplay code uses Ymir queries and has no Unity collision callback fallback"); +Console.WriteLine("Ymir spatial kernel: authoritative gameplay physics uses Ymir computation and has no Unity collision callback fallback"); Console.WriteLine("Runtime simulation tuning authority: UI sends daemon operations instead of local simulation mutation"); Console.WriteLine("Hull conductivity authority: inventory UI sends daemon operations for toggles instead of checkpoint rewrites"); Console.WriteLine("Inventory entity rename authority: UI sends daemon operations for renames instead of local graph edits"); @@ -17379,7 +17379,7 @@ static void RequireUnityPhysicsIsNotGameplayAuthority(string root) if (weaponCombatAuthorityHits.Length > 0) { throw new InvalidOperationException( - "Unity weapon effects are presentation only; combat damage, penetration, spread, and damage type belong to daemon/Ymir state: " + + "Unity weapon effects are presentation only; combat damage, penetration, spread, and damage type belong to daemon state: " + string.Join("; ", weaponCombatAuthorityHits)); } diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index ca9c417a1..9cf052db4 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -50,8 +50,9 @@ renderer-side commit authority. publishes `starting`, `running`, and `stopping` states through `Aetheria.State`; legacy outbox status remains operation telemetry, not daemon-session ownership. The daemon has one combat writer in `AetheriaRuntimeDaemonSimulation`. -Projectile movement and contact are delegated to Ymir through the projectile -physics port. Combat state remains in the native run/zone/entity snapshot graph; +Projectile movement and contact are computed by Ymir through the injected +physics port and committed by that same daemon writer. Combat state remains in +the native run/zone/entity snapshot graph; there is no separate abstract combat save model or optional second writer. Unity Eve surfaces construct typed `gamecult.eve.command.v1` command documents. `AetheriaRuntimeVerseClient` is the shared CultMesh client boundary for diff --git a/Aetheria.State/docs/cultmesh-ergonomics-staged-migration-plan.md b/Aetheria.State/docs/cultmesh-ergonomics-staged-migration-plan.md index 09a5f541a..21ea100b6 100644 --- a/Aetheria.State/docs/cultmesh-ergonomics-staged-migration-plan.md +++ b/Aetheria.State/docs/cultmesh-ergonomics-staged-migration-plan.md @@ -580,7 +580,8 @@ Gates: The migration is MVP-complete when: - Aetheria daemon owns gameplay simulation state. -- Ymir owns physics state and gameplay physics queries. +- Aetheria owns committed physics state and performs gameplay physics queries + and integration through Ymir. - Unity is rendering/input focused. - RTS/Electron is a thin CultMesh client, not a parallel gameplay implementation. - Eve/CultUI surfaces use typed state pointers and typed operation handles. diff --git a/Aetheria.State/docs/daemon-code-map-for-rust-port.md b/Aetheria.State/docs/daemon-code-map-for-rust-port.md index 252df2a9d..dcb253347 100644 --- a/Aetheria.State/docs/daemon-code-map-for-rust-port.md +++ b/Aetheria.State/docs/daemon-code-map-for-rust-port.md @@ -4,7 +4,7 @@ This is a map of the current C# daemon as a reference API to document, measure, The rebuild target is a clean cross-runtime Aetheria surface: a Rust-native daemon and Ymir body, with useful abstractions hoisted into CultMesh/CultLib so typed state, operations, queries, native slices, authority, and UI state pointers are shared library primitives. Clients should feel like they are holding reactive, native Aetheria state, not hand-pulling snapshots, decoding array slots, reading local publication files, or building bespoke command packets. -This also means Ymir needs a Rust body. Aetheria cannot become a Rust-native simulation daemon while physics remains a C# or Unity-shaped side service. The C# Ymir contracts and Unity bridge are useful reference material, but the rebuilt daemon needs Rust Ymir beside it as the authoritative physics library/service. +This also means Ymir needs a Rust body. Aetheria cannot become a Rust-native simulation daemon while spatial computation remains a C# or Unity-shaped side service. The C# Ymir contracts and Unity bridge are useful reference material, but the rebuilt daemon needs an embedded Rust Ymir kernel behind its injected physics ports. ## Rebuild Doctrine @@ -83,7 +83,7 @@ These files define the deprecated reference surface. They should be treated as A | Command application | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperations.cs` | Current meaning of every gameplay command and rejection. | | Tick composition | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs` | Current order of command filtering, operation execution, sim step, frame creation, publication payloads. | | Daemon sim | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs` | Gameplay intents, hostile AI, combat meaning, heat, and projection of mandatory Ymir world results. | -| Ymir world adapter | `Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs` | Entity bodies, radial fields, collision resolution, and authoritative position/velocity advancement. | +| Ymir world adapter | `Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs` | Projects daemon state into Ymir and returns candidate body, field, contact, position, and velocity results for the daemon to commit. | | Game viewport documents | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeGameViewportDocuments.cs` | Existing map, object, gravity, selected object, docking, refit, sector, and inventory projections. | | Client facade | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaClient.cs` | C# client observation and typed operation ergonomics. | | Verse client | `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs` | Current lower-level typed document reads/watches and command submission. | @@ -190,7 +190,8 @@ flowchart TD Verse --> State Ops --> State - State --> Ymir + State --> Sim + Sim --> Ymir Ymir --> Sim Sim --> State State --> Queries @@ -212,7 +213,7 @@ Desired properties: - Unity receives native render views and typed state handles, not gameplay ownership. - Browser clients can run as observers, controllers, or simulation hosts depending on Verse authority configuration. - The daemon owns simulation and projections as state-native behavior, not as publication side effects. -- Ymir owns physical truth in Rust: stepping, overlaps, casts, contacts, broadphase, and spatial query acceleration. +- The Aetheria simulation owns committed physical truth and performs stepping, overlaps, casts, contacts, broadphase, and spatial-field computation through Rust Ymir. - CultMesh authority is explicit per Verse, with server-authoritative, trusted distributed, lease, quorum, and browser/WASM host structures remaining open. ## Ymir Rust Body @@ -233,7 +234,7 @@ Rust Ymir should provide: - canonical `Vec2`, `Vec3`, `Rect`, `Circle`, `Sphere`, and body handles from CultMath-compatible primitives - deterministic step for Aetheria body motion -- contacts and collision response for gameplay authority +- contacts and collision response for the calling simulation transaction - `overlap_circle`, `cast_circle`, `overlap_sphere`, `cast_sphere` - viewport/intersection queries for gravity brushes and render/query visibility - sparse-cluster-friendly broadphase and spatial acceleration @@ -251,7 +252,11 @@ let hits = ymir .collect(); ``` -That is the bar. Unity can keep a bridge for click affordances and presentation, but physical truth belongs to Rust Ymir and is consumed by Aetheria through typed state/query handles. +That is the bar. Unity can keep a bridge for click affordances and presentation, +but committed physical truth belongs to the active Aetheria simulation +authority. Its Rust daemon invokes Ymir through a narrow in-process port and +commits the result in the same tick. A remote implementation may preserve that +port, but must not create a parallel Aetheria world or writer. ## CultMesh Ergonomic Lessons diff --git a/Aetheria.State/docs/rust-rebuild-freeze-checklist.md b/Aetheria.State/docs/rust-rebuild-freeze-checklist.md index e89648b75..4323467ff 100644 --- a/Aetheria.State/docs/rust-rebuild-freeze-checklist.md +++ b/Aetheria.State/docs/rust-rebuild-freeze-checklist.md @@ -42,7 +42,8 @@ The first rebuild milestone is accepted only when the new architecture demonstra 2. A TS client can submit typed operations through shared CultMesh operation handles without constructing command documents, record keys, or raw MessagePack payloads. 3. A browser client can render map state by watching shared typed object/gravity query surfaces, not by reading local `.cc` files or duplicating projection code. 4. A Unity client can consume a shared typed render view as native arrays without owning gameplay state or running Unity physics for authority. -5. Rust Ymir owns physical truth for step, overlap, cast, contact, and broadphase queries. +5. The Rust daemon owns committed physical truth and performs step, overlap, + cast, contact, and broadphase computation through embedded Rust Ymir. 6. Eve/CultUI surfaces can bind to shared CultMesh state pointers and typed operations without manual state-ref resolver glue in client code. 7. Authority policy is configured through shared CultMesh authority primitives and changes who may author claims without changing operation schemas. 8. The API can run in native daemon mode and expose a WASM-compatible surface for browser simulation host mode. diff --git a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs index 0c11faa11..60672a60a 100644 --- a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs +++ b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs @@ -5563,7 +5563,7 @@ public class DaemonRuntimeDocumentTests private sealed class PassthroughPhysicalPayloadPhysics : IAetheriaRuntimePhysicalPayloadPhysics { - public string AuthorityId => "test.passthrough"; + public string ImplementationId => "test.passthrough"; public AetheriaRuntimePhysicalPayloadStep Step( AetheriaRuntimeZoneSnapshotCommit zone, @@ -5579,7 +5579,7 @@ public class DaemonRuntimeDocumentTests private sealed class PassthroughWorldPhysics : IAetheriaRuntimeWorldPhysics { - public string AuthorityId => "test.world-passthrough"; + public string ImplementationId => "test.world-passthrough"; public AetheriaRuntimeWorldStep Step(AetheriaRuntimeZoneSnapshotCommit zone, IReadOnlyList entities, double deltaSeconds) diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePhysicalPayloadPhysics.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePhysicalPayloadPhysics.cs index b1797980e..eefe75851 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePhysicalPayloadPhysics.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePhysicalPayloadPhysics.cs @@ -7,7 +7,7 @@ namespace GameCult.Aetheria.State.Verse { public interface IAetheriaRuntimePhysicalPayloadPhysics { - string AuthorityId { get; } + string ImplementationId { get; } AetheriaRuntimePhysicalPayloadStep Step( AetheriaRuntimeZoneSnapshotCommit zone, @@ -25,7 +25,7 @@ namespace GameCult.Aetheria.State.Verse { } - public string AuthorityId => "unavailable"; + public string ImplementationId => "unavailable"; public AetheriaRuntimePhysicalPayloadStep Step( AetheriaRuntimeZoneSnapshotCommit zone, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeWorldPhysics.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeWorldPhysics.cs index bfdf16a45..197c1dacc 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeWorldPhysics.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeWorldPhysics.cs @@ -7,7 +7,7 @@ namespace GameCult.Aetheria.State.Verse { public interface IAetheriaRuntimeWorldPhysics { - string AuthorityId { get; } + string ImplementationId { get; } AetheriaRuntimeWorldStep Step(AetheriaRuntimeZoneSnapshotCommit zone, IReadOnlyList entities, double deltaSeconds); } diff --git a/docs/aetheria-current-codebase-model.md b/docs/aetheria-current-codebase-model.md index 748d583f3..3f9b70536 100644 --- a/docs/aetheria-current-codebase-model.md +++ b/docs/aetheria-current-codebase-model.md @@ -150,7 +150,8 @@ Current Ymir control flow: tests can supply another deterministic implementation without changing game authority. - The daemon projects ships, pickups, fields, and explicitly physical payloads - into Ymir. Ymir owns integration, collision, and spatial contact facts. + into Ymir. Ymir computes integration, collision, and spatial contact results; + the daemon commits and interprets them in the same simulation transaction. - Ordinary direct, constant, and charged weapon fire resolves through deterministic shot receipts. It does not create a Ymir body or derive damage from collision. diff --git a/docs/cockpit-doctrine-combat.md b/docs/cockpit-doctrine-combat.md index 9e3e67f86..b5f8d145a 100644 --- a/docs/cockpit-doctrine-combat.md +++ b/docs/cockpit-doctrine-combat.md @@ -51,7 +51,7 @@ Cognition does not inspect hidden truth. It plans from faction-local observation ### Daemon And Ymir -The player authors doctrine intent. The Aetheria daemon validates and owns its accepted canonical state along with cognition allocation, observations, accepted semantic actions, equipment state, deterministic probabilistic shot resolution, damage, and combat outcomes. Ymir owns authoritative world geometry and kinematics used by firing solutions, plus motion and collision for persistent physical payloads. Ordinary weapon damage does not wait for a presentation projectile to collide. Clients submit typed intent and lower daemon-authored state through Eve; they do not aim locally, infer hits from effects, or maintain a private combat result. The normative resolver and cut line are defined in `deterministic-combat-resolution.md`. +The player authors doctrine intent. The Aetheria daemon validates and owns its accepted canonical state along with cognition allocation, observations, accepted semantic actions, equipment state, committed world geometry and kinematics, deterministic probabilistic shot resolution, damage, and combat outcomes. It performs firing-solution spatial queries and persistent-payload motion and collision through Ymir. Ordinary weapon damage does not wait for a presentation projectile to collide. Clients submit typed intent and lower daemon-authored state through Eve; they do not aim locally, infer hits from effects, or maintain a private combat result. The normative resolver and cut line are defined in `deterministic-combat-resolution.md`. ## Cockpit View diff --git a/docs/deterministic-combat-resolution.md b/docs/deterministic-combat-resolution.md index 46f11c4bb..ef02874e3 100644 --- a/docs/deterministic-combat-resolution.md +++ b/docs/deterministic-combat-resolution.md @@ -205,7 +205,8 @@ dexterity test that agents solve differently from humans. ## Ymir Boundary -Ymir owns world geometry and kinematics. At commitment, the resolver may query +The Aetheria simulation owns committed world geometry and kinematics and uses +Ymir as its deterministic spatial kernel. At commitment, the resolver may invoke Ymir for relative transforms, motion, body bounds, occlusion, and line-of-fire constraints. Ordinary weapon damage does not wait for a projectile body to overlap a target. @@ -213,15 +214,15 @@ overlap a target. Physical entities remain appropriate when their continued existence changes the world: mines, drones, interceptable missiles, torpedoes, debris, boarding craft, area fields, and recoverable or destructible payloads. Those objects are -not exempt from deterministic fire-control receipts; Ymir owns their later -motion and collision after launch. +not exempt from deterministic fire-control receipts. Their later motion and +collision are computed by Ymir and committed by the Aetheria simulation. For deployables, physics contact is evidence rather than consequence. Aetheria authors deployment, arming, trigger and detonation clocks, target eligibility, blast magnitude, damage, and event chronology. The injected Ymir implementation -owns integration and overlap/contact facts. The production daemon currently -embeds that implementation in-process; moving it across CultNet must not change -either authority or the persisted state contract. +computes integration and overlap/contact facts inside that transaction. The +production daemon currently embeds it in-process; moving the computation across +CultNet must not create another persisted world or change simulation authority. Mine lifetime and source-relative range expiry are also daemon-owned trigger causes. They enter the same detonation transaction as proximity triggers and diff --git a/docs/original-game-specification.md b/docs/original-game-specification.md index 7fe5ee652..5e8d6644d 100644 --- a/docs/original-game-specification.md +++ b/docs/original-game-specification.md @@ -38,7 +38,8 @@ rendering decisions, and player feedback that define Aetheria as a game. The target is behavioral parity through a different machine: - the Aetheria daemon owns game state and simulation decisions; -- Ymir owns authoritative spatial physics and collision; +- the Aetheria simulation owns committed physical state and computes spatial + integration, queries, and collision through Ymir; - Eve surfaces expose everything a client needs to understand and present; - EveUnity lowers those semantics into Unity rendering and interaction; - provider assets retain authored visual, audio, and material content; @@ -400,7 +401,8 @@ different semantic commands, but neither owns a private copy of the world. ## Required Scenario Proofs 1. **Flight:** launch Terminus, fly, turn, stop, exercise installed propulsion - actions, and collide; daemon/Ymir state and visible motion agree throughout. + actions, and collide; daemon-committed state and visible Ymir-computed motion + agree throughout. 2. **Target and combat:** acquire a hostile, lock where required, fire each weapon family, observe effects and hit feedback, take return fire, and destroy the target. diff --git a/docs/renderless-aetheria-architecture.md b/docs/renderless-aetheria-architecture.md index b82072a68..102b923d8 100644 --- a/docs/renderless-aetheria-architecture.md +++ b/docs/renderless-aetheria-architecture.md @@ -39,7 +39,8 @@ Aetheria daemon owns committed game state and rules. Inputs: The daemon may read typed CultCache/CultMesh documents, catalog data, authority policy, player/client operation documents, simulation clock input, deterministic -generation seeds, asset manifests, and physics-service results. +generation seeds and asset manifests. Its simulation transaction may invoke the +embedded Ymir spatial kernel, but Ymir does not become a second state owner. Outputs: The daemon publishes typed state documents, committed facts, operation receipts, @@ -71,6 +72,25 @@ Before adding new client behavior, delete or demote any path that lets a client invent gameplay state, reconstruct daemon-owned documents from broader frames, or patch missing Eve semantics with Aetheria-specific renderer code. +## Spatial Kernel Boundary + +The active Aetheria simulation authority owns committed transforms, velocities, +contacts that affect gameplay, and every consequence derived from them. All +authoritative integration, overlap, cast, contact, broadphase, and spatial-field +computation is performed through Ymir. In the production daemon Ymir is an +embedded deterministic kernel, not an independently persistent Aetheria world. + +The daemon passes an explicit simulation slice to Ymir and commits the returned +spatial facts as part of the same tick transaction. Ymir neither reads Aetheria +state behind the daemon's back nor writes CultMesh documents of its own. Combat, +docking, sensors, AI decisions, damage, inventory, triggers, and event chronology +remain Aetheria rules even when they consume Ymir results. + +A remote Ymir host is an optional deployment of the same computation port. It +does not earn state authority merely by crossing CultNet. Separate persistence +or leases are justified only for a future shared spatial Verse with an explicit +owner and lifecycle; they are not part of the Aetheria daemon contract. + ## Current Mechanism The repo is mid-migration.