Repository navigation
Conversation
…m; bump 0.10.37 Co-Authored-By: OpenCode <noreply@opencode.ai>
Collaborator
Author
|
This is not the right direction. We will have to look at generation counters on entities instead. |
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
Retires deleted entity ids in persistent quadrants (
0document,2settings) instead of immediately reusing them through the LIFO free list, so stale entity references faillocate/readinstead of silently aliasing a newly created entity.Design
0,2): Allocate monotonically fromnextIndex++and retire deleted slots (-1), never reusing them on normalcreate/insert. Fits the existing 32-bitI32.schemaEntityrepresentation, archetypeidcolumns, and@adobe/data-persistenceon-disk layout without changing wire or storage widths.1,3): Keep immediate LIFO free-list reuse so transient/ephemeral entities remain memory-bounded.TransactionInsertOperationrecords optionalentity?: Entityso undo-of-delete and redo-of-insert restore the original entity id via an internalRESTORE_ENTITYpath; speculative rollback paths (create-rebase-replay-applier,roll-forward-concurrency,immediate-concurrency, and transaction error rollback) unwind the latest allocation via internalREWIND_DELETEto preserve cross-peer id determinism.ECS_SNAPSHOT_VERSIONbump. Loading legacy snapshots that carry a non-emptyfreeListHeadinto a persistent quadrant resetsfreeListHead = -1so previously freed slots stay retired and post-load allocations advance monotonically pastnextIndex.Verification
pnpm run lint— passedpnpm run typecheck(all 34 workspace projects) — passedpnpm --filter @adobe/data run test— 303/303 files, 3679/3679 tests passedpnpm --filter @adobe/data-persistence run test— 37/37 files, 240/240 tests passed (node + chromium)