SparseSet components cause incorrect Query output #7831
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
P-Critical
This must be fixed immediately or contributors or users will be severely impacted
P-Unsound
A bug that results in undefined compiler behavior
Milestone
Bevy version
#41fec57
What you did
Not present in
0.9
, but is at least as old as commit #943499.It can be triggered by spawning many entities (10,000?) with both
Table
andSparseSet
components and inserting / removingSparseSet
components quicklyThe bug manifests itself by messing with query results, returning incorrect values for a given entity.
These values are valid, just not for the Entity I am querying for.
The bug disappears when I switch all of the components to use
Table
storage.Here is a log from my game.
I never update the components
Transform
orChunkPos
for these entities, it's only set once when the entity is spawned.Note that the entity is the same in each tick, I am checking the same Entity and have disabled despawning:
What went wrong
Query::get
returned unexpectedly changed values, when no part of the code is actually modifying the valuesAdditional Information
SparseSet
components are ZSTThe text was updated successfully, but these errors were encountered: