Don't associate a single archetype with two different queries #5029
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.
The newly introduced point and line visualizers for the new
Scalar
archetype associate two different queries with a single archetype (the first one ispov:[Scalar] comps:[Color, MarkerShape, Text]
, the second one ispov:[Scalar] comps:[Color, Text]
).This is a big issue since the cache currently considers each archetype to be a single unique query.
If you first query using the query that lacks
MarkerShape
, and then queries with the other one, then theMarkerShape
will be missing since the data has been cached without it (and the cache has no reason to believe that it is missing anything nor does it have to invalidate stuff).That's the root cause for the wave of bugs that came up at the end of last week.
#5016 and #5007 fixed the symptoms of that (which is still a good thing), but I never had the time to look into why that was happening in the first place, until now.
Now, ultimately, the right thing to do is to remove the notion of archetype from the cache entirely: the cache doesn't care about archetypes, it cares about point-of-views and queried components.
This is already what's planned: the only reason the cache is aware of archetypes right now is that it builds on the pre-existing query system which requires archetype types to be passed around.
In this specific case, though, it still seems wasteful to treat these two queries as different queries: it is much more efficient to always query for
MarkerShape
and not use it than it is to maintain two different caches for these two different visualizers.Checklist
main
build: app.rerun.ionightly
build: app.rerun.io