diff --git a/docs/ecs/command-buffer.md b/docs/ecs/command-buffer.md index c96ea7cf5..f28ccd5f9 100644 --- a/docs/ecs/command-buffer.md +++ b/docs/ecs/command-buffer.md @@ -2,7 +2,7 @@ `CommandBuffer` is how game code performs structural changes — creating and destroying entities, adding and removing components — from inside a system tick. Recording an operation is cheap and immediate; the actual World mutation is deferred to the **stage barrier**, after every system in the current stage has finished iterating. Inside a system you never mutate the World structurally yourself: you call `ctx.cmd.*`, and the scheduler plays your buffer back at a safe, deterministic point. -Defined in [src/openvic-simulation/ecs/CommandBuffer.hpp](../../src/openvic-simulation/ecs/CommandBuffer.hpp) (recording) and [src/openvic-simulation/ecs/CommandBuffer.cpp](../../src/openvic-simulation/ecs/CommandBuffer.cpp) (playback). +Defined in [src/openvic-simulation/core/ecs/CommandBuffer.hpp](../../src/openvic-simulation/core/ecs/CommandBuffer.hpp) (recording) and [src/openvic-simulation/core/ecs/CommandBuffer.cpp](../../src/openvic-simulation/core/ecs/CommandBuffer.cpp) (playback). ## Where you get one @@ -323,9 +323,9 @@ You could call `world.add_component` directly between ticks instead (the in-tick ## Source files -- [src/openvic-simulation/ecs/CommandBuffer.hpp](../../src/openvic-simulation/ecs/CommandBuffer.hpp) — recording API, op storage, payload holders -- [src/openvic-simulation/ecs/CommandBuffer.cpp](../../src/openvic-simulation/ecs/CommandBuffer.cpp) — `apply` / `clear` / `merge_from` playback -- [src/openvic-simulation/ecs/World.hpp](../../src/openvic-simulation/ecs/World.hpp) — in-tick mutation guard, reserved-slot lifecycle, `is_immutable` -- [src/openvic-simulation/ecs/System.hpp](../../src/openvic-simulation/ecs/System.hpp) — `TickContext` (the `cmd` member), per-chunk buffer pool on `SystemThreaded` -- [src/openvic-simulation/ecs/EntityID.hpp](../../src/openvic-simulation/ecs/EntityID.hpp) — `is_deferred()`, `DEFERRED_GENERATION_BIT`, `ImmutableEntityID` +- [src/openvic-simulation/core/ecs/CommandBuffer.hpp](../../src/openvic-simulation/core/ecs/CommandBuffer.hpp) — recording API, op storage, payload holders +- [src/openvic-simulation/core/ecs/CommandBuffer.cpp](../../src/openvic-simulation/core/ecs/CommandBuffer.cpp) — `apply` / `clear` / `merge_from` playback +- [src/openvic-simulation/core/ecs/World.hpp](../../src/openvic-simulation/core/ecs/World.hpp) — in-tick mutation guard, reserved-slot lifecycle, `is_immutable` +- [src/openvic-simulation/core/ecs/System.hpp](../../src/openvic-simulation/core/ecs/System.hpp) — `TickContext` (the `cmd` member), per-chunk buffer pool on `SystemThreaded` +- [src/openvic-simulation/core/ecs/EntityID.hpp](../../src/openvic-simulation/core/ecs/EntityID.hpp) — `is_deferred()`, `DEFERRED_GENERATION_BIT`, `ImmutableEntityID` - Tests: [tests/src/ecs/CommandBuffer.cpp](../../tests/src/ecs/CommandBuffer.cpp), [tests/src/ecs/InTickMutationGuard.cpp](../../tests/src/ecs/InTickMutationGuard.cpp), [tests/src/ecs/SystemThreadedSpawn.cpp](../../tests/src/ecs/SystemThreadedSpawn.cpp) diff --git a/docs/ecs/components.md b/docs/ecs/components.md index 17dbd186c..7cf43dc1f 100644 --- a/docs/ecs/components.md +++ b/docs/ecs/components.md @@ -26,7 +26,7 @@ Forgetting to register is a clear compile error, not a silent misbehaviour: the What the type system actually enforces: - **Move-constructible and destructible.** Storage moves components between rows during archetype migrations and swap-pop compaction, and destroys them on `destroy_entity` / `remove_component`. Non-trivial members (e.g. a `std::string`) are handled correctly — destructors run, nothing leaks (see `tests/src/ecs/Component.cpp`, "Components with non-trivial dtor are destroyed properly"). -- **Checksummable.** The first use of a component type with a `World` instantiates its column vtable, which `static_assert`s the universal hashing rule from `src/openvic-simulation/ecs/ChecksumTraits.hpp` (`is_checksummable_v`). Every component (and singleton) type must hash one of two ways: +- **Checksummable.** The first use of a component type with a `World` instantiates its column vtable, which `static_assert`s the universal hashing rule from `src/openvic-simulation/core/ecs/ChecksumTraits.hpp` (`is_checksummable_v`). Every component (and singleton) type must hash one of two ways: 1. **Raw bytes** — allowed only if `std::has_unique_object_representations_v`, i.e. the compiler inserted no padding and there are no `float`/`double` members. Padding bytes are indeterminate garbage; fill gaps with explicit `_pad` members, zeroed at construction. 2. **A custom hash** — a free function `uint64_t ecs_checksum(C const&, uint64_t seed)` declared at `C`'s scope (found by ADL), before `C`'s first `World`/`CommandBuffer` use in the translation unit. Mandatory for anything holding heap data (`std::string`, vector members, ...): walk sizes + elements in index order, never capacities or addresses. @@ -67,7 +67,7 @@ ECS_COMPONENT(Velocity, "test_Component::Velocity") ## ComponentTypeID — how types get IDs -You will mostly never touch this machinery directly; it is what `ECS_COMPONENT` plugs into. From `src/openvic-simulation/ecs/ComponentTypeID.hpp`: +You will mostly never touch this machinery directly; it is what `ECS_COMPONENT` plugs into. From `src/openvic-simulation/core/ecs/ComponentTypeID.hpp`: ```cpp using component_type_id_t = uint64_t; @@ -140,7 +140,7 @@ Notes: - Only the *numeric ordering for one column within one run* is meaningful. Bulk creation bumps versions once per touched chunk instead of once per row, so never compare version values across runs or use them as data — they only signal "this column changed". - An `ImmutableEntityID` overload exists with identical behaviour. -This is the primitive `CachedRef::get(World&)` is built on (`src/openvic-simulation/ecs/CachedRef.hpp`): it re-resolves the pointer only when the live version differs from the cached one. +This is the primitive `CachedRef::get(World&)` is built on (`src/openvic-simulation/core/ecs/CachedRef.hpp`): it re-resolves the pointer only when the live version differs from the cached one. ### Example: reads, writes, and what `nullptr` means @@ -301,7 +301,7 @@ GameClock* c = ctx.world.get_singleton(); ## `DenseSlotAllocator` — deterministic rows for singleton side tables -Some singleton-owned state is per-entity but doesn't fit a component column — variable-width or shared tables ("side tables") indexed by a dense row number that the owning entity stores. `DenseSlotAllocator` (`src/openvic-simulation/ecs/DenseSlotAllocator.hpp`) hands out those rows deterministically. +Some singleton-owned state is per-entity but doesn't fit a component column — variable-width or shared tables ("side tables") indexed by a dense row number that the owning entity stores. `DenseSlotAllocator` (`src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp`) hands out those rows deterministically. ```cpp inline constexpr uint32_t INVALID_DENSE_SLOT = static_cast(-1); @@ -380,10 +380,10 @@ if (!restored.restore(snap)) { ## Source files -- src/openvic-simulation/ecs/ComponentTypeID.hpp — `component_type_id_t`, `fnv1a_64`, `ComponentName`, `component_type_id_of`, `ECS_COMPONENT` -- src/openvic-simulation/ecs/World.hpp — `create_entity`, `add_component`, `remove_component`, `get_component`, `has_component`, `component_version_in`, `set_singleton`, `get_singleton`, `clear_singleton` -- src/openvic-simulation/ecs/ChecksumTraits.hpp — the checksum contract: `is_checksummable_v`, `ecs_checksum` convention, `ECS_CHECKSUM_BYTES` -- src/openvic-simulation/ecs/Archetype.hpp — `ColumnVTable` (the move/destroy/hash operations a component type must support) -- src/openvic-simulation/ecs/CachedRef.hpp — version-validated cross-tick component pointer -- src/openvic-simulation/ecs/DenseSlotAllocator.hpp / src/openvic-simulation/ecs/DenseSlotAllocator.cpp — deterministic dense rows for singleton side tables +- src/openvic-simulation/core/ecs/ComponentTypeID.hpp — `component_type_id_t`, `fnv1a_64`, `ComponentName`, `component_type_id_of`, `ECS_COMPONENT` +- src/openvic-simulation/core/ecs/World.hpp — `create_entity`, `add_component`, `remove_component`, `get_component`, `has_component`, `component_version_in`, `set_singleton`, `get_singleton`, `clear_singleton` +- src/openvic-simulation/core/ecs/ChecksumTraits.hpp — the checksum contract: `is_checksummable_v`, `ecs_checksum` convention, `ECS_CHECKSUM_BYTES` +- src/openvic-simulation/core/ecs/Archetype.hpp — `ColumnVTable` (the move/destroy/hash operations a component type must support) +- src/openvic-simulation/core/ecs/CachedRef.hpp — version-validated cross-tick component pointer +- src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp / src/openvic-simulation/core/ecs/DenseSlotAllocator.cpp — deterministic dense rows for singleton side tables - tests/src/ecs/Component.cpp, tests/src/ecs/Tag.cpp, tests/src/ecs/Singleton.cpp, tests/src/ecs/DenseSlotAllocator.cpp, tests/src/ecs/FNVHash.cpp — executable examples of everything above diff --git a/docs/ecs/determinism.md b/docs/ecs/determinism.md index a857060ec..5e80c1a55 100644 --- a/docs/ecs/determinism.md +++ b/docs/ecs/determinism.md @@ -1,6 +1,6 @@ # Determinism and checksums -OpenVic targets lockstep multiplayer: every peer runs the same simulation and must produce **bit-identical state** every tick, regardless of CPU, worker-thread count, or whether the session was freshly started or loaded from a save. This page is the contract that makes that work — the rules your game code must follow, the ordering guarantees the ECS gives you in return, and the checksum machinery (`src/openvic-simulation/ecs/Checksum.hpp`) that measures whether two worlds are actually in the same state. +OpenVic targets lockstep multiplayer: every peer runs the same simulation and must produce **bit-identical state** every tick, regardless of CPU, worker-thread count, or whether the session was freshly started or loaded from a save. This page is the contract that makes that work — the rules your game code must follow, the ordering guarantees the ECS gives you in return, and the checksum machinery (`src/openvic-simulation/core/ecs/Checksum.hpp`) that measures whether two worlds are actually in the same state. The short version: write per-row integer/fixed-point arithmetic, declare everything you touch, never let a thread id or a memory address influence a result — and the worker-count-invariance tests will hold you to it. @@ -12,7 +12,7 @@ Floating-point results vary with compiler, optimization flags, FMA contraction, ### 2. No thread-schedule-dependent results — use `reductions::*` -Any fold whose accumulation order depends on which worker ran first (a shared accumulator, a per-`worker_id` partial array folded in completion order) produces different results at different worker counts. Use the helpers in `src/openvic-simulation/ecs/Reductions.hpp` — `parallel_sum`, `parallel_min`, `parallel_max`, `parallel_keyed_sum`. They buffer per-chunk results keyed by `chunk_idx` and fold them **sequentially in `chunk_idx` ascending order** after the parallel section joins, so the result is bit-identical regardless of worker count. See threading-and-reductions.md for usage. +Any fold whose accumulation order depends on which worker ran first (a shared accumulator, a per-`worker_id` partial array folded in completion order) produces different results at different worker counts. Use the helpers in `src/openvic-simulation/core/ecs/Reductions.hpp` — `parallel_sum`, `parallel_min`, `parallel_max`, `parallel_keyed_sum`. They buffer per-chunk results keyed by `chunk_idx` and fold them **sequentially in `chunk_idx` ascending order** after the parallel section joins, so the result is bit-identical regardless of worker count. See threading-and-reductions.md for usage. For the same reason, never key anything off the `worker_id` your code can observe, and never read wall-clock time, thread ids, or process-local RNG inside a tick. @@ -44,7 +44,7 @@ A raw pointer is uniquely representable, so a byte-hashed component containing o ### 6. Keep `should_run` pure over deterministic state -The optional `static bool should_run(TickContext const&)` cadence gate must be a pure function of `ctx.today` and singletons read via `ctx.world`. It runs on every peer every tick; if it reads anything per-machine, peers diverge on *whether a system ran at all*. The skip is dispatch-time only — `schedule_hash()` is untouched — so gating never perturbs the schedule. Full contract in `src/openvic-simulation/ecs/System.hpp` and systems.md. +The optional `static bool should_run(TickContext const&)` cadence gate must be a pure function of `ctx.today` and singletons read via `ctx.world`. It runs on every peer every tick; if it reads anything per-machine, peers diverge on *whether a system ran at all*. The skip is dispatch-time only — `schedule_hash()` is untouched — so gating never perturbs the schedule. Full contract in `src/openvic-simulation/core/ecs/System.hpp` and systems.md. ### 7. Don't make logic sensitive to packing order across save/load @@ -65,11 +65,11 @@ Given identical inputs and game code that follows the rules above, the ECS guara uint64_t schedule_hash(); ``` -FNV-1a over the `(stage_index, system_type_id_t)` pairs of the current schedule (`src/openvic-simulation/ecs/World.hpp`). Multiplayer peers compute this at session-start handshake; a mismatch rejects the join. Registration *within* a conflict-free stage is order-insensitive — `tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp` asserts that registering four co-staged systems in reverse order produces the same hash. See scheduling.md. +FNV-1a over the `(stage_index, system_type_id_t)` pairs of the current schedule (`src/openvic-simulation/core/ecs/World.hpp`). Multiplayer peers compute this at session-start handshake; a mismatch rejects the join. Registration *within* a conflict-free stage is order-insensitive — `tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp` asserts that registering four co-staged systems in reverse order produces the same hash. See scheduling.md. ## EntityID stability across save/load -`EntityID` is `{ uint32_t index, uint32_t generation }` (`src/openvic-simulation/ecs/EntityID.hpp`). Ids are **save-stable**: the identity layer (slot generations, immutability flags, free-list order) can be snapshotted and restored exactly, so an `EntityID` stored inside a component means the same thing after a load as it did in the never-saved run. This is why checksumming hashes `EntityID` fields raw, and why components reference other entities by id rather than pointer. +`EntityID` is `{ uint32_t index, uint32_t generation }` (`src/openvic-simulation/core/ecs/EntityID.hpp`). Ids are **save-stable**: the identity layer (slot generations, immutability flags, free-list order) can be snapshotted and restored exactly, so an `EntityID` stored inside a component means the same thing after a load as it did in the never-saved run. This is why checksumming hashes `EntityID` fields raw, and why components reference other entities by id rather than pointer. ```cpp bool snapshot_identity(WorldIdentitySnapshot& out) const; @@ -79,7 +79,7 @@ template bool restore_entity(EntityID eid, Cs&&... values); ``` -- `snapshot_identity` captures the identity layer **only** — per-slot generations, per-slot immutability, free-list order (`WorldIdentitySnapshot` in `src/openvic-simulation/ecs/World.hpp`). Archetypes, packing, singletons, and systems are deliberately not captured; the loader rebuilds them. Refuses (error log + `false`) mid-tick or while any reserved-but-unfinalised slot exists (a `CommandBuffer` holding un-applied creates) — snapshot only between ticks, after every buffer has applied. It also validates the free chain and refuses to save a corrupt one. +- `snapshot_identity` captures the identity layer **only** — per-slot generations, per-slot immutability, free-list order (`WorldIdentitySnapshot` in `src/openvic-simulation/core/ecs/World.hpp`). Archetypes, packing, singletons, and systems are deliberately not captured; the loader rebuilds them. Refuses (error log + `false`) mid-tick or while any reserved-but-unfinalised slot exists (a `CommandBuffer` holding un-applied creates) — snapshot only between ticks, after every buffer has applied. It also validates the free chain and refuses to save a corrupt one. - `restore_identity` requires a **fresh** World (no entity slot ever allocated), outside any tick. The snapshot is fully validated before any mutation; on failure the World is untouched. Afterward every live slot is reserved-but-unfinalised: addressable at its original `(index, generation)` but `is_alive == false` until finalised. - `restore_entity` finalises one restored slot with its components (same component rules as `create_entity`). Between `restore_identity` and the last `restore_entity`, the **only** legal entity operations are `restore_entity` calls — in particular, `destroy_entity` on a not-yet-finalised id would push the slot onto the free list and silently corrupt the restored order. Recreate live entities in **slot-index ascending order**: identity correctness is order-independent, but packing is not, and the canonical order is what makes packing reproducible across loads. @@ -193,8 +193,8 @@ Enforcement happens automatically at the two registration points — instantiati Adapted from `tests/src/ecs/Checksum.cpp`: ```cpp -#include "openvic-simulation/ecs/ChecksumTraits.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ChecksumTraits.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" #include @@ -253,9 +253,9 @@ The contract test: same starting World + same input → bit-identical post-tick The full-state-checksum variant, adapted from `tests/src/ecs/Checksum.cpp` — use this as the template when adding a gate for new game systems: ```cpp -#include "openvic-simulation/ecs/Checksum.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Checksum.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace { // Threaded spawner: every CkSeed entity spawns one CkSpawned with a deterministic value. @@ -317,7 +317,7 @@ TEST_CASE("Full-state checksum is identical across worker counts and serial mode } ``` -The two World knobs the harness uses (`src/openvic-simulation/ecs/World.hpp`): +The two World knobs the harness uses (`src/openvic-simulation/core/ecs/World.hpp`): ```cpp // Override the ECS worker count. Call before the first `tick_systems` invocation. @@ -352,10 +352,10 @@ Run them with `ctest --preset -debug` (after building with `cmake --buil ## Source files -- src/openvic-simulation/ecs/Checksum.hpp — `world_checksum`, `world_checksum_breakdown`, `fold_checksum_breakdown`, breakdown structs -- src/openvic-simulation/ecs/Checksum.cpp — the canonical walk implementation -- src/openvic-simulation/ecs/ChecksumTraits.hpp — the per-type hashing contract, traits, primitives, `ECS_CHECKSUM_BYTES` -- src/openvic-simulation/ecs/World.hpp — `schedule_hash`, `set_ecs_worker_count`, `set_serial_mode`, `snapshot_identity` / `restore_identity` / `restore_entity`, `WorldIdentitySnapshot` -- src/openvic-simulation/ecs/Reductions.hpp — deterministic parallel folds -- src/openvic-simulation/ecs/EntityID.hpp — `EntityID` / `ImmutableEntityID` +- src/openvic-simulation/core/ecs/Checksum.hpp — `world_checksum`, `world_checksum_breakdown`, `fold_checksum_breakdown`, breakdown structs +- src/openvic-simulation/core/ecs/Checksum.cpp — the canonical walk implementation +- src/openvic-simulation/core/ecs/ChecksumTraits.hpp — the per-type hashing contract, traits, primitives, `ECS_CHECKSUM_BYTES` +- src/openvic-simulation/core/ecs/World.hpp — `schedule_hash`, `set_ecs_worker_count`, `set_serial_mode`, `snapshot_identity` / `restore_identity` / `restore_entity`, `WorldIdentitySnapshot` +- src/openvic-simulation/core/ecs/Reductions.hpp — deterministic parallel folds +- src/openvic-simulation/core/ecs/EntityID.hpp — `EntityID` / `ImmutableEntityID` - tests/src/ecs/WorkerCountInvariance.cpp, tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp, tests/src/ecs/Checksum.cpp, tests/src/ecs/IdentitySnapshotInvariance.cpp — the determinism gates diff --git a/docs/ecs/entities.md b/docs/ecs/entities.md index f11b37302..31950666e 100644 --- a/docs/ecs/entities.md +++ b/docs/ecs/entities.md @@ -20,7 +20,7 @@ struct EntityID { inline constexpr EntityID INVALID_ENTITY_ID = {}; ``` -Defined in [src/openvic-simulation/ecs/EntityID.hpp](../../src/openvic-simulation/ecs/EntityID.hpp). There is no parallel id system — `EntityID` is the one handle type for cross-references between entities. Store it by value; it is two `uint32_t`s and trivially copyable. +Defined in [src/openvic-simulation/core/ecs/EntityID.hpp](../../src/openvic-simulation/core/ecs/EntityID.hpp). There is no parallel id system — `EntityID` is the one handle type for cross-references between entities. Store it by value; it is two `uint32_t`s and trivially copyable. ### Encoding @@ -345,7 +345,7 @@ struct CachedRef { }; ``` -Defined in [src/openvic-simulation/ecs/CachedRef.hpp](../../src/openvic-simulation/ecs/CachedRef.hpp). +Defined in [src/openvic-simulation/core/ecs/CachedRef.hpp](../../src/openvic-simulation/core/ecs/CachedRef.hpp). - `CachedRef::from(world, id)` builds a ref and resolves it immediately. - `get(world)` returns the current component pointer, refreshing the cache if the column has mutated since the last successful resolve or the entity changed archetype. Returns `nullptr` if the entity is dead or no longer carries `C`. The fast path is one version comparison and an indirection — cheaper than calling `World::get_component` every time. @@ -403,8 +403,8 @@ Note for tag (zero-size) components: `get_component` returns `nullptr` by d ## Source files -- [src/openvic-simulation/ecs/EntityID.hpp](../../src/openvic-simulation/ecs/EntityID.hpp) — `EntityID`, `ImmutableEntityID`, sentinels, `DEFERRED_GENERATION_BIT` -- [src/openvic-simulation/ecs/World.hpp](../../src/openvic-simulation/ecs/World.hpp) — creation/destruction/bulk APIs, `WorldIdentitySnapshot`, `restore_entity`, `component_version_in` -- [src/openvic-simulation/ecs/World.cpp](../../src/openvic-simulation/ecs/World.cpp) — slot allocation, `is_alive` / `destroy_entity` / identity snapshot bodies -- [src/openvic-simulation/ecs/CachedRef.hpp](../../src/openvic-simulation/ecs/CachedRef.hpp) — `CachedRef` +- [src/openvic-simulation/core/ecs/EntityID.hpp](../../src/openvic-simulation/core/ecs/EntityID.hpp) — `EntityID`, `ImmutableEntityID`, sentinels, `DEFERRED_GENERATION_BIT` +- [src/openvic-simulation/core/ecs/World.hpp](../../src/openvic-simulation/core/ecs/World.hpp) — creation/destruction/bulk APIs, `WorldIdentitySnapshot`, `restore_entity`, `component_version_in` +- [src/openvic-simulation/core/ecs/World.cpp](../../src/openvic-simulation/core/ecs/World.cpp) — slot allocation, `is_alive` / `destroy_entity` / identity snapshot bodies +- [src/openvic-simulation/core/ecs/CachedRef.hpp](../../src/openvic-simulation/core/ecs/CachedRef.hpp) — `CachedRef` - Tests with observable semantics: `tests/src/ecs/EntityID.cpp`, `tests/src/ecs/EntityLifecycle.cpp`, `tests/src/ecs/BulkCreate.cpp`, `tests/src/ecs/ImmutableEntity.cpp`, `tests/src/ecs/CachedRef.cpp`, `tests/src/ecs/IdentitySnapshot.cpp` diff --git a/docs/ecs/pitfalls.md b/docs/ecs/pitfalls.md index e023559e4..4091f11c0 100644 --- a/docs/ecs/pitfalls.md +++ b/docs/ecs/pitfalls.md @@ -25,7 +25,7 @@ template C* add_component(EntityID id, C&& value); ``` -(`src/openvic-simulation/ecs/World.hpp`) +(`src/openvic-simulation/core/ecs/World.hpp`) WHY: an entity's component set IS its archetype, and the archetype decides which chunk slabs the entity's data lives in (see [storage-model.md](storage-model.md)). `add_component` after creation is an **archetype migration**: the World builds the extended signature, finds or creates the target archetype, reserves a row there, move-constructs *every* existing component across, then swap-pop compacts the source archetype (relocating an unrelated entity into the hole) and bumps every column version. That is one full migration **per call, per entity**. At the scale this simulation targets (e.g. a million order entities per tick) it is lethal. @@ -49,14 +49,14 @@ WHY: `create_entities` move-constructs values out of your spans straight into th ### **Never mutate World structure from inside a system tick — go through `ctx.cmd`.** ```cpp -// On TickContext (src/openvic-simulation/ecs/System.hpp): +// On TickContext (src/openvic-simulation/core/ecs/System.hpp): struct TickContext { World& world; Date today; CommandBuffer& cmd; }; -// On CommandBuffer (src/openvic-simulation/ecs/CommandBuffer.hpp): +// On CommandBuffer (src/openvic-simulation/core/ecs/CommandBuffer.hpp): template EntityID create_entity(World& world, Cs&&... values); @@ -76,8 +76,8 @@ WHY: the scheduler sets an in-tick flag around every system's tick, and the Worl Working example (adapted from `tests/src/ecs/InTickMutationGuard.cpp`, which asserts exactly these semantics): ```cpp -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/World.hpp" using namespace OpenVic::ecs; using OpenVic::Date; @@ -172,7 +172,7 @@ See [entities.md](entities.md). WHY: For pools and handle release — e.g. `DenseSlotAllocator`'s `release(uint32_t slot)` for singleton side-table rows — the call must be visible where the lifecycle decision is made, so end-of-session sweeps and ownership are auditable by reading the callsites. A destructor hiding the release defeats that. See [components.md](components.md) for `DenseSlotAllocator` side tables. -Corollary contract (`src/openvic-simulation/ecs/DenseSlotAllocator.hpp`): `release` must happen **exactly once per live slot**. A double release is a contract violation that is **not** detected per-release (a per-call scan would make mass end-of-session sweeps quadratic) — the slot re-enters the free list and the next two `allocate()` calls hand out the same row twice. Only `debug_validate()` catches it: a one-shot O(n log n) invariant check for tests and debug sweeps. (Releasing a slot `>= high_water()` *is* caught: logged and ignored.) +Corollary contract (`src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp`): `release` must happen **exactly once per live slot**. A double release is a contract violation that is **not** detected per-release (a per-call scan would make mass end-of-session sweeps quadratic) — the slot re-enters the free list and the next two `allocate()` calls hand out the same row twice. Only `debug_validate()` catches it: a one-shot O(n log n) invariant check for tests and debug sweeps. (Releasing a slot `>= high_water()` *is* caught: logged and ignored.) --- @@ -192,7 +192,7 @@ WHY: `get_component` returns a pointer into a chunk slab at the entity's current The World exposes the invalidation signal directly: `component_version_in(id)` returns the component-column version in the entity's current archetype (0 if dead or no longer carrying `C`). The version monotonically increases on every structural change to that column (push, swap-pop, relocate), so **a stable version implies cached pointers into the column are still valid**. -Across ticks, use `CachedRef` (`src/openvic-simulation/ecs/CachedRef.hpp`), which packages exactly this check — id + version stamp + pointer; the fast path is one comparison: +Across ticks, use `CachedRef` (`src/openvic-simulation/core/ecs/CachedRef.hpp`), which packages exactly this check — id + version stamp + pointer; the fast path is one comparison: ```cpp CachedRef ref = CachedRef::from(world, eid); @@ -241,7 +241,7 @@ bool create_immutable_entities( ); ``` -(`src/openvic-simulation/ecs/CommandBuffer.hpp`) — the deferred analogue of `World::create_entities`, same input contract (one span per non-empty component in pack order, length `== count`, tags take no span, or no spans to default-construct; input spans are moved-from at record time). In parallel mode `out_ids` receives `count` **sequential deferred placeholders** that are **never rewritten** to real ids — the exact never-persist contract as the single create's returned placeholder, just `count` of them. In serial mode `count` real slots are reserved up-front in creation order, usable for same-buffer `add_component` / `destroy_entity` like single creates. Either way, the bulk op yields the identical id assignment as the equivalent `create_entity` loop. +(`src/openvic-simulation/core/ecs/CommandBuffer.hpp`) — the deferred analogue of `World::create_entities`, same input contract (one span per non-empty component in pack order, length `== count`, tags take no span, or no spans to default-construct; input spans are moved-from at record time). In parallel mode `out_ids` receives `count` **sequential deferred placeholders** that are **never rewritten** to real ids — the exact never-persist contract as the single create's returned placeholder, just `count` of them. In serial mode `count` real slots are reserved up-front in creation order, usable for same-buffer `add_component` / `destroy_entity` like single creates. Either way, the bulk op yields the identical id assignment as the equivalent `create_entity` loop. --- @@ -260,7 +260,7 @@ static constexpr std::array extra_writes() { return {}; WHY: the scheduler builds its stage layout from declared access only — tick parameters plus `extra_reads()` / `extra_writes()`. Systems with disjoint access run concurrently in one stage; two systems with conflicting declared access are serialised — **unless** the scheduler can prove their iterated archetypes are disjoint (one's tick query requires a component the other excludes via `Filters = Filter>`, and every conflicting component appears purely in both tick parameter packs, never in `extra_reads()` / `extra_writes()`). That is the disjoint-iteration conflict override: e.g. one system writing `C` and reading `B` shares a stage with another writing `C` `Without`, despite the shared write on `C`. See [scheduling.md](scheduling.md). An access you perform through `ctx.world` but did not declare is **invisible** to that model: the scheduler may co-schedule your system against a conflicting writer, producing a data race whose outcome depends on thread timing. That is not a crash — it is a silent lockstep desync, and the worker-count gate (below) catches it only probabilistically. See [systems.md](systems.md) and [scheduling.md](scheduling.md). -The same rule covers `ChunkSystem` (`src/openvic-simulation/ecs/ChunkSystem.hpp`) — it has no per-row tick parameter pack, so the access set is declared by the `Cs...` template list instead, with identical inference: `C const` is Read, `C` is Write. Only where you write the declaration moves; the contract is the same. +The same rule covers `ChunkSystem` (`src/openvic-simulation/core/ecs/ChunkSystem.hpp`) — it has no per-row tick parameter pack, so the access set is declared by the `Cs...` template list instead, with identical inference: `C const` is Read, `C` is Write. Only where you write the declaration moves; the contract is the same. ### **Singleton access inside a tick MUST be declared, and every singleton must exist before the first `tick_systems`.** @@ -312,7 +312,7 @@ static bool should_run(TickContext const& ctx); WHY: the scheduler evaluates `should_run` exactly once per tick, on the main thread, at the start of the system's stage. `false` skips dispatch for this tick only — the system still occupies its stage, its ordering/conflict edges still constrain co-staged systems, and `schedule_hash` is untouched. That makes it the lockstep-safe way to do cadence gating; registering/unregistering systems per tick would churn `schedule_hash` (the multiplayer handshake value) instead. -The determinism contract (stated in full in `src/openvic-simulation/ecs/System.hpp`): `should_run` must be a pure function of `ctx.today` and singletons read via `ctx.world`. Reading wall-clock, thread ids, RNG, or any per-machine state desyncs lockstep — and the scheduler cannot check purity. Do not write through `ctx.cmd` or `ctx.world`; the context is for reads only. Singleton reads inside `should_run` need **no** `extra_reads()` declaration: it runs on the main thread while no workers run, observing the previous stage's barrier state. +The determinism contract (stated in full in `src/openvic-simulation/core/ecs/System.hpp`): `should_run` must be a pure function of `ctx.today` and singletons read via `ctx.world`. Reading wall-clock, thread ids, RNG, or any per-machine state desyncs lockstep — and the scheduler cannot check purity. Do not write through `ctx.cmd` or `ctx.world`; the context is for reads only. Singleton reads inside `should_run` need **no** `extra_reads()` declaration: it runs on the main thread while no workers run, observing the previous stage's barrier state. It must be `static` (systems are stateless — next rule); a member function, data member, wrong-signature variant, or overload set with a candidate callable with `TickContext const&` hard-fails registration via `static_assert` rather than being silently ignored. The one accepted hole (documented in `System.hpp`): an overload set in which **no** candidate is callable with `TickContext const&` fails both detection probes, reads as absent, and silently behaves as "always run". @@ -334,7 +334,7 @@ WHY: system instances are not serialized. Anything you store on the system objec ### **Register every phase anchor — unmatched `run_after` / `run_before` ids are silently ignored.** -WHY (scheduler contract, documented in `src/openvic-simulation/ecs/SystemPhase.hpp`): `declared_run_after` / `declared_run_before` ids that match no **registered** system are dropped without error. A phase anchor you declared with `ECS_PHASE_ANCHOR` but forgot to `world.register_system<...>()` makes every edge through it vanish — systems that were supposed to be ordered now schedule freely. Register every anchor; order doesn't matter (the DAG sorts registration order out). +WHY (scheduler contract, documented in `src/openvic-simulation/core/ecs/SystemPhase.hpp`): `declared_run_after` / `declared_run_before` ids that match no **registered** system are dropped without error. A phase anchor you declared with `ECS_PHASE_ANCHOR` but forgot to `world.register_system<...>()` makes every edge through it vanish — systems that were supposed to be ordered now schedule freely. Register every anchor; order doesn't matter (the DAG sorts registration order out). Three related hard rules from the same header: @@ -355,7 +355,7 @@ template void parallel_for(std::size_t chunk_count, Body&& body); // BLOCKING ``` -(`src/openvic-simulation/ecs/EcsThreadPool.hpp` — hard invariant: "`parallel_for` is blocking — does not return until every chunk's body has run.") +(`src/openvic-simulation/core/ecs/EcsThreadPool.hpp` — hard invariant: "`parallel_for` is blocking — does not return until every chunk's body has run.") WHY: the scheduler already dispatches the outer `parallel_for` around your stage — your tick body is (in general) *already running on a pool worker*. An inner `parallel_for` queues jobs and then blocks that worker waiting for them; the inner jobs sit unowned until **some other** worker picks them up. If every worker is in the same situation, nobody is left to run anything: deadlock. @@ -377,7 +377,7 @@ WHY: chunks of a `SystemThreaded` run concurrently. Any shared mutable state — ### **Keep tick bodies noexcept — a throw terminates the process.** -WHY: pool invariant (`src/openvic-simulation/ecs/EcsThreadPool.hpp`): "No work is ever silently dropped; bodies that throw will std::terminate (we do not guarantee exception-safety from inside system bodies — they should be noexcept)." There is no recovery path; handle failure as data (error components, logged skips), not exceptions. +WHY: pool invariant (`src/openvic-simulation/core/ecs/EcsThreadPool.hpp`): "No work is ever silently dropped; bodies that throw will std::terminate (we do not guarantee exception-safety from inside system bodies — they should be noexcept)." There is no recovery path; handle failure as data (error components, logged skips), not exceptions. ### **Never key results off `worker_id`.** @@ -412,7 +412,7 @@ uint32_t allocate(); void release(uint32_t slot); ``` -WHY (determinism contract, `src/openvic-simulation/ecs/DenseSlotAllocator.hpp`): the allocation order is a pure function of the alloc/release **call sequence** — LIFO reuse of released slots, then high-water growth. Inside a `SystemThreaded` tick the execution order is worker-count-dependent, so the call sequence (and therefore every slot assignment) differs per machine: a lockstep desync. Call `allocate` / `release` only from serial code — plain `System<>` tick bodies, `CommandBuffer`-apply-adjacent serial code, or outside ticks entirely. Same discipline as the deferred-create path: structural decisions funnel through a serial point. +WHY (determinism contract, `src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp`): the allocation order is a pure function of the alloc/release **call sequence** — LIFO reuse of released slots, then high-water growth. Inside a `SystemThreaded` tick the execution order is worker-count-dependent, so the call sequence (and therefore every slot assignment) differs per machine: a lockstep desync. Call `allocate` / `release` only from serial code — plain `System<>` tick bodies, `CommandBuffer`-apply-adjacent serial code, or outside ticks entirely. Same discipline as the deferred-create path: structural decisions funnel through a serial point. ### **Structural mutation order is deterministic because you used `ctx.cmd` — here is the order you can rely on.** @@ -421,8 +421,8 @@ Per stage: each system's pending `CommandBuffer` is applied at the stage barrier Working example (adapted from the deferred-create cases in `tests/src/ecs/WorkerCountInvariance.cpp`): ```cpp -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/World.hpp" using namespace OpenVic::ecs; using OpenVic::Date; @@ -498,10 +498,10 @@ Separately from legality: recreate in **slot-index ascending order** — the can ### **The name literal in `ECS_COMPONENT` / `ECS_SYSTEM` IS the persistent identity — globally unique, stable, namespace scope.** ```cpp -// src/openvic-simulation/ecs/ComponentTypeID.hpp: +// src/openvic-simulation/core/ecs/ComponentTypeID.hpp: ECS_COMPONENT(Type, NameLiteral) // component_type_id_of() == fnv1a_64(NameLiteral) -// src/openvic-simulation/ecs/SystemTypeID.hpp: +// src/openvic-simulation/core/ecs/SystemTypeID.hpp: ECS_SYSTEM(Type) // system_type_id_of() == fnv1a_64(#Type) — the macro stringifies // its argument, so the qualified type name you pass IS the literal ``` diff --git a/docs/ecs/queries.md b/docs/ecs/queries.md index ea497c620..91517e38b 100644 --- a/docs/ecs/queries.md +++ b/docs/ecs/queries.md @@ -6,7 +6,7 @@ Queries match **archetypes, not individual entities**. An entity is visited if a ## Building a `Query` -Defined in src/openvic-simulation/ecs/Query.hpp: +Defined in src/openvic-simulation/core/ecs/Query.hpp: ```cpp struct Query { @@ -44,7 +44,7 @@ Reuse built queries where you can: it skips the (small) re-sort, and it makes th ### Determinism -Component ids are compile-time FNV-1a hashes of the `ECS_COMPONENT` name literal (src/openvic-simulation/ecs/ComponentTypeID.hpp), so they are byte-identical across builds, platforms and machines. `build()`'s sorted order, query equality, and the `World`'s cache keys are therefore all stable — a query built on one multiplayer peer means exactly the same thing on another. See [determinism.md](determinism.md). +Component ids are compile-time FNV-1a hashes of the `ECS_COMPONENT` name literal (src/openvic-simulation/core/ecs/ComponentTypeID.hpp), so they are byte-identical across builds, platforms and machines. `build()`'s sorted order, query equality, and the `World`'s cache keys are therefore all stable — a query built on one multiplayer peer means exactly the same thing on another. See [determinism.md](determinism.md). ## Matcher semantics @@ -71,7 +71,7 @@ You never compute or compare matcher hashes in game code. ## Iterating with a query: the `for_each` family -All six variants live on `World` (src/openvic-simulation/ecs/World.hpp): +All six variants live on `World` (src/openvic-simulation/core/ecs/World.hpp): ```cpp // Visit every entity whose archetype contains all of Cs..., calling fn(C&...) per row. @@ -159,11 +159,11 @@ int64_t total_wealth(ecs::World& world, ecs::Query const& q) { } ``` -(`ChunkView` is defined in src/openvic-simulation/ecs/ChunkView.hpp; it is the same type `ChunkSystem` hands to `tick_chunk` — see [systems.md](systems.md).) +(`ChunkView` is defined in src/openvic-simulation/core/ecs/ChunkView.hpp; it is the same type `ChunkSystem` hands to `tick_chunk` — see [systems.md](systems.md).) ## System filters: `Filter` and `Without` -Systems don't construct `Query` objects by hand. A system's **require** set comes from its tick parameter pack (`System<>` / `SystemThreaded<>`) or its template component list (`ChunkSystem<>`). To add an **exclude** set, declare a `Filters` member alias using the vocabulary in src/openvic-simulation/ecs/QueryFilter.hpp: +Systems don't construct `Query` objects by hand. A system's **require** set comes from its tick parameter pack (`System<>` / `SystemThreaded<>`) or its template component list (`ChunkSystem<>`). To add an **exclude** set, declare a `Filters` member alias using the vocabulary in src/openvic-simulation/core/ecs/QueryFilter.hpp: ```cpp // Exclusion marker: archetypes containing C are not iterated. @@ -242,9 +242,9 @@ The consolidated list lives in [pitfalls.md](pitfalls.md). ## Source files -- src/openvic-simulation/ecs/Query.hpp — `Query` builder. -- src/openvic-simulation/ecs/QueryFilter.hpp — `Filter`, `Without`, `system_filters_t`. -- src/openvic-simulation/ecs/World.hpp — `for_each` family, query-cache key types. -- src/openvic-simulation/ecs/ChunkView.hpp — `ChunkView` passed to `for_each_chunk`. -- src/openvic-simulation/ecs/ComponentTypeID.hpp — stable FNV component ids underpinning query determinism. +- src/openvic-simulation/core/ecs/Query.hpp — `Query` builder. +- src/openvic-simulation/core/ecs/QueryFilter.hpp — `Filter`, `Without`, `system_filters_t`. +- src/openvic-simulation/core/ecs/World.hpp — `for_each` family, query-cache key types. +- src/openvic-simulation/core/ecs/ChunkView.hpp — `ChunkView` passed to `for_each_chunk`. +- src/openvic-simulation/core/ecs/ComponentTypeID.hpp — stable FNV component ids underpinning query determinism. - Tests: tests/src/ecs/Query.cpp, tests/src/ecs/Iteration.cpp, tests/src/ecs/MatcherHash.cpp, tests/src/ecs/SystemFilters.cpp. diff --git a/docs/ecs/scheduling.md b/docs/ecs/scheduling.md index 89119174c..919b7a337 100644 --- a/docs/ecs/scheduling.md +++ b/docs/ecs/scheduling.md @@ -17,7 +17,7 @@ void tick_systems(Date today); void clear_systems(); ``` -(All on `World` — see src/openvic-simulation/ecs/World.hpp and world.md.) +(All on `World` — see src/openvic-simulation/core/ecs/World.hpp and world.md.) Each `world.tick_systems(today)` call: @@ -41,8 +41,8 @@ static constexpr std::array declared_run_before(); Each entry is a `system_type_id_of()`. `declared_run_after` makes this system run in a strictly later stage than each listed system; `declared_run_before` is the mirror image. Both directions exist so a system can insert itself relative to systems it does not own. ```cpp -#include "openvic-simulation/ecs/SystemImpl.hpp" // required in the TU that calls register_system -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" // required in the TU that calls register_system +#include "openvic-simulation/core/ecs/World.hpp" using namespace OpenVic::ecs; @@ -84,7 +84,7 @@ void register_tick(World& world) { Rules and contracts: - **Edges to unregistered systems are silently ignored.** `run_after` / `run_before` ids that match no *registered* system simply vanish — there is no error. The classic footgun is a phase anchor you declared but forgot to `world.register_system()`: every edge through it disappears and your "ordered" pipeline quietly flattens. Register every system you reference, in any order. -- The statics must be `constexpr` and the listed types need `ECS_SYSTEM` identities (see src/openvic-simulation/ecs/SystemTypeID.hpp). A missing `ECS_SYSTEM(Type)` is a clear compile error ("incomplete type `SystemName`"). +- The statics must be `constexpr` and the listed types need `ECS_SYSTEM` identities (see src/openvic-simulation/core/ecs/SystemTypeID.hpp). A missing `ECS_SYSTEM(Type)` is a clear compile error ("incomplete type `SystemName`"). - Edges only constrain *stage order*; they never weaken conflict detection. Two systems can be both edge-ordered and conflicting — that is fine and common. ## Automatic conflict resolution from declared access @@ -201,7 +201,7 @@ struct PhaseAnchorSystem : System { }; ``` -The canonical base for a hand-written anchor (src/openvic-simulation/ecs/SystemPhase.hpp). Do **not** try to write an anchor as a bare `System` with an empty tick: an empty component pack does not compile through the default dispatch path, and even if it did, an empty require set would match *every* archetype. `PhaseAnchorSystem` shadows `tick_all` so an anchor's "execution" is a true no-op — no query is built, no rows are touched, and `declared_access()` derives an empty access set. +The canonical base for a hand-written anchor (src/openvic-simulation/core/ecs/SystemPhase.hpp). Do **not** try to write an anchor as a bare `System` with an empty tick: an empty component pack does not compile through the default dispatch path, and even if it did, an empty require set would match *every* archetype. `PhaseAnchorSystem` shadows `tick_all` so an anchor's "execution" is a true no-op — no query is built, no rows are touched, and `declared_access()` derives an empty access set. ### `ECS_PHASE_ANCHOR_FIRST` / `ECS_PHASE_ANCHOR` @@ -236,9 +236,9 @@ Rules: Adapted from tests/src/ecs/SystemPhaseAnchors.cpp: ```cpp -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemPhase.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemPhase.hpp" +#include "openvic-simulation/core/ecs/World.hpp" using namespace OpenVic::ecs; @@ -306,15 +306,15 @@ Note that `FactoryProduceSystem` (writes `FactoryOutput`) and `OfferMatchSystem` - Register once at startup; gate cadence with `should_run`, never with re-registration. - Never nest `parallel_for` inside a tick body. - Renaming a system's `ECS_SYSTEM` string changes its identity and the `schedule_hash` — a breaking change for saves, replays, and the multiplayer handshake. -- The TU that calls `register_system` must include `openvic-simulation/ecs/SystemImpl.hpp` (registration instantiates the iteration drivers defined there); do not otherwise depend on its contents. +- The TU that calls `register_system` must include `openvic-simulation/core/ecs/SystemImpl.hpp` (registration instantiates the iteration drivers defined there); do not otherwise depend on its contents. ## Source files -- src/openvic-simulation/ecs/SystemScheduler.hpp — `SystemScheduler`, `ScheduledStage`, `schedule_hash` -- src/openvic-simulation/ecs/SystemScheduler.cpp — DAG build, auto-orientation, disjoint-iteration override, stage execution -- src/openvic-simulation/ecs/SystemPhase.hpp — `PhaseAnchorSystem`, `ECS_PHASE_ANCHOR_FIRST`, `ECS_PHASE_ANCHOR`, `ECS_IN_PHASE` -- src/openvic-simulation/ecs/System.hpp — `System`, `SystemThreaded`, `declared_run_after` / `declared_run_before`, `extra_reads` / `extra_writes`, `should_run` contract -- src/openvic-simulation/ecs/SystemAccess.hpp — `AccessMode`, `ComponentAccess`, conflict definition -- src/openvic-simulation/ecs/SystemTypeID.hpp — `system_type_id_of`, `ECS_SYSTEM` -- src/openvic-simulation/ecs/World.hpp — `register_system`, `tick_systems`, `schedule_hash`, `set_serial_mode`, `set_ecs_worker_count` +- src/openvic-simulation/core/ecs/SystemScheduler.hpp — `SystemScheduler`, `ScheduledStage`, `schedule_hash` +- src/openvic-simulation/core/ecs/SystemScheduler.cpp — DAG build, auto-orientation, disjoint-iteration override, stage execution +- src/openvic-simulation/core/ecs/SystemPhase.hpp — `PhaseAnchorSystem`, `ECS_PHASE_ANCHOR_FIRST`, `ECS_PHASE_ANCHOR`, `ECS_IN_PHASE` +- src/openvic-simulation/core/ecs/System.hpp — `System`, `SystemThreaded`, `declared_run_after` / `declared_run_before`, `extra_reads` / `extra_writes`, `should_run` contract +- src/openvic-simulation/core/ecs/SystemAccess.hpp — `AccessMode`, `ComponentAccess`, conflict definition +- src/openvic-simulation/core/ecs/SystemTypeID.hpp — `system_type_id_of`, `ECS_SYSTEM` +- src/openvic-simulation/core/ecs/World.hpp — `register_system`, `tick_systems`, `schedule_hash`, `set_serial_mode`, `set_ecs_worker_count` - Tests: tests/src/ecs/SystemScheduler_DAG.cpp, tests/src/ecs/SystemScheduler_Conflicts.cpp, tests/src/ecs/SystemSchedulerDisjointWriters.cpp, tests/src/ecs/SystemSchedulerSingletonWrites.cpp, tests/src/ecs/SystemPhaseAnchors.cpp, tests/src/ecs/MultiSystemMixedStage.cpp diff --git a/docs/ecs/storage-model.md b/docs/ecs/storage-model.md index f7dc9496d..dd4e50a25 100644 --- a/docs/ecs/storage-model.md +++ b/docs/ecs/storage-model.md @@ -33,7 +33,7 @@ template void for_each_chunk(Query const& query, Fn&& fn); ``` -(`src/openvic-simulation/ecs/World.hpp`.) The callback receives one `ChunkView` per non-empty chunk of every matched archetype. Inserting `chunk_capacity + 1` entities observably produces two views — the first full, the second with one row (from `tests/src/ecs/ChunkOverflow.cpp`): +(`src/openvic-simulation/core/ecs/World.hpp`.) The callback receives one `ChunkView` per non-empty chunk of every matched archetype. Inserting `chunk_capacity + 1` entities observably produces two views — the first full, the second with one row (from `tests/src/ecs/ChunkOverflow.cpp`): ```cpp struct Heavy { @@ -83,7 +83,7 @@ template bool remove_component(EntityID id); ``` -(`src/openvic-simulation/ecs/World.hpp`.) Because an archetype *is* its component set, adding or removing a component cannot happen in place — the entity must move to a different archetype. One `add_component` call does all of this: +(`src/openvic-simulation/core/ecs/World.hpp`.) Because an archetype *is* its component set, adding or removing a component cannot happen in place — the entity must move to a different archetype. One `add_component` call does all of this: 1. Builds the target signature (`current ∪ {C}` or `current ∖ {C}`) and looks up — or **creates** — the target archetype. Creating a new archetype bumps the internal archetype epoch, invalidating every cached query result. 2. Reserves a row in the target (possibly allocating a fresh 16 KB chunk). @@ -160,7 +160,7 @@ struct ChunkView { }; ``` -(`src/openvic-simulation/ecs/ChunkView.hpp`.) A `ChunkView` wraps a single chunk's slabs: the `EntityID` array plus one typed component-array pointer per `Cs...`. All arrays share the same length, `count()`. You receive one in two places: +(`src/openvic-simulation/core/ecs/ChunkView.hpp`.) A `ChunkView` wraps a single chunk's slabs: the `EntityID` array plus one typed component-array pointer per `Cs...`. All arrays share the same length, `count()`. You receive one in two places: - `World::for_each_chunk(fn)` / `for_each_chunk(query, fn)` callbacks, and - a `ChunkSystem`'s `tick_chunk(ChunkView view, TickContext const& ctx)` — the chunk-granular system base for tight inner loops (see [systems.md](systems.md)). @@ -219,11 +219,11 @@ What the storage guarantees about iteration order (`for_each`, `for_each_with_en - Matched archetypes are visited in archetype-creation order, chunks left to right, rows `0..count-1`. Given an identical history of operations, this order is bit-identical across runs and machines — chunk iteration is deterministic *within* a run lineage. - **Row order is creation order until the first removal in that archetype** — swap-pop compaction then permutes it. Bulk creation (`create_entities`, see [entities.md](entities.md)) packs its batch into contiguous row ranges, identical to the equivalent `create_entity` loop. - **Packing is not saved state.** After a save/load round-trip the identity layer (ids, generations, free-list) is reproduced exactly, but row/chunk packing may legitimately differ from the never-saved run. Therefore: anything *id-assignment-sensitive* (e.g. loops issuing `cmd.create_entity` calls where the resulting id assignment matters) must iterate in id / dense-index order, never chunk order. Per-row independent reads/writes are unaffected — for them chunk order genuinely doesn't matter. See [determinism.md](determinism.md) and [world.md](world.md). -- **Key locality is a heuristic you create, not an invariant the storage maintains.** Because consecutive creations occupy consecutive rows, creating entities grouped by some key at setup time yields chunks whose rows are grouped by that key. `reductions::parallel_keyed_sum` (namespace `OpenVic::ecs::reductions`, `src/openvic-simulation/ecs/Reductions.hpp`) is built to exploit exactly this grouping, but swap-pop removals erode it over time. Code must stay *correct* for arbitrary row order and merely *faster* when locality holds. See [threading-and-reductions.md](threading-and-reductions.md). +- **Key locality is a heuristic you create, not an invariant the storage maintains.** Because consecutive creations occupy consecutive rows, creating entities grouped by some key at setup time yields chunks whose rows are grouped by that key. `reductions::parallel_keyed_sum` (namespace `OpenVic::ecs::reductions`, `src/openvic-simulation/core/ecs/Reductions.hpp`) is built to exploit exactly this grouping, but swap-pop removals erode it over time. Code must stay *correct* for arbitrary row order and merely *faster* when locality holds. See [threading-and-reductions.md](threading-and-reductions.md). ## Chunk memory reuse (`ChunkPool`) -Each `World` owns a `ChunkPool` of 16 KB blocks (`src/openvic-simulation/ecs/ChunkPool.hpp`). You never need to call it from game code — it exists so the storage rules above stay cheap: +Each `World` owns a `ChunkPool` of 16 KB blocks (`src/openvic-simulation/core/ecs/ChunkPool.hpp`). You never need to call it from game code — it exists so the storage rules above stay cheap: - Dropped chunks go back to the pool and are handed out LIFO, so an archetype of transient per-tick entities that drains and refills every tick reuses warm memory with **zero** steady-state allocations — verified in `tests/src/ecs/ChunkPool.cpp` ("Ping-pong create/destroy reuses pooled chunks"). Blocks are interchangeable across archetypes. - The cache is capped at `MAX_POOL_SIZE` (64) blocks, and blocks idle for more than `AGE_THRESHOLD_TICKS` (256) ticks are returned to the OS (`tick_systems` advances the aging clock). Aging affects memory residency only — never simulation results. @@ -232,10 +232,10 @@ Each `World` owns a `ChunkPool` of 16 KB blocks (`src/openvic-simulation/ecs/Chu ## Source files -- `src/openvic-simulation/ecs/Archetype.hpp` — archetype, columns, row reservation, swap-pop -- `src/openvic-simulation/ecs/Chunk.hpp` — `DataChunk`, `CHUNK_BLOCK_BYTES`, `CHUNK_BLOCK_ALIGN`, `OV_RESTRICT`, block layout -- `src/openvic-simulation/ecs/ChunkPool.hpp` — block pool, cap, aging -- `src/openvic-simulation/ecs/ChunkView.hpp` — the user-facing chunk window -- `src/openvic-simulation/ecs/ChunkSystem.hpp` — chunk-granular system base (`tick_chunk`) -- `src/openvic-simulation/ecs/World.hpp` — `create_entity`, `add_component`, `remove_component`, `component_version_in`, `for_each_chunk` +- `src/openvic-simulation/core/ecs/Archetype.hpp` — archetype, columns, row reservation, swap-pop +- `src/openvic-simulation/core/ecs/Chunk.hpp` — `DataChunk`, `CHUNK_BLOCK_BYTES`, `CHUNK_BLOCK_ALIGN`, `OV_RESTRICT`, block layout +- `src/openvic-simulation/core/ecs/ChunkPool.hpp` — block pool, cap, aging +- `src/openvic-simulation/core/ecs/ChunkView.hpp` — the user-facing chunk window +- `src/openvic-simulation/core/ecs/ChunkSystem.hpp` — chunk-granular system base (`tick_chunk`) +- `src/openvic-simulation/core/ecs/World.hpp` — `create_entity`, `add_component`, `remove_component`, `component_version_in`, `for_each_chunk` - Tests: `tests/src/ecs/Archetype.cpp`, `tests/src/ecs/Chunk.cpp`, `tests/src/ecs/ChunkPool.cpp`, `tests/src/ecs/ChunkView.cpp`, `tests/src/ecs/ChunkMigration.cpp`, `tests/src/ecs/ChunkOverflow.cpp`, `tests/src/ecs/Migration.cpp` diff --git a/docs/ecs/systems.md b/docs/ecs/systems.md index aee71cf6f..bca755d1d 100644 --- a/docs/ecs/systems.md +++ b/docs/ecs/systems.md @@ -16,7 +16,7 @@ All three share the same metadata surface: `declared_run_after()` / `declared_ru Multi-system stages mix `System<>` and `SystemThreaded` freely — the scheduler builds one flat work-item list across every system in a stage and dispatches it via a single outer `parallel_for`. There is no "threaded system silently falls back to serial inside a shared stage" footgun. -**Include rule:** a translation unit that defines a concrete system and registers it must include `openvic-simulation/ecs/SystemImpl.hpp` (which pulls in `World.hpp` and `System.hpp`) — the templated iteration drivers are defined there and must be visible at the point `register_system` instantiates them. `ChunkSystem.hpp` already includes it. Do not rely on or document anything *inside* `SystemImpl.hpp`; it is internal. +**Include rule:** a translation unit that defines a concrete system and registers it must include `openvic-simulation/core/ecs/SystemImpl.hpp` (which pulls in `World.hpp` and `System.hpp`) — the templated iteration drivers are defined there and must be visible at the point `register_system` instantiates them. `ChunkSystem.hpp` already includes it. Do not rely on or document anything *inside* `SystemImpl.hpp`; it is internal. ## The tick signature is the access declaration @@ -50,9 +50,9 @@ Tag (zero-size) components may appear in the pack to narrow the iteration; the r Adapted from `tests/src/ecs/SystemSchedulerSingletonWrites.cpp` and `tests/src/ecs/SystemShouldRun.cpp`: ```cpp -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic { struct Treasury { @@ -285,7 +285,7 @@ struct TickContext { ``` - `today` — the simulation date for this tick. The only clock a system may consult (wall-clock reads break determinism). -- `cmd` — the system's `CommandBuffer` for **all structural mutations**: `ctx.cmd.create_entity(ctx.world, Cs {...}...)`, `ctx.cmd.destroy_entity(eid)`, `ctx.cmd.add_component(eid, ...)`, `ctx.cmd.remove_component(eid)`. Ops are deferred and applied at the stage barrier, in the stage's deterministic order across its systems (ascending `system_type_id_t` — see [scheduling.md](scheduling.md)). For `SystemThreaded`, `cmd` refers to a *per-chunk* buffer; the per-chunk buffers are merged in `chunk_idx` ascending order before apply, which is what makes spawn order deterministic and identical across all worker counts (pinned by `tests/src/ecs/SystemThreadedSpawn.cpp`). Calling `ctx.cmd.*` requires including `openvic-simulation/ecs/CommandBuffer.hpp` in your system's TU; details in [command-buffer.md](command-buffer.md). +- `cmd` — the system's `CommandBuffer` for **all structural mutations**: `ctx.cmd.create_entity(ctx.world, Cs {...}...)`, `ctx.cmd.destroy_entity(eid)`, `ctx.cmd.add_component(eid, ...)`, `ctx.cmd.remove_component(eid)`. Ops are deferred and applied at the stage barrier, in the stage's deterministic order across its systems (ascending `system_type_id_t` — see [scheduling.md](scheduling.md)). For `SystemThreaded`, `cmd` refers to a *per-chunk* buffer; the per-chunk buffers are merged in `chunk_idx` ascending order before apply, which is what makes spawn order deterministic and identical across all worker counts (pinned by `tests/src/ecs/SystemThreadedSpawn.cpp`). Calling `ctx.cmd.*` requires including `openvic-simulation/core/ecs/CommandBuffer.hpp` in your system's TU; details in [command-buffer.md](command-buffer.md). - `world` — read access to everything: `get_component` / `has_component` / `get_singleton` / `is_alive` / `is_immutable`. Two hard rules: 1. **Never structurally mutate `ctx.world` from inside a tick.** `World::create_entity`, `destroy_entity`, `add_component` and `remove_component` are guarded during `tick_systems` — they are refused as no-ops (returning a null/false result) with an error log rather than corrupting concurrent iteration. `ctx.cmd` is the only mutation path. 2. **Every non-iterated read or write through `ctx.world` must be declared** via `extra_reads()` / `extra_writes()` as described above. Writing through a `get_component` pointer on a row you iterate is fine only if that component is in your tick pack as `C&`. @@ -402,11 +402,11 @@ For the storage model behind chunks and why this layout is fast, see [storage-mo ## Source files -- `src/openvic-simulation/ecs/System.hpp` — `System`, `SystemThreaded`, `TickContext`, `SystemHandle`, `should_run` traits and contract -- `src/openvic-simulation/ecs/SystemAccess.hpp` — `AccessMode`, `ComponentAccess`, access-set merge helpers -- `src/openvic-simulation/ecs/ChunkSystem.hpp` — `ChunkSystem` -- `src/openvic-simulation/ecs/ChunkView.hpp` — `ChunkView` -- `src/openvic-simulation/ecs/QueryFilter.hpp` — `Filter`, `Without`, the `Filters` alias machinery -- `src/openvic-simulation/ecs/SystemTypeID.hpp` — `system_type_id_t`, `system_type_id_of`, `ECS_SYSTEM` -- `src/openvic-simulation/ecs/World.hpp` — `register_system`, `unregister_system`, `tick_systems`, `clear_systems`, `schedule_hash` +- `src/openvic-simulation/core/ecs/System.hpp` — `System`, `SystemThreaded`, `TickContext`, `SystemHandle`, `should_run` traits and contract +- `src/openvic-simulation/core/ecs/SystemAccess.hpp` — `AccessMode`, `ComponentAccess`, access-set merge helpers +- `src/openvic-simulation/core/ecs/ChunkSystem.hpp` — `ChunkSystem` +- `src/openvic-simulation/core/ecs/ChunkView.hpp` — `ChunkView` +- `src/openvic-simulation/core/ecs/QueryFilter.hpp` — `Filter`, `Without`, the `Filters` alias machinery +- `src/openvic-simulation/core/ecs/SystemTypeID.hpp` — `system_type_id_t`, `system_type_id_of`, `ECS_SYSTEM` +- `src/openvic-simulation/core/ecs/World.hpp` — `register_system`, `unregister_system`, `tick_systems`, `clear_systems`, `schedule_hash` - Tests with working examples: `tests/src/ecs/System.cpp`, `tests/src/ecs/SystemAccess.cpp`, `tests/src/ecs/ChunkSystem.cpp`, `tests/src/ecs/SystemShouldRun.cpp`, `tests/src/ecs/SystemFilters.cpp`, `tests/src/ecs/SystemThreadedSpawn.cpp`, `tests/src/ecs/SystemSchedulerSingletonWrites.cpp` diff --git a/docs/ecs/threading-and-reductions.md b/docs/ecs/threading-and-reductions.md index 0f0d54595..1b6c3d386 100644 --- a/docs/ecs/threading-and-reductions.md +++ b/docs/ecs/threading-and-reductions.md @@ -95,7 +95,7 @@ Two details that make this rule easy to violate without noticing: ## `EcsThreadPool` reference -Defined in `src/openvic-simulation/ecs/EcsThreadPool.hpp`. This is the dedicated pool for ECS scheduler dispatch — intentionally separate from `OpenVic::ThreadPool` (which serves un-migrated production-tick / market-clearing code) so neither side disturbs the other. From game code you normally only ever *pass it along* (to `reductions::*`); you rarely construct one outside tests. +Defined in `src/openvic-simulation/core/ecs/EcsThreadPool.hpp`. This is the dedicated pool for ECS scheduler dispatch — intentionally separate from `OpenVic::ThreadPool` (which serves un-migrated production-tick / market-clearing code) so neither side disturbs the other. From game code you normally only ever *pass it along* (to `reductions::*`); you rarely construct one outside tests. ```cpp explicit EcsThreadPool(uint32_t worker_count); @@ -131,7 +131,7 @@ Runs each supplied function exactly once across the pool; blocking. A general-pu ## Reductions -Header: `src/openvic-simulation/ecs/Reductions.hpp`, namespace `OpenVic::ecs::reductions`. +Header: `src/openvic-simulation/core/ecs/Reductions.hpp`, namespace `OpenVic::ecs::reductions`. The pattern all four helpers share: each chunk's body writes its partial result into a **`chunk_idx`-indexed slot** — no atomics, no shared mutable state during the parallel section — then, after the parallel section joins, the per-chunk results are folded **sequentially in `chunk_idx` ascending order**. The only operation order that affects the output is that sequential fold, which is independent of the pool — so the result is bit-identical regardless of `worker_count`. This is the project-sanctioned replacement for "loop over everything with an atomic accumulator", which is both contended and non-deterministic for non-associative arithmetic. @@ -159,8 +159,8 @@ T parallel_max(EcsThreadPool& pool, std::size_t chunk_count, T init, Body&& body Adapted from `tests/src/ecs/Reductions.cpp`: ```cpp -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/Reductions.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/Reductions.hpp" using namespace OpenVic::ecs; @@ -230,8 +230,8 @@ Adapted from `tests/src/ecs/KeyedReductions.cpp` (the `fixed_point_t` worker-cou ```cpp #include "openvic-simulation/core/object/FixedPoint.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/Reductions.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/Reductions.hpp" using namespace OpenVic::ecs; using OpenVic::fixed_point_t; @@ -269,8 +269,8 @@ The threading-relevant rules, with rationale (full treatment in [determinism.md] ## Source files -- `src/openvic-simulation/ecs/EcsThreadPool.hpp` / `src/openvic-simulation/ecs/EcsThreadPool.cpp` — the pool: `parallel_for`, `run_concurrent`, invariants. -- `src/openvic-simulation/ecs/Reductions.hpp` — `parallel_sum`, `parallel_min`, `parallel_max`, `parallel_keyed_sum`, `KeyedEmitter`, `KeyedSumScratch`. -- `src/openvic-simulation/ecs/World.hpp` — `set_ecs_worker_count`, `ecs_thread_pool`, `set_serial_mode`. -- `src/openvic-simulation/ecs/System.hpp` — `SystemThreaded`, the `extra_writes` restriction. +- `src/openvic-simulation/core/ecs/EcsThreadPool.hpp` / `src/openvic-simulation/core/ecs/EcsThreadPool.cpp` — the pool: `parallel_for`, `run_concurrent`, invariants. +- `src/openvic-simulation/core/ecs/Reductions.hpp` — `parallel_sum`, `parallel_min`, `parallel_max`, `parallel_keyed_sum`, `KeyedEmitter`, `KeyedSumScratch`. +- `src/openvic-simulation/core/ecs/World.hpp` — `set_ecs_worker_count`, `ecs_thread_pool`, `set_serial_mode`. +- `src/openvic-simulation/core/ecs/System.hpp` — `SystemThreaded`, the `extra_writes` restriction. - Tests: `tests/src/ecs/EcsThreadPool.cpp`, `tests/src/ecs/Reductions.cpp`, `tests/src/ecs/KeyedReductions.cpp`, `tests/src/ecs/IntraSystemParallel.cpp`, `tests/src/ecs/WorkerCountInvariance.cpp`. diff --git a/docs/ecs/world.md b/docs/ecs/world.md index 59577aff7..c7b202cf3 100644 --- a/docs/ecs/world.md +++ b/docs/ecs/world.md @@ -268,7 +268,7 @@ struct SystemHandle { inline constexpr SystemHandle INVALID_SYSTEM_HANDLE = {}; ``` -Defined in src/openvic-simulation/ecs/System.hpp. `is_valid()` only distinguishes a default-constructed handle (`INVALID_SYSTEM_HANDLE`, generation 0) from one actually returned by `register_system` — it does **not** detect staleness, so a handle whose system was since unregistered still returns `true`. Staleness is caught by `unregister_system` itself: destroying a system bumps the registry slot's generation, and an incoming handle is checked against the slot's alive flag and current generation, so a second `unregister_system` with a stale handle is a safe no-op instead of touching the wrong slot. Don't use `handle.is_valid()` to ask "is this system still registered?" — there is no API for that; just hand the handle to `unregister_system` when you're done with it. +Defined in src/openvic-simulation/core/ecs/System.hpp. `is_valid()` only distinguishes a default-constructed handle (`INVALID_SYSTEM_HANDLE`, generation 0) from one actually returned by `register_system` — it does **not** detect staleness, so a handle whose system was since unregistered still returns `true`. Staleness is caught by `unregister_system` itself: destroying a system bumps the registry slot's generation, and an incoming handle is checked against the slot's alive flag and current generation, so a second `unregister_system` with a stale handle is a safe no-op instead of touching the wrong slot. Don't use `handle.is_valid()` to ask "is this system still registered?" — there is no API for that; just hand the handle to `unregister_system` when you're done with it. ```cpp void unregister_system(SystemHandle handle); @@ -534,17 +534,17 @@ bool load_session(World& restored, WorldIdentitySnapshot const& snap, std::vecto } ``` -After a correct restore, `digest(tick^k(restore(snapshot(s)))) == digest(tick^k(s))` at every worker count — that equality is enforced by tests/src/ecs/IdentitySnapshotInvariance.cpp. Full-state checksums (`world_checksum` in src/openvic-simulation/ecs/Checksum.hpp) are covered in [determinism.md](determinism.md). +After a correct restore, `digest(tick^k(restore(snapshot(s)))) == digest(tick^k(s))` at every worker count — that equality is enforced by tests/src/ecs/IdentitySnapshotInvariance.cpp. Full-state checksums (`world_checksum` in src/openvic-simulation/core/ecs/Checksum.hpp) are covered in [determinism.md](determinism.md). --- ## Source files -- src/openvic-simulation/ecs/World.hpp — `World`, `WorldIdentitySnapshot`, all signatures quoted above -- src/openvic-simulation/ecs/World.cpp — out-of-line definitions (guards, snapshot/restore, tick driving) -- src/openvic-simulation/ecs/System.hpp — `TickContext`, `SystemHandle`, `INVALID_SYSTEM_HANDLE` -- src/openvic-simulation/ecs/Query.hpp — `Query` builder ([queries.md](queries.md)) -- src/openvic-simulation/ecs/ChunkView.hpp — `ChunkView` passed to `for_each_chunk` -- src/openvic-simulation/ecs/EntityID.hpp — `EntityID`, `ImmutableEntityID` ([entities.md](entities.md)) +- src/openvic-simulation/core/ecs/World.hpp — `World`, `WorldIdentitySnapshot`, all signatures quoted above +- src/openvic-simulation/core/ecs/World.cpp — out-of-line definitions (guards, snapshot/restore, tick driving) +- src/openvic-simulation/core/ecs/System.hpp — `TickContext`, `SystemHandle`, `INVALID_SYSTEM_HANDLE` +- src/openvic-simulation/core/ecs/Query.hpp — `Query` builder ([queries.md](queries.md)) +- src/openvic-simulation/core/ecs/ChunkView.hpp — `ChunkView` passed to `for_each_chunk` +- src/openvic-simulation/core/ecs/EntityID.hpp — `EntityID`, `ImmutableEntityID` ([entities.md](entities.md)) - tests/src/ecs/Integration.cpp, tests/src/ecs/Iteration.cpp, tests/src/ecs/Coverage.cpp — usage examples - tests/src/ecs/IdentitySnapshot.cpp, tests/src/ecs/IdentitySnapshotInvariance.cpp — save/load semantics and the invariance gate diff --git a/src/openvic-simulation/ecs/Archetype.hpp b/src/openvic-simulation/core/ecs/Archetype.hpp similarity index 98% rename from src/openvic-simulation/ecs/Archetype.hpp rename to src/openvic-simulation/core/ecs/Archetype.hpp index b055a4be6..4927dab74 100644 --- a/src/openvic-simulation/ecs/Archetype.hpp +++ b/src/openvic-simulation/core/ecs/Archetype.hpp @@ -9,11 +9,11 @@ #include #include -#include "openvic-simulation/ecs/ChecksumTraits.hpp" -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ChunkPool.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/ChecksumTraits.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ChunkPool.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/CachedRef.hpp b/src/openvic-simulation/core/ecs/CachedRef.hpp similarity index 95% rename from src/openvic-simulation/ecs/CachedRef.hpp rename to src/openvic-simulation/core/ecs/CachedRef.hpp index cf0a5c320..4e32d1007 100644 --- a/src/openvic-simulation/ecs/CachedRef.hpp +++ b/src/openvic-simulation/core/ecs/CachedRef.hpp @@ -2,8 +2,8 @@ #include -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/Checksum.cpp b/src/openvic-simulation/core/ecs/Checksum.cpp similarity index 92% rename from src/openvic-simulation/ecs/Checksum.cpp rename to src/openvic-simulation/core/ecs/Checksum.cpp index 8fdf481ce..6637203fe 100644 --- a/src/openvic-simulation/ecs/Checksum.cpp +++ b/src/openvic-simulation/core/ecs/Checksum.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/Checksum.hpp" +#include "Checksum.hpp" #include #include @@ -6,11 +6,11 @@ #include #include -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ChecksumTraits.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ChecksumTraits.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/Checksum.hpp b/src/openvic-simulation/core/ecs/Checksum.hpp similarity index 96% rename from src/openvic-simulation/ecs/Checksum.hpp rename to src/openvic-simulation/core/ecs/Checksum.hpp index 2fb6aec7d..1c721cb6a 100644 --- a/src/openvic-simulation/ecs/Checksum.hpp +++ b/src/openvic-simulation/core/ecs/Checksum.hpp @@ -3,8 +3,8 @@ #include #include -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/ChecksumTraits.hpp b/src/openvic-simulation/core/ecs/ChecksumTraits.hpp similarity index 100% rename from src/openvic-simulation/ecs/ChecksumTraits.hpp rename to src/openvic-simulation/core/ecs/ChecksumTraits.hpp diff --git a/src/openvic-simulation/ecs/Chunk.hpp b/src/openvic-simulation/core/ecs/Chunk.hpp similarity index 100% rename from src/openvic-simulation/ecs/Chunk.hpp rename to src/openvic-simulation/core/ecs/Chunk.hpp diff --git a/src/openvic-simulation/ecs/ChunkPool.cpp b/src/openvic-simulation/core/ecs/ChunkPool.cpp similarity index 94% rename from src/openvic-simulation/ecs/ChunkPool.cpp rename to src/openvic-simulation/core/ecs/ChunkPool.cpp index aa2097447..379ddef07 100644 --- a/src/openvic-simulation/ecs/ChunkPool.cpp +++ b/src/openvic-simulation/core/ecs/ChunkPool.cpp @@ -1,9 +1,9 @@ -#include "openvic-simulation/ecs/ChunkPool.hpp" +#include "ChunkPool.hpp" #include #include -#include "openvic-simulation/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" using namespace OpenVic::ecs; diff --git a/src/openvic-simulation/ecs/ChunkPool.hpp b/src/openvic-simulation/core/ecs/ChunkPool.hpp similarity index 100% rename from src/openvic-simulation/ecs/ChunkPool.hpp rename to src/openvic-simulation/core/ecs/ChunkPool.hpp diff --git a/src/openvic-simulation/ecs/ChunkSystem.hpp b/src/openvic-simulation/core/ecs/ChunkSystem.hpp similarity index 94% rename from src/openvic-simulation/ecs/ChunkSystem.hpp rename to src/openvic-simulation/core/ecs/ChunkSystem.hpp index b0dfe9e9b..229b89532 100644 --- a/src/openvic-simulation/ecs/ChunkSystem.hpp +++ b/src/openvic-simulation/core/ecs/ChunkSystem.hpp @@ -3,9 +3,9 @@ #include #include -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/ChunkView.hpp b/src/openvic-simulation/core/ecs/ChunkView.hpp similarity index 96% rename from src/openvic-simulation/ecs/ChunkView.hpp rename to src/openvic-simulation/core/ecs/ChunkView.hpp index 60b004eb3..638215837 100644 --- a/src/openvic-simulation/ecs/ChunkView.hpp +++ b/src/openvic-simulation/core/ecs/ChunkView.hpp @@ -4,8 +4,8 @@ #include #include -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/CommandBuffer.cpp b/src/openvic-simulation/core/ecs/CommandBuffer.cpp similarity index 98% rename from src/openvic-simulation/ecs/CommandBuffer.cpp rename to src/openvic-simulation/core/ecs/CommandBuffer.cpp index 1978ecc03..6ddd1bcb2 100644 --- a/src/openvic-simulation/ecs/CommandBuffer.cpp +++ b/src/openvic-simulation/core/ecs/CommandBuffer.cpp @@ -1,13 +1,13 @@ -#include "openvic-simulation/ecs/CommandBuffer.hpp" +#include "CommandBuffer.hpp" #include #include #include -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include "openvic-simulation/utility/Logger.hpp" using namespace OpenVic::ecs; diff --git a/src/openvic-simulation/ecs/CommandBuffer.hpp b/src/openvic-simulation/core/ecs/CommandBuffer.hpp similarity index 99% rename from src/openvic-simulation/ecs/CommandBuffer.hpp rename to src/openvic-simulation/core/ecs/CommandBuffer.hpp index a84199ae4..2eb5af270 100644 --- a/src/openvic-simulation/ecs/CommandBuffer.hpp +++ b/src/openvic-simulation/core/ecs/CommandBuffer.hpp @@ -10,10 +10,10 @@ #include #include -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/ComponentTypeID.hpp b/src/openvic-simulation/core/ecs/ComponentTypeID.hpp similarity index 100% rename from src/openvic-simulation/ecs/ComponentTypeID.hpp rename to src/openvic-simulation/core/ecs/ComponentTypeID.hpp diff --git a/src/openvic-simulation/ecs/DenseSlotAllocator.cpp b/src/openvic-simulation/core/ecs/DenseSlotAllocator.cpp similarity index 97% rename from src/openvic-simulation/ecs/DenseSlotAllocator.cpp rename to src/openvic-simulation/core/ecs/DenseSlotAllocator.cpp index 9779de924..25a97ce19 100644 --- a/src/openvic-simulation/ecs/DenseSlotAllocator.cpp +++ b/src/openvic-simulation/core/ecs/DenseSlotAllocator.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/DenseSlotAllocator.hpp" +#include "DenseSlotAllocator.hpp" #include #include diff --git a/src/openvic-simulation/ecs/DenseSlotAllocator.hpp b/src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp similarity index 100% rename from src/openvic-simulation/ecs/DenseSlotAllocator.hpp rename to src/openvic-simulation/core/ecs/DenseSlotAllocator.hpp diff --git a/src/openvic-simulation/ecs/EcsThreadPool.cpp b/src/openvic-simulation/core/ecs/EcsThreadPool.cpp similarity index 98% rename from src/openvic-simulation/ecs/EcsThreadPool.cpp rename to src/openvic-simulation/core/ecs/EcsThreadPool.cpp index 49e251de7..13e3b8f1d 100644 --- a/src/openvic-simulation/ecs/EcsThreadPool.cpp +++ b/src/openvic-simulation/core/ecs/EcsThreadPool.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/EcsThreadPool.hpp" +#include "EcsThreadPool.hpp" #include #include diff --git a/src/openvic-simulation/ecs/EcsThreadPool.hpp b/src/openvic-simulation/core/ecs/EcsThreadPool.hpp similarity index 100% rename from src/openvic-simulation/ecs/EcsThreadPool.hpp rename to src/openvic-simulation/core/ecs/EcsThreadPool.hpp diff --git a/src/openvic-simulation/ecs/EntityID.hpp b/src/openvic-simulation/core/ecs/EntityID.hpp similarity index 100% rename from src/openvic-simulation/ecs/EntityID.hpp rename to src/openvic-simulation/core/ecs/EntityID.hpp diff --git a/src/openvic-simulation/ecs/Query.hpp b/src/openvic-simulation/core/ecs/Query.hpp similarity index 96% rename from src/openvic-simulation/ecs/Query.hpp rename to src/openvic-simulation/core/ecs/Query.hpp index d7d01a816..2eeec7573 100644 --- a/src/openvic-simulation/ecs/Query.hpp +++ b/src/openvic-simulation/core/ecs/Query.hpp @@ -3,7 +3,7 @@ #include #include -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/QueryFilter.hpp b/src/openvic-simulation/core/ecs/QueryFilter.hpp similarity index 98% rename from src/openvic-simulation/ecs/QueryFilter.hpp rename to src/openvic-simulation/core/ecs/QueryFilter.hpp index 087ab3718..7aec94441 100644 --- a/src/openvic-simulation/ecs/QueryFilter.hpp +++ b/src/openvic-simulation/core/ecs/QueryFilter.hpp @@ -4,7 +4,7 @@ #include #include -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/Reductions.hpp b/src/openvic-simulation/core/ecs/Reductions.hpp similarity index 98% rename from src/openvic-simulation/ecs/Reductions.hpp rename to src/openvic-simulation/core/ecs/Reductions.hpp index 8cb150242..f01c88d67 100644 --- a/src/openvic-simulation/ecs/Reductions.hpp +++ b/src/openvic-simulation/core/ecs/Reductions.hpp @@ -7,7 +7,7 @@ #include #include -#include "openvic-simulation/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" namespace OpenVic::ecs::reductions { // Deterministic parallel reductions: per-chunk worker bodies write into a diff --git a/src/openvic-simulation/ecs/System.hpp b/src/openvic-simulation/core/ecs/System.hpp similarity index 98% rename from src/openvic-simulation/ecs/System.hpp rename to src/openvic-simulation/core/ecs/System.hpp index d4683ab24..cb8b70e9f 100644 --- a/src/openvic-simulation/ecs/System.hpp +++ b/src/openvic-simulation/core/ecs/System.hpp @@ -11,11 +11,11 @@ #include #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/SystemAccess.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/SystemAccess.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" namespace OpenVic::ecs { struct World; diff --git a/src/openvic-simulation/ecs/SystemAccess.hpp b/src/openvic-simulation/core/ecs/SystemAccess.hpp similarity index 98% rename from src/openvic-simulation/ecs/SystemAccess.hpp rename to src/openvic-simulation/core/ecs/SystemAccess.hpp index 14655c07a..08d682400 100644 --- a/src/openvic-simulation/ecs/SystemAccess.hpp +++ b/src/openvic-simulation/core/ecs/SystemAccess.hpp @@ -7,7 +7,7 @@ #include #include -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" namespace OpenVic::ecs { enum class AccessMode : uint8_t { diff --git a/src/openvic-simulation/ecs/SystemImpl.hpp b/src/openvic-simulation/core/ecs/SystemImpl.hpp similarity index 97% rename from src/openvic-simulation/ecs/SystemImpl.hpp rename to src/openvic-simulation/core/ecs/SystemImpl.hpp index fd061a9ef..7633c3ab2 100644 --- a/src/openvic-simulation/ecs/SystemImpl.hpp +++ b/src/openvic-simulation/core/ecs/SystemImpl.hpp @@ -14,11 +14,11 @@ #include #include -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/World.hpp" namespace OpenVic::ecs::detail { diff --git a/src/openvic-simulation/ecs/SystemPhase.hpp b/src/openvic-simulation/core/ecs/SystemPhase.hpp similarity index 98% rename from src/openvic-simulation/ecs/SystemPhase.hpp rename to src/openvic-simulation/core/ecs/SystemPhase.hpp index 3612e8adf..6a74ff135 100644 --- a/src/openvic-simulation/ecs/SystemPhase.hpp +++ b/src/openvic-simulation/core/ecs/SystemPhase.hpp @@ -2,8 +2,8 @@ #include -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" namespace OpenVic::ecs { diff --git a/src/openvic-simulation/ecs/SystemScheduler.cpp b/src/openvic-simulation/core/ecs/SystemScheduler.cpp similarity index 98% rename from src/openvic-simulation/ecs/SystemScheduler.cpp rename to src/openvic-simulation/core/ecs/SystemScheduler.cpp index 5c0fdacc9..d174b94bd 100644 --- a/src/openvic-simulation/ecs/SystemScheduler.cpp +++ b/src/openvic-simulation/core/ecs/SystemScheduler.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/SystemScheduler.hpp" +#include "SystemScheduler.hpp" #include #include @@ -9,11 +9,11 @@ #include #include -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/SystemAccess.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/SystemAccess.hpp" +#include "openvic-simulation/core/ecs/World.hpp" using namespace OpenVic::ecs; diff --git a/src/openvic-simulation/ecs/SystemScheduler.hpp b/src/openvic-simulation/core/ecs/SystemScheduler.hpp similarity index 96% rename from src/openvic-simulation/ecs/SystemScheduler.hpp rename to src/openvic-simulation/core/ecs/SystemScheduler.hpp index 1b190fca4..d3f716613 100644 --- a/src/openvic-simulation/ecs/SystemScheduler.hpp +++ b/src/openvic-simulation/core/ecs/SystemScheduler.hpp @@ -5,8 +5,8 @@ #include #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" namespace OpenVic::ecs { struct World; diff --git a/src/openvic-simulation/ecs/SystemTypeID.hpp b/src/openvic-simulation/core/ecs/SystemTypeID.hpp similarity index 95% rename from src/openvic-simulation/ecs/SystemTypeID.hpp rename to src/openvic-simulation/core/ecs/SystemTypeID.hpp index f5a9e74b8..563d9b2bd 100644 --- a/src/openvic-simulation/ecs/SystemTypeID.hpp +++ b/src/openvic-simulation/core/ecs/SystemTypeID.hpp @@ -3,7 +3,7 @@ #include #include -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" namespace OpenVic::ecs { using system_type_id_t = uint64_t; diff --git a/src/openvic-simulation/ecs/World.cpp b/src/openvic-simulation/core/ecs/World.cpp similarity index 99% rename from src/openvic-simulation/ecs/World.cpp rename to src/openvic-simulation/core/ecs/World.cpp index c6f57db2d..b4d2e8234 100644 --- a/src/openvic-simulation/ecs/World.cpp +++ b/src/openvic-simulation/core/ecs/World.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/World.hpp" +#include "World.hpp" #include #include @@ -7,9 +7,9 @@ #include #include -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/SystemScheduler.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/SystemScheduler.hpp" #include "openvic-simulation/utility/Logger.hpp" using namespace OpenVic::ecs; diff --git a/src/openvic-simulation/ecs/World.hpp b/src/openvic-simulation/core/ecs/World.hpp similarity index 99% rename from src/openvic-simulation/ecs/World.hpp rename to src/openvic-simulation/core/ecs/World.hpp index 55979abb1..424e4be1f 100644 --- a/src/openvic-simulation/ecs/World.hpp +++ b/src/openvic-simulation/core/ecs/World.hpp @@ -13,16 +13,16 @@ #include #include -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ChecksumTraits.hpp" -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ChunkPool.hpp" -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/System.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ChecksumTraits.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ChunkPool.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/System.hpp" namespace OpenVic::ecs { class SystemScheduler; // forward — concrete type included from World.cpp only diff --git a/tests/benchmarks/src/ecs/AliasingHotLoop.cpp b/tests/benchmarks/src/core/ecs/AliasingHotLoop.cpp similarity index 93% rename from tests/benchmarks/src/ecs/AliasingHotLoop.cpp rename to tests/benchmarks/src/core/ecs/AliasingHotLoop.cpp index 7d34a33e2..ee1aaf5a4 100644 --- a/tests/benchmarks/src/ecs/AliasingHotLoop.cpp +++ b/tests/benchmarks/src/core/ecs/AliasingHotLoop.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ChunkSystem.hpp" -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChunkSystem.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/BulkCreate.cpp b/tests/benchmarks/src/core/ecs/BulkCreate.cpp similarity index 96% rename from tests/benchmarks/src/ecs/BulkCreate.cpp rename to tests/benchmarks/src/core/ecs/BulkCreate.cpp index 320e17e86..da7770974 100644 --- a/tests/benchmarks/src/ecs/BulkCreate.cpp +++ b/tests/benchmarks/src/core/ecs/BulkCreate.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/CommandBuffer.cpp b/tests/benchmarks/src/core/ecs/CommandBuffer.cpp similarity index 97% rename from tests/benchmarks/src/ecs/CommandBuffer.cpp rename to tests/benchmarks/src/core/ecs/CommandBuffer.cpp index 9e32ed1b7..7d83e46c9 100644 --- a/tests/benchmarks/src/ecs/CommandBuffer.cpp +++ b/tests/benchmarks/src/core/ecs/CommandBuffer.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/ComponentAccess.cpp b/tests/benchmarks/src/core/ecs/ComponentAccess.cpp similarity index 97% rename from tests/benchmarks/src/ecs/ComponentAccess.cpp rename to tests/benchmarks/src/core/ecs/ComponentAccess.cpp index d36a69598..88d1b7b85 100644 --- a/tests/benchmarks/src/ecs/ComponentAccess.cpp +++ b/tests/benchmarks/src/core/ecs/ComponentAccess.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/CachedRef.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CachedRef.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/EntityLifecycle.cpp b/tests/benchmarks/src/core/ecs/EntityLifecycle.cpp similarity index 98% rename from tests/benchmarks/src/ecs/EntityLifecycle.cpp rename to tests/benchmarks/src/core/ecs/EntityLifecycle.cpp index fd2440fc1..74b5198ba 100644 --- a/tests/benchmarks/src/ecs/EntityLifecycle.cpp +++ b/tests/benchmarks/src/core/ecs/EntityLifecycle.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/ImmutableEntity.cpp b/tests/benchmarks/src/core/ecs/ImmutableEntity.cpp similarity index 94% rename from tests/benchmarks/src/ecs/ImmutableEntity.cpp rename to tests/benchmarks/src/core/ecs/ImmutableEntity.cpp index 8fc45af4a..b2c91ddc7 100644 --- a/tests/benchmarks/src/ecs/ImmutableEntity.cpp +++ b/tests/benchmarks/src/core/ecs/ImmutableEntity.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/Iteration.cpp b/tests/benchmarks/src/core/ecs/Iteration.cpp similarity index 96% rename from tests/benchmarks/src/ecs/Iteration.cpp rename to tests/benchmarks/src/core/ecs/Iteration.cpp index 48e22d346..02e1122c6 100644 --- a/tests/benchmarks/src/ecs/Iteration.cpp +++ b/tests/benchmarks/src/core/ecs/Iteration.cpp @@ -1,7 +1,7 @@ -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/Migration.cpp b/tests/benchmarks/src/core/ecs/Migration.cpp similarity index 98% rename from tests/benchmarks/src/ecs/Migration.cpp rename to tests/benchmarks/src/core/ecs/Migration.cpp index 8c6cbb738..41825ccb8 100644 --- a/tests/benchmarks/src/ecs/Migration.cpp +++ b/tests/benchmarks/src/core/ecs/Migration.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/Reductions.cpp b/tests/benchmarks/src/core/ecs/Reductions.cpp similarity index 96% rename from tests/benchmarks/src/ecs/Reductions.cpp rename to tests/benchmarks/src/core/ecs/Reductions.cpp index a217ffef7..f0cec49f6 100644 --- a/tests/benchmarks/src/ecs/Reductions.cpp +++ b/tests/benchmarks/src/core/ecs/Reductions.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/Reductions.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/Reductions.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/Scheduler.cpp b/tests/benchmarks/src/core/ecs/Scheduler.cpp similarity index 95% rename from tests/benchmarks/src/ecs/Scheduler.cpp rename to tests/benchmarks/src/core/ecs/Scheduler.cpp index 693c54bc1..bacd3f878 100644 --- a/tests/benchmarks/src/ecs/Scheduler.cpp +++ b/tests/benchmarks/src/core/ecs/Scheduler.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/SystemShouldRun.cpp b/tests/benchmarks/src/core/ecs/SystemShouldRun.cpp similarity index 95% rename from tests/benchmarks/src/ecs/SystemShouldRun.cpp rename to tests/benchmarks/src/core/ecs/SystemShouldRun.cpp index bb292a677..155244793 100644 --- a/tests/benchmarks/src/ecs/SystemShouldRun.cpp +++ b/tests/benchmarks/src/core/ecs/SystemShouldRun.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/benchmarks/src/ecs/SystemTick.cpp b/tests/benchmarks/src/core/ecs/SystemTick.cpp similarity index 91% rename from tests/benchmarks/src/ecs/SystemTick.cpp rename to tests/benchmarks/src/core/ecs/SystemTick.cpp index 655597230..58f42d992 100644 --- a/tests/benchmarks/src/ecs/SystemTick.cpp +++ b/tests/benchmarks/src/core/ecs/SystemTick.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ChunkSystem.hpp" -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChunkSystem.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Archetype.cpp b/tests/src/core/ecs/Archetype.cpp similarity index 96% rename from tests/src/ecs/Archetype.cpp rename to tests/src/core/ecs/Archetype.cpp index 5600358ab..10675d788 100644 --- a/tests/src/ecs/Archetype.cpp +++ b/tests/src/core/ecs/Archetype.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" #include #include diff --git a/tests/src/ecs/BulkCreate.cpp b/tests/src/core/ecs/BulkCreate.cpp similarity index 98% rename from tests/src/ecs/BulkCreate.cpp rename to tests/src/core/ecs/BulkCreate.cpp index cade2d4ed..23d899b0c 100644 --- a/tests/src/ecs/BulkCreate.cpp +++ b/tests/src/core/ecs/BulkCreate.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/CachedRef.cpp b/tests/src/core/ecs/CachedRef.cpp similarity index 97% rename from tests/src/ecs/CachedRef.cpp rename to tests/src/core/ecs/CachedRef.cpp index 26fecb38e..8dacb6ed5 100644 --- a/tests/src/ecs/CachedRef.cpp +++ b/tests/src/core/ecs/CachedRef.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/CachedRef.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CachedRef.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/Checksum.cpp b/tests/src/core/ecs/Checksum.cpp similarity index 95% rename from tests/src/ecs/Checksum.cpp rename to tests/src/core/ecs/Checksum.cpp index 0d5410fc5..1e0bb38ea 100644 --- a/tests/src/ecs/Checksum.cpp +++ b/tests/src/core/ecs/Checksum.cpp @@ -1,13 +1,13 @@ -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/Checksum.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/Checksum.hpp" #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ChecksumTraits.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChecksumTraits.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Chunk.cpp b/tests/src/core/ecs/Chunk.cpp similarity index 92% rename from tests/src/ecs/Chunk.cpp rename to tests/src/core/ecs/Chunk.cpp index 84a59f6f6..ac2f4fea4 100644 --- a/tests/src/ecs/Chunk.cpp +++ b/tests/src/core/ecs/Chunk.cpp @@ -1,8 +1,8 @@ -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/ChunkMigration.cpp b/tests/src/core/ecs/ChunkMigration.cpp similarity index 93% rename from tests/src/ecs/ChunkMigration.cpp rename to tests/src/core/ecs/ChunkMigration.cpp index 267c84d23..6d855ee7b 100644 --- a/tests/src/ecs/ChunkMigration.cpp +++ b/tests/src/core/ecs/ChunkMigration.cpp @@ -1,7 +1,7 @@ -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/ChunkOverflow.cpp b/tests/src/core/ecs/ChunkOverflow.cpp similarity index 95% rename from tests/src/ecs/ChunkOverflow.cpp rename to tests/src/core/ecs/ChunkOverflow.cpp index 9093f84f4..4740d9e43 100644 --- a/tests/src/ecs/ChunkOverflow.cpp +++ b/tests/src/core/ecs/ChunkOverflow.cpp @@ -1,7 +1,7 @@ -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/ChunkPool.cpp b/tests/src/core/ecs/ChunkPool.cpp similarity index 97% rename from tests/src/ecs/ChunkPool.cpp rename to tests/src/core/ecs/ChunkPool.cpp index b46bb6331..bd451338f 100644 --- a/tests/src/ecs/ChunkPool.cpp +++ b/tests/src/core/ecs/ChunkPool.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ChunkPool.hpp" -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ChunkPool.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/ChunkSystem.cpp b/tests/src/core/ecs/ChunkSystem.cpp similarity index 83% rename from tests/src/ecs/ChunkSystem.cpp rename to tests/src/core/ecs/ChunkSystem.cpp index adfa5c3de..c2baef37e 100644 --- a/tests/src/ecs/ChunkSystem.cpp +++ b/tests/src/core/ecs/ChunkSystem.cpp @@ -1,11 +1,11 @@ -#include "openvic-simulation/ecs/ChunkSystem.hpp" +#include "openvic-simulation/core/ecs/ChunkSystem.hpp" #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/ChunkView.cpp b/tests/src/core/ecs/ChunkView.cpp similarity index 92% rename from tests/src/ecs/ChunkView.cpp rename to tests/src/core/ecs/ChunkView.cpp index 3c2d7ce90..cd4a7f01b 100644 --- a/tests/src/ecs/ChunkView.cpp +++ b/tests/src/core/ecs/ChunkView.cpp @@ -1,9 +1,9 @@ -#include "openvic-simulation/ecs/Chunk.hpp" -#include "openvic-simulation/ecs/ChunkView.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Chunk.hpp" +#include "openvic-simulation/core/ecs/ChunkView.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/CommandBuffer.cpp b/tests/src/core/ecs/CommandBuffer.cpp similarity index 98% rename from tests/src/ecs/CommandBuffer.cpp rename to tests/src/core/ecs/CommandBuffer.cpp index 984c59d94..10ee9c8b0 100644 --- a/tests/src/ecs/CommandBuffer.cpp +++ b/tests/src/core/ecs/CommandBuffer.cpp @@ -1,7 +1,7 @@ -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/CommandBufferApplyOrder.cpp b/tests/src/core/ecs/CommandBufferApplyOrder.cpp similarity index 91% rename from tests/src/ecs/CommandBufferApplyOrder.cpp rename to tests/src/core/ecs/CommandBufferApplyOrder.cpp index 46e015f15..28b242fe9 100644 --- a/tests/src/ecs/CommandBufferApplyOrder.cpp +++ b/tests/src/core/ecs/CommandBufferApplyOrder.cpp @@ -1,11 +1,11 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/Component.cpp b/tests/src/core/ecs/Component.cpp similarity index 97% rename from tests/src/ecs/Component.cpp rename to tests/src/core/ecs/Component.cpp index 4041364a0..1cebd4442 100644 --- a/tests/src/ecs/Component.cpp +++ b/tests/src/core/ecs/Component.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/Coverage.cpp b/tests/src/core/ecs/Coverage.cpp similarity index 97% rename from tests/src/ecs/Coverage.cpp rename to tests/src/core/ecs/Coverage.cpp index 5e54f4309..5e3ba23fd 100644 --- a/tests/src/ecs/Coverage.cpp +++ b/tests/src/core/ecs/Coverage.cpp @@ -1,12 +1,12 @@ // Coverage gap-fill — add tests for public API surfaces not directly hit by the // thematic test files. Each test below targets a method or scenario that // otherwise would not have explicit assertion coverage. -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/CachedRef.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/CachedRef.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/DenseSlotAllocator.cpp b/tests/src/core/ecs/DenseSlotAllocator.cpp similarity index 98% rename from tests/src/ecs/DenseSlotAllocator.cpp rename to tests/src/core/ecs/DenseSlotAllocator.cpp index 5d75eec21..38b6ae56c 100644 --- a/tests/src/ecs/DenseSlotAllocator.cpp +++ b/tests/src/core/ecs/DenseSlotAllocator.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/DenseSlotAllocator.hpp" +#include "openvic-simulation/core/ecs/DenseSlotAllocator.hpp" #include #include diff --git a/tests/src/ecs/EcsThreadPool.cpp b/tests/src/core/ecs/EcsThreadPool.cpp similarity index 97% rename from tests/src/ecs/EcsThreadPool.cpp rename to tests/src/core/ecs/EcsThreadPool.cpp index d2c2e8d14..b68799753 100644 --- a/tests/src/ecs/EcsThreadPool.cpp +++ b/tests/src/core/ecs/EcsThreadPool.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" #include #include diff --git a/tests/src/ecs/EntityID.cpp b/tests/src/core/ecs/EntityID.cpp similarity index 97% rename from tests/src/ecs/EntityID.cpp rename to tests/src/core/ecs/EntityID.cpp index 73aa7bab6..13ce08aa6 100644 --- a/tests/src/ecs/EntityID.cpp +++ b/tests/src/core/ecs/EntityID.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" #include diff --git a/tests/src/ecs/EntityLifecycle.cpp b/tests/src/core/ecs/EntityLifecycle.cpp similarity index 98% rename from tests/src/ecs/EntityLifecycle.cpp rename to tests/src/core/ecs/EntityLifecycle.cpp index fb7b5a016..a207a2306 100644 --- a/tests/src/ecs/EntityLifecycle.cpp +++ b/tests/src/core/ecs/EntityLifecycle.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/FNVHash.cpp b/tests/src/core/ecs/FNVHash.cpp similarity index 97% rename from tests/src/ecs/FNVHash.cpp rename to tests/src/core/ecs/FNVHash.cpp index faea1da3f..3b573a88d 100644 --- a/tests/src/ecs/FNVHash.cpp +++ b/tests/src/core/ecs/FNVHash.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" #include #include diff --git a/tests/src/ecs/IdentitySnapshot.cpp b/tests/src/core/ecs/IdentitySnapshot.cpp similarity index 98% rename from tests/src/ecs/IdentitySnapshot.cpp rename to tests/src/core/ecs/IdentitySnapshot.cpp index 56e17f8cd..ffcd9b859 100644 --- a/tests/src/ecs/IdentitySnapshot.cpp +++ b/tests/src/core/ecs/IdentitySnapshot.cpp @@ -1,7 +1,7 @@ -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/IdentitySnapshotInvariance.cpp b/tests/src/core/ecs/IdentitySnapshotInvariance.cpp similarity index 96% rename from tests/src/ecs/IdentitySnapshotInvariance.cpp rename to tests/src/core/ecs/IdentitySnapshotInvariance.cpp index 17c081327..5fe463142 100644 --- a/tests/src/ecs/IdentitySnapshotInvariance.cpp +++ b/tests/src/core/ecs/IdentitySnapshotInvariance.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/ImmutableEntity.cpp b/tests/src/core/ecs/ImmutableEntity.cpp similarity index 98% rename from tests/src/ecs/ImmutableEntity.cpp rename to tests/src/core/ecs/ImmutableEntity.cpp index e7ab67ee2..387c2b32d 100644 --- a/tests/src/ecs/ImmutableEntity.cpp +++ b/tests/src/core/ecs/ImmutableEntity.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/InTickMutationGuard.cpp b/tests/src/core/ecs/InTickMutationGuard.cpp similarity index 85% rename from tests/src/ecs/InTickMutationGuard.cpp rename to tests/src/core/ecs/InTickMutationGuard.cpp index 3f0eed5f4..9d5ba4d6f 100644 --- a/tests/src/ecs/InTickMutationGuard.cpp +++ b/tests/src/core/ecs/InTickMutationGuard.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Integration.cpp b/tests/src/core/ecs/Integration.cpp similarity index 96% rename from tests/src/ecs/Integration.cpp rename to tests/src/core/ecs/Integration.cpp index 1895cb5f5..6fda73bc8 100644 --- a/tests/src/ecs/Integration.cpp +++ b/tests/src/core/ecs/Integration.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CachedRef.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CachedRef.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/IntraSystemParallel.cpp b/tests/src/core/ecs/IntraSystemParallel.cpp similarity index 87% rename from tests/src/ecs/IntraSystemParallel.cpp rename to tests/src/core/ecs/IntraSystemParallel.cpp index 5d2037eff..4beb29587 100644 --- a/tests/src/ecs/IntraSystemParallel.cpp +++ b/tests/src/core/ecs/IntraSystemParallel.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Iteration.cpp b/tests/src/core/ecs/Iteration.cpp similarity index 97% rename from tests/src/ecs/Iteration.cpp rename to tests/src/core/ecs/Iteration.cpp index e66461f01..176b13f26 100644 --- a/tests/src/ecs/Iteration.cpp +++ b/tests/src/core/ecs/Iteration.cpp @@ -1,6 +1,6 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/KeyedReductions.cpp b/tests/src/core/ecs/KeyedReductions.cpp similarity index 98% rename from tests/src/ecs/KeyedReductions.cpp rename to tests/src/core/ecs/KeyedReductions.cpp index 532371db2..b9cdc8f58 100644 --- a/tests/src/ecs/KeyedReductions.cpp +++ b/tests/src/core/ecs/KeyedReductions.cpp @@ -1,6 +1,6 @@ #include "openvic-simulation/core/object/FixedPoint.hpp" -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/Reductions.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/Reductions.hpp" #include #include diff --git a/tests/src/ecs/MatcherHash.cpp b/tests/src/core/ecs/MatcherHash.cpp similarity index 93% rename from tests/src/ecs/MatcherHash.cpp rename to tests/src/core/ecs/MatcherHash.cpp index 6feb4034f..e57508a9d 100644 --- a/tests/src/ecs/MatcherHash.cpp +++ b/tests/src/core/ecs/MatcherHash.cpp @@ -1,8 +1,8 @@ -#include "openvic-simulation/ecs/Archetype.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/Query.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Archetype.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Migration.cpp b/tests/src/core/ecs/Migration.cpp similarity index 98% rename from tests/src/ecs/Migration.cpp rename to tests/src/core/ecs/Migration.cpp index c537fec71..8dcefc202 100644 --- a/tests/src/ecs/Migration.cpp +++ b/tests/src/core/ecs/Migration.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/MultiSystemMixedStage.cpp b/tests/src/core/ecs/MultiSystemMixedStage.cpp similarity index 98% rename from tests/src/ecs/MultiSystemMixedStage.cpp rename to tests/src/core/ecs/MultiSystemMixedStage.cpp index a207a5080..bb3b5f783 100644 --- a/tests/src/ecs/MultiSystemMixedStage.cpp +++ b/tests/src/core/ecs/MultiSystemMixedStage.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/Query.cpp b/tests/src/core/ecs/Query.cpp similarity index 96% rename from tests/src/ecs/Query.cpp rename to tests/src/core/ecs/Query.cpp index 7df735981..a5a22986d 100644 --- a/tests/src/ecs/Query.cpp +++ b/tests/src/core/ecs/Query.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/Query.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/Query.hpp" #include #include diff --git a/tests/src/ecs/Reductions.cpp b/tests/src/core/ecs/Reductions.cpp similarity index 94% rename from tests/src/ecs/Reductions.cpp rename to tests/src/core/ecs/Reductions.cpp index cd6c99d4f..548ab022c 100644 --- a/tests/src/ecs/Reductions.cpp +++ b/tests/src/core/ecs/Reductions.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EcsThreadPool.hpp" -#include "openvic-simulation/ecs/Reductions.hpp" +#include "openvic-simulation/core/ecs/EcsThreadPool.hpp" +#include "openvic-simulation/core/ecs/Reductions.hpp" #include #include diff --git a/tests/src/ecs/Singleton.cpp b/tests/src/core/ecs/Singleton.cpp similarity index 98% rename from tests/src/ecs/Singleton.cpp rename to tests/src/core/ecs/Singleton.cpp index 522be8695..d8284c0c6 100644 --- a/tests/src/ecs/Singleton.cpp +++ b/tests/src/core/ecs/Singleton.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/System.cpp b/tests/src/core/ecs/System.cpp similarity index 95% rename from tests/src/ecs/System.cpp rename to tests/src/core/ecs/System.cpp index c309281d8..d9b9645d1 100644 --- a/tests/src/ecs/System.cpp +++ b/tests/src/core/ecs/System.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemAccess.cpp b/tests/src/core/ecs/SystemAccess.cpp similarity index 98% rename from tests/src/ecs/SystemAccess.cpp rename to tests/src/core/ecs/SystemAccess.cpp index ae02c4864..66f566671 100644 --- a/tests/src/ecs/SystemAccess.cpp +++ b/tests/src/core/ecs/SystemAccess.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/SystemAccess.hpp" +#include "openvic-simulation/core/ecs/SystemAccess.hpp" #include diff --git a/tests/src/ecs/SystemFilters.cpp b/tests/src/core/ecs/SystemFilters.cpp similarity index 96% rename from tests/src/ecs/SystemFilters.cpp rename to tests/src/core/ecs/SystemFilters.cpp index 8378dbec3..33f5eb2c5 100644 --- a/tests/src/ecs/SystemFilters.cpp +++ b/tests/src/core/ecs/SystemFilters.cpp @@ -1,12 +1,12 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ChunkSystem.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/SystemAccess.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChunkSystem.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/SystemAccess.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp b/tests/src/core/ecs/SystemFiltersWorkerCountInvariance.cpp similarity index 98% rename from tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp rename to tests/src/core/ecs/SystemFiltersWorkerCountInvariance.cpp index 5ba8c03fb..b85e3d786 100644 --- a/tests/src/ecs/SystemFiltersWorkerCountInvariance.cpp +++ b/tests/src/core/ecs/SystemFiltersWorkerCountInvariance.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemPhaseAnchors.cpp b/tests/src/core/ecs/SystemPhaseAnchors.cpp similarity index 98% rename from tests/src/ecs/SystemPhaseAnchors.cpp rename to tests/src/core/ecs/SystemPhaseAnchors.cpp index 315b493c7..7dd77b586 100644 --- a/tests/src/ecs/SystemPhaseAnchors.cpp +++ b/tests/src/core/ecs/SystemPhaseAnchors.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemPhase.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemPhase.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemSchedulerDisjointWriters.cpp b/tests/src/core/ecs/SystemSchedulerDisjointWriters.cpp similarity index 96% rename from tests/src/ecs/SystemSchedulerDisjointWriters.cpp rename to tests/src/core/ecs/SystemSchedulerDisjointWriters.cpp index 219f80880..6af4d3eda 100644 --- a/tests/src/ecs/SystemSchedulerDisjointWriters.cpp +++ b/tests/src/core/ecs/SystemSchedulerDisjointWriters.cpp @@ -1,13 +1,13 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ChunkSystem.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/QueryFilter.hpp" -#include "openvic-simulation/ecs/System.hpp" -#include "openvic-simulation/ecs/SystemAccess.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ChunkSystem.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/QueryFilter.hpp" +#include "openvic-simulation/core/ecs/System.hpp" +#include "openvic-simulation/core/ecs/SystemAccess.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemSchedulerSingletonWrites.cpp b/tests/src/core/ecs/SystemSchedulerSingletonWrites.cpp similarity index 97% rename from tests/src/ecs/SystemSchedulerSingletonWrites.cpp rename to tests/src/core/ecs/SystemSchedulerSingletonWrites.cpp index af588216b..17159de50 100644 --- a/tests/src/ecs/SystemSchedulerSingletonWrites.cpp +++ b/tests/src/core/ecs/SystemSchedulerSingletonWrites.cpp @@ -1,9 +1,9 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemScheduler_Conflicts.cpp b/tests/src/core/ecs/SystemScheduler_Conflicts.cpp similarity index 93% rename from tests/src/ecs/SystemScheduler_Conflicts.cpp rename to tests/src/core/ecs/SystemScheduler_Conflicts.cpp index 7126e430d..8a9dd6673 100644 --- a/tests/src/ecs/SystemScheduler_Conflicts.cpp +++ b/tests/src/core/ecs/SystemScheduler_Conflicts.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include diff --git a/tests/src/ecs/SystemScheduler_DAG.cpp b/tests/src/core/ecs/SystemScheduler_DAG.cpp similarity index 95% rename from tests/src/ecs/SystemScheduler_DAG.cpp rename to tests/src/core/ecs/SystemScheduler_DAG.cpp index 02859c757..b23dd3306 100644 --- a/tests/src/ecs/SystemScheduler_DAG.cpp +++ b/tests/src/core/ecs/SystemScheduler_DAG.cpp @@ -1,8 +1,8 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemShouldRun.cpp b/tests/src/core/ecs/SystemShouldRun.cpp similarity index 97% rename from tests/src/ecs/SystemShouldRun.cpp rename to tests/src/core/ecs/SystemShouldRun.cpp index 3ee205fb0..ee9168aec 100644 --- a/tests/src/ecs/SystemShouldRun.cpp +++ b/tests/src/core/ecs/SystemShouldRun.cpp @@ -1,11 +1,11 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/Checksum.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/Checksum.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemThreadedSpawn.cpp b/tests/src/core/ecs/SystemThreadedSpawn.cpp similarity index 94% rename from tests/src/ecs/SystemThreadedSpawn.cpp rename to tests/src/core/ecs/SystemThreadedSpawn.cpp index 1b8a9ad4f..693d9531d 100644 --- a/tests/src/ecs/SystemThreadedSpawn.cpp +++ b/tests/src/core/ecs/SystemThreadedSpawn.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/SystemTypeID.cpp b/tests/src/core/ecs/SystemTypeID.cpp similarity index 95% rename from tests/src/ecs/SystemTypeID.cpp rename to tests/src/core/ecs/SystemTypeID.cpp index 4f883ec57..8d3746f1d 100644 --- a/tests/src/ecs/SystemTypeID.cpp +++ b/tests/src/core/ecs/SystemTypeID.cpp @@ -1,4 +1,4 @@ -#include "openvic-simulation/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" #include #include diff --git a/tests/src/ecs/Tag.cpp b/tests/src/core/ecs/Tag.cpp similarity index 97% rename from tests/src/ecs/Tag.cpp rename to tests/src/core/ecs/Tag.cpp index 2c2432b90..c8ab8d527 100644 --- a/tests/src/ecs/Tag.cpp +++ b/tests/src/core/ecs/Tag.cpp @@ -1,5 +1,5 @@ -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include diff --git a/tests/src/ecs/WorkerCountInvariance.cpp b/tests/src/core/ecs/WorkerCountInvariance.cpp similarity index 95% rename from tests/src/ecs/WorkerCountInvariance.cpp rename to tests/src/core/ecs/WorkerCountInvariance.cpp index d6c8b7e5f..2bde53522 100644 --- a/tests/src/ecs/WorkerCountInvariance.cpp +++ b/tests/src/core/ecs/WorkerCountInvariance.cpp @@ -1,10 +1,10 @@ #include "openvic-simulation/core/object/Date.hpp" -#include "openvic-simulation/ecs/CommandBuffer.hpp" -#include "openvic-simulation/ecs/ComponentTypeID.hpp" -#include "openvic-simulation/ecs/EntityID.hpp" -#include "openvic-simulation/ecs/SystemImpl.hpp" -#include "openvic-simulation/ecs/SystemTypeID.hpp" -#include "openvic-simulation/ecs/World.hpp" +#include "openvic-simulation/core/ecs/CommandBuffer.hpp" +#include "openvic-simulation/core/ecs/ComponentTypeID.hpp" +#include "openvic-simulation/core/ecs/EntityID.hpp" +#include "openvic-simulation/core/ecs/SystemImpl.hpp" +#include "openvic-simulation/core/ecs/SystemTypeID.hpp" +#include "openvic-simulation/core/ecs/World.hpp" #include #include