outfox / fennecs

... the tiny C# ECS that loves you back!
https://fennecs.tech
MIT License
223 stars 10 forks source link

Potential Hash Collision in Query Cache #30

Open thygrrr opened 1 week ago

thygrrr commented 1 week ago

Query Cache uses just a hash to determine mask equality.

This can lead to incorrect queries being returned by the cache.

It should be used like a proper dictionary, it will require a fast equality check for masks.

It's possible to keep a field in Mask to tag it retroactively as "resolved", but this adds some obtuse logic.