Repository navigation
ECS API: complete feature branch merge - #174
Merged
Merged
Conversation
…ighly serialized KVP)
…AllowMultiple tests + 8 dead method overloads Engine: - ArchetypeEngineState: per-engine data out of static metadata (parallel safety) - Destroy propagation: tombstone revisions in ComponentTable via PrepareEcsDestroys - DB reopen: rebuild entity maps + NextEntityKey from persisted PK indexes - Schema evolution: ComponentTypeId keyed by schema name, fallback slot connection - SchemaDowngradeException: refuse DB written by newer binary - Migration zero-fill: clear new chunks before field copy (stale memory bug) - ResolveEntity: idempotent Open() via cache check - ECS COW: increment ComponentCollection RefCounters
- Delete CreateEntity (4), UpdateEntity (4), DeleteEntity (3), DeleteEntities, GetComponentRevision + 6 private helpers - ReadEntity renamed to internal ReadComponent (query engine only) - Add WriteComponent, DestroyByPK, SpawnByArchetypeId bridge methods for Shell CLI - Add ComponentValue.CreateFromRaw + ArchetypeRegistry.FindArchetypeForComponent - Convert benchmark (6 files) and MonitoringDemo (4 files) to ECS Spawn/Open/Write/Destroy - Query engine: ReadEntity → ReadComponent (17 calls, same path, internal visibility) - Shell CLI: reflection dispatch updated to ECS bridge methods - Remove dead GetPage calls in ManagedPagedMMF
…x, EntityMap persistence, batch API Engine: - FindCascadeChildren uses FK B+Tree index instead of O(n) EntityMap scan - EntityLink<T> recognized as FieldType.Long in FromType() (was silently ignored) - Removed CascadeChildScanner full-scan struct - PersistArchetypeState: save EntityMap SPI + NextEntityKey on shutdown - InitializeArchetypes: reload EntityMap from persisted SPI (O(1) reopen) - SpawnBatch/DestroyBatch API for bulk entity operations - QueryRead rename (ReadComponent → QueryRead, query-engine primitive) - ThreadPool.SetMinThreads(96,32) in AssemblyWarmup (reduce parallel flakiness) - Heavy-threading fixtures marked [NonParallelizable]/[Explicit]
…sub-issue 1) EcsView<T> rewritten to inherit ViewBase with push-based incremental refresh via ViewDeltaRingBuffer (ported from View<T>). Three modes: pull (opaque WHERE), incremental (FieldEvaluators + ring buffer), and OR (DNF branch bitmaps). EcsQuery gains WhereField<T>(Expression) for indexed-field predicates, secondary index targeted scan via PipelineExecutor, OrderBy/ Skip/Take, and NavigateField for FK joins. Deleted: View<T>, OrView<T>, ViewTwoComponent, QueryBuilder, QueryBuilderTwoComponent, dbe.Query<T>() entry points, old query tests (112), QueryViewBenchmarks (rewritten for ECS API). Kept: ViewBase, ViewDeltaRingBuffer, ViewRegistry, FieldEvaluator, PipelineExecutor, PlanBuilder, NavigationView/QueryBuilder (used by EcsNavigationQueryBuilder), infrastructure tests (75).
- Remove PK B+Tree entirely: SystemCrud uses direct chunkId, EntityMap
is sole authority for ECS entities, WAL replay uses CompRevTableSegment
scan instead of PK lookup
- Fix EnsureCapacity correctness: pre-allocate segment+directory only,
don't advance linear hash state (was orphaning ~50% of entries)
- Fix ExecuteSplit buffer safety: 8× capacity + runtime overflow guard
- Optimize FinalizeSpawns: hoist EntityMap/SV-index accessors per-archetype,
cache metadata+versionedMask, use InsertNew (skip duplicate check)
- Optimize FlushPendingDestroys: hoist EntityMap accessor per-archetype
- Optimize GetCompRevInfoFromIndex: cached TX-level EntityMap accessor,
O(1) slot lookup via ComponentTypeId (was O(C) linear scan per call)
- SpawnedContains/SpawnedIndexOf: lazy Dictionary for O(1) lookup
- _pendingDestroys: List→HashSet for O(1) Contains
- SpawnEntry: fixed int[] replaces 32 named fields
- EcsCount: int→long return type (overflow fix)
- Dead code removal: PKEntityEnumerator, ExecuteViaLegacy,
ExecuteNavigationTargetFirst/SourceFirst, legacy query paths
- Fix WalReplayHelper.ResetReplayState not called after recovery
- New benchmarks: WriteHeavy_SvIndexed_Batch, EnsureCapacity tests
…o-alloc, Shell commands, benchmarks, 55 new tests
…ents: shadow-before-overwrite capture in EntityRef.Write, ProcessShadowEntries in WriteTickFence, SV destroy index cleanup, 8 new tests
…cutor SV Count/Execute paths, Enable/Disable view notifications, fix ComponentOverhead desync
…yPK paths, two-component combined scan, IsEntityVisible fast path for primary-only, remove unused generics, dead batch code cleanup, FindFKIndex overhead fix, 29 new tests
…ll), make QueryRead/WriteComponent public, delete DestroyByPK bridge method
…der dual-bound fix, query cleanup
…tor SOA overload, tests, benchmarks, EcsMetricsExporter
…up, NavigationView EntityMap port
2 tasks
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.
Summary
Complete ECS API implementation — merges the
feature/ecs-apibranch tomainafter 26 commits spanning the full ECS lifecycle, query migration, batch API, storage mode support, and hardening.Key milestones in this branch
Test results
Closes
Test plan
🤖 Generated with Claude Code