-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Ambiguity reporting does not account for effects of Without query filters, leading to false positives #4381
Copy link
Copy link
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!
Description
Bevy version
0.7.0 dev, also reproduced in #4299.
What you did
(This test is from #4299), but the same failure occurs on main)
fn with_filtered_component_system(_query: Query<&mut A, With<B>>) {}
fn without_filtered_component_system(_query: Query<&mut A, Without<B>>) {}
#[test]
fn filtered_components() {
let mut world = World::new();
let mut test_stage = SystemStage::parallel();
test_stage
.add_system(with_filtered_component_system)
.add_system(without_filtered_component_system);
assert_eq!(
test_stage.n_ambiguities(&mut world, ExecutionOrderAmbiguities::Forbid),
0
);
}What you expected to happen
This test should pass, as it is impossible for the two systems to access the same data.
What actually happened
It fails, and an ambiguity is detected.
Additional context
This is ultimately related to a lack of a clear model for how system access should be handled: read #3119.
This is correctly computed on the basis of hypothetical data access (which should be world agnostic, #4364).
However, the model used isn't strong enough: it's computed purely on the basis of Access<ComponentId>, and cannot account for the effects of query filtering in this way.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!