-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Ignore ambiguous components or resources #9895
Conversation
@rj00a can I get your review on this as a user please? |
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.
We should probably use this internally in this PR for some of our asset collection ambiguities.
@alice-i-cecile I added exceptions for |
@@ -1710,6 +1732,22 @@ impl ScheduleBuildSettings { | |||
} | |||
} | |||
|
|||
/// list of [`ComponentId`]'s to ignore when reporting ambiguity conflicts between systems | |||
#[derive(Resource, Default, Clone)] | |||
pub struct IgnoreSchedulingAmbiguities(Vec<ComponentId>); |
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.
This should have two distinct fields: one for resources, and one for components. Otherwise the API below doesn't make sense.
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 difference between one or two fields can't be observed in the API, so this seems alright to me. Only reason I could think to split it would be for a nicer Debug
impl.
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'm not a fan of splitting it up, makes the logic for filtering more complicated.
I think so: @cart's opinion was that basically all of these ambiguities are noise. Probably include it in the docs for asset registration too? |
24e1525
to
d5f0864
Compare
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 approach looks good to me.
Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
14a6808
to
3d407c5
Compare
@@ -261,6 +261,9 @@ pub trait AssetApp { | |||
/// * Registering the [`Asset`] in the [`AssetServer`] | |||
/// * Initializing the [`AssetEvent`] resource for the [`Asset`] | |||
/// * Adding other relevant systems and resources for the [`Asset`] | |||
/// * Ignoring schedule ambiguities in [`Assets`] resource. Any time a system takes |
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.
Nit: a unit test to validate that these docs stay correct would be nice.
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.
Not sure how I like the idea of using a resource for this purpose. It seems trivial to alter behavior at runtime by mutating or removing the resource. IMO this should be a part of the World itself instead of included as an item we store in it.
We already store Schedules as a resource to be fair. I'd rather make this a field of that than move it up to the World level. |
I actually started with it as part of |
I think that this is tightly coupled to the scheduling information: long-term, I think that all of our cross-schedule config belongs under |
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
# Objective - Fixes bevyengine#9884 - Add API for ignoring ambiguities on certain resource or components. ## Solution - Add a `IgnoreSchedulingAmbiguitiy` resource to the world which holds the `ComponentIds` to be ignored - Filter out ambiguities with those component id's. ## Changelog - add `allow_ambiguous_component` and `allow_ambiguous_resource` apis for ignoring ambiguities --------- Co-authored-by: Ryan Johnson <ryanj00a@gmail.com>
Objective
Solution
IgnoreSchedulingAmbiguitiy
resource to the world which holds theComponentIds
to be ignoredChangelog
allow_ambiguous_component
andallow_ambiguous_resource
apis for ignoring ambiguities