-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve all internal ambiguities #10411
resolve all internal ambiguities #10411
Conversation
…e_accessibility_nodes
… outside the system adding
Strongly in favor of this. I'm fine with either solution 1 or 2 for fixing the outstanding ambiguity: I think we may actually want both. I like splitting that work out of this PR though, and merging this ASAP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed my opinion on the best path forward following discussion on Discord by @hymm :)
@jakobhellermann can you update the PR description and title to match the latest changes? |
/// Suppress warnings and errors that would result from systems in these sets having ambiguities | ||
/// (conflicting access but indeterminate order) with systems in `set`. | ||
#[track_caller] | ||
pub fn ignore_ambiguities<M1, M2, S1, S2>(&mut self, a: S1, b: S2) -> &mut Self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this just sugar for configure_sets(a.ambiguous_with(b))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thread 'main' panicked at /home/jakob/dev/rust/bevy/crates/bevy_ecs/src/schedule/config.rs:533:38:
configuring system type sets is not allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we're being too strict here and should just deny using system type sets with in_set
instead of any configuration. @maniwani any opinion?
edit: this is non-blocking and can be done in a separate pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think that's a pretty reasonable way to increase the flexibility of the API. in_set
is definitely a mistake, but being able to configure public systems without an explicit label seems safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what's being asked here. in_set
should already fail if given a system type set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should configure_set(my_system.before(ArbitraryLabel))
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last I remember, if you call configure_set
or in_set
with a system type set, it should immediately error at runtime. Maybe somebody changed that, but the error was intentional.
It'd be too easy to call that with a system that's in many places like apply_deferred
.
You can pass a system type set into the ambiguity-related methods. However, for similar reasons, if there are multiple instances of that system in the schedule, you'll get a schedule build error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error on in_set
should be obvious. Users shouldn't be adding any other kind of system to the type set.
The immediate error on configure_set
is directed at stopping users from calling before
, after
, run_if
, and in_set
and it affecting every single instance of a system.
It'd be a little more complicated, but someone could tweak that so that configure_set
doesn't error if you only call ambiguity methods. I don't know if that's generally "safe" to use tho. I think you'd have to get rid of that schedule build check too for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, let's leave it as is for now.
Can you resolve conflicts? Since we're earlier in the cycle now, we'll probably find any problems caused by this pr before release, so I'm fine with merging even if someone from rendering doesn't approve. |
Resolved conflicts, fingers crossed that CI still passes and we can finally merge this <3 |
looks like the failure is real. Something about this line when no default features is used https://github.com/bevyengine/bevy/pull/10411/files#diff-f6e740177ada590c3b70e737730d436f3314a45a6455ce5f5efe6d9bdbfebe98R154 |
Co-authored-by: François <mockersf@gmail.com>
.before(Assets::<Image>::track_assets),
that points into a different schedule (-> should this be caught?)poll_receivers
andupdate_accessibility_nodes
afterwindow_closed
inbevy_winit::accessibility
bevy_ui::accessibility::calc_bounds
afterCameraUpdateSystem
bevy_text::update_text2d_layout
andbevy_ui::text_system
afterfont_atlas_set::remove_dropped_font_atlas_sets
app.ignore_ambiguity(a, b)
function for cases where you want to ignore an ambiguity between two independent pluginsA
andB
IgnoreAmbiguitiesPlugin
inDefaultPlugins
that allows cross-crate ambiguities likebevy_animation
/bevy_ui
Before
Render
PostUpdate
After
Render
PostUpdate