Skip to content

Fix regressions archetype table separation introduced#251

Merged
waynemwashuma merged 3 commits into
wimaengine:devfrom
waynemwashuma:fix-regressions-archetype-table-separation-introduced
Sep 13, 2025
Merged

Fix regressions archetype table separation introduced#251
waynemwashuma merged 3 commits into
wimaengine:devfrom
waynemwashuma:fix-regressions-archetype-table-separation-introduced

Conversation

@waynemwashuma
Copy link
Copy Markdown
Collaborator

@waynemwashuma waynemwashuma commented Sep 13, 2025

Objective

Addresses critical logical and performance regressions and soundness issues in the ECS world.

Solution

  • Fixed Archetype Resolution: Deduplicated type IDs are used to create creating new archetypes, preventing duplicate component types from causing incorrect archetype matching.
  • Optimized Component Insertion: When inserting components into an existing entity, the system now checks if the operation can be performed within the same table instead of always moving to a new table. This eliminates unnecessary data movement when the table structure doesn't change.

Showcase

The improvements are most noticeable in scenarios with frequent component additions and dublicate components:

Migration Guide

No breaking changes were introduced.

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

This was previously solved but was reentroduced
when separating archetypes and tables.Redundant
archetypes occur when dublicated components are
inserted into an entity.
A component(s) which already exist on an entity is
not inserted.This was because the entity is moved
from the table into the same table, this logic is
unsound as it is moved to a new row invalidting
the previous row thus the entity should not be moved.
Instead,just update the entity at its row.
@waynemwashuma waynemwashuma self-assigned this Sep 13, 2025
@waynemwashuma waynemwashuma added type:bug Something isn't working mod:ecs labels Sep 13, 2025
@waynemwashuma waynemwashuma merged commit a3e431e into wimaengine:dev Sep 13, 2025
5 checks passed
@waynemwashuma waynemwashuma deleted the fix-regressions-archetype-table-separation-introduced branch September 13, 2025 07:10
@waynemwashuma waynemwashuma added the scope:regression This PR/issue was previously solved but is reintroduced label Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:ecs scope:regression This PR/issue was previously solved but is reintroduced type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant