Example:
fn a() {}
fn b(_: Query<&mut Foo>) {}
fn c(_: Commands) {}
fn d(_: Query<&mut Foo>) {}
app.add_systems(Update, (a, b).chain());
app.add_systems(Update, (c, d).chain());
In this example, systems b and d are ambiguous. However, since c has commands, an apply_deferred stage will be inserted between c and d. This accidentally resolves the ambiguity between b and d since b and d are now separated by an apply_deferred.
If however we add mut commands: Commands to a, b and d will now be reported as ambiguous! This is confusing since we never touched b or d! In fact, user code (not just internal Bevy code) can induce ambiguity to appear just by add before/after constraints on Bevy internal systems.
We should at least get Bevy internals to be resilient to this!
Discord discussion: https://discord.com/channels/691052431525675048/749335865876021248/1491243586082181312
Example:
In this example, systems
banddare ambiguous. However, sincechas commands, anapply_deferredstage will be inserted betweencandd. This accidentally resolves the ambiguity betweenbanddsincebanddare now separated by anapply_deferred.If however we add
mut commands: Commandstoa,banddwill now be reported as ambiguous! This is confusing since we never touchedbord! In fact, user code (not just internal Bevy code) can induce ambiguity to appear just by add before/after constraints on Bevy internal systems.We should at least get Bevy internals to be resilient to this!
Discord discussion: https://discord.com/channels/691052431525675048/749335865876021248/1491243586082181312