Skip to content

[Core]: Fix entity generation overflow - #70

Merged
nircoe merged 2 commits into
refactor/dod_ecsfrom
nircoe/refactor/dod_ecs/fix_entity_generation_overflow
Sep 28, 2026
Merged

nircoe merged 2 commits into
refactor/dod_ecsfrom
nircoe/refactor/dod_ecs/fix_entity_generation_overflow

Conversation

@nircoe

@nircoe nircoe commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

entities::destroy() incremented a recycled id's generation with no bound, letting it wrap past entity::MAX_GENERATIONS and risk colliding with the invalid entity sentinel.
It now retires an id permanently once its generation reaches the maximum, instead of recycling it.

  • Guard destroy() against generation overflow, retiring an id once it reaches entity::MAX_GENERATIONS
  • Remove the redundant generation check in create()'s recycle path
  • Add a regression test covering the recycle path up to and past the generation limit

@nircoe nircoe self-assigned this Sep 27, 2026
@nircoe
nircoe marked this pull request as ready for review September 28, 2026 16:04
@nircoe
nircoe merged commit 58eb0ce into refactor/dod_ecs Sep 28, 2026
8 checks passed
@nircoe
nircoe deleted the nircoe/refactor/dod_ecs/fix_entity_generation_overflow branch September 28, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant