Repository navigation
Prevent empty registry rows from retaining unused entities - #63
Merged
HexDecimal merged 3 commits intoOct 18, 2026
Merged
Conversation
Read optional components without allocating sparse-set entries, and avoid creating rows when removals fail. Clear empty component and tag rows so unused entities can be collected while incoming relations and external references retain their existing ownership semantics. Preserve existing query behavior and the save schema.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 99.17% 99.18% +0.01%
==========================================
Files 9 9
Lines 966 981 +15
==========================================
+ Hits 958 973 +15
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
HexDecimal
requested changes
Oct 18, 2026
HexDecimal
left a comment
Owner
There was a problem hiding this comment.
These fixes are good, but this PR seems to showcase an architectural issue with the existing code. It appears that defaultdict is causing more problems than it solves.
I'll approve this with some minor changes.
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.
Component reads and failed removals can create empty registry rows. Clearing tags also recreates an empty row when checking its loop condition. These rows keep otherwise unused entities alive, and the empty tag rows enter saved games.
Use non-inserting lookups and remove empty rows during cleanup. Live references and incoming relations still retain their entities; query results and the save schema are preserved. This follows the lifetime behavior explained in #9.
Validation: