Repository navigation
[M1-ECS-02] Component registry + trait-based IDs - #17
Merged
Merged
Conversation
- ComponentTypeId: stable per-world ids, dense in registration order from 1, 0 reserved (kInvalidComponentTypeId), per-world contract, operator< = registration order (ARCH-010: pure integer bookkeeping). - LAIGE_COMPONENT(Type): compile-time trait mark (data-only; replication / inspector traits land in M4). User-defined structs register through the same path (S-8 data-carrier case). - World::registerComponent<T>: records sizeof/alignof for the M1-ECS-03 SoA layout; duplicate registration is an error (InvalidArgument + rate-limited warn ecs/component_duplicate); engine-level budget kMaxComponentTypes = 256 (BudgetExhausted); setup-phase O(n), no allocation; moved-from world has no registry. - Type identity without RTTI/unordered: per-type inline-static marker address (NFR-8.10, PERF-006). - Tests: 12 cases under the new component_registry CTest entry (duplicate error, id stability across two worlds with the same order, order-determines-ids, 256-type budget boundary, size/alignment, validation, move/clear, warn-once). - Docs: docs/api/component_registry.md (+ cross-refs), laige-api.json regenerated (421 symbols). Verify: ctest -R component_registry green; full ctest 35/35 on canonical g++ Debug, ASan (35/35), and Clang (35/35) trees; api-real-tree green; tools/laige-include-lint OK.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements M1-ECS-02 from roadmap/M1-heartbeat.md (exactly the Scope bullets, nothing else).
What landed
Files
Verification (AGENTS §5)
No ENGINE-RULE-EXCEPTION added.