Skip to content

Follow ups to bevy 0.16 #650

@ThierryBerger

Description

@ThierryBerger

bevy 0.16 support from #642 left out a few important things:

  • bevy_mod_debugdump is targeting git, we should target the crate when it's released
  • ambiguity detection is failing on a new ambiguity:
    • a fix can be to add .ambiguous_with(bevy::ui::ui_layout_system) on sync_simple_transforms and propagate_parent_transforms ; but further analysis on why this happen and if we can do better would be appreciated.
Patch attempt for ambiguity

This is not enough because we're not sure if bevy ui is in the tree. We could fix it by adding a feature... 🤔 ; but I imagine we should make the propagation more clever...

commit 9f87d5ff64363549e602833a78b39d266bbc6ae0
Author: Thierry Berger <contact@thierryberger.com>
Date:   Fri May 9 09:52:06 2025 +0200

    fix ambiguities

diff --git a/ci/src/bin/ambiguity_detection.rs b/ci/src/bin/ambiguity_detection.rs
index 18c2964..11b5be8 100644
--- a/ci/src/bin/ambiguity_detection.rs
+++ b/ci/src/bin/ambiguity_detection.rs
@@ -19,7 +19,6 @@ fn main() {
             bevy_rapier3d::prelude::RapierPickingPlugin,
         ),
         true,
-        2,
     );
     check_ambiguities(
         (
@@ -27,7 +26,6 @@ fn main() {
             bevy_rapier3d::prelude::RapierPickingPlugin,
         ),
         false,
-        0,
     );
     check_ambiguities(
         (
@@ -35,7 +33,6 @@ fn main() {
             bevy_rapier3d::prelude::RapierPickingPlugin,
         ),
         false,
-        0,
     );
     check_ambiguities(
         (
@@ -43,11 +40,10 @@ fn main() {
             bevy_rapier3d::prelude::RapierPickingPlugin,
         ),
         false,
-        0,
     );
 }
 
-fn check_ambiguities<M>(plugin: impl Plugins<M>, set_logger: bool, ambiguities_expected: usize) {
+fn check_ambiguities<M>(plugin: impl Plugins<M>, set_logger: bool) {
     let mut app = App::new();
     app.add_plugins((MinimalPlugins, TransformPlugin, AssetPlugin::default()));
     if set_logger {
@@ -65,8 +61,7 @@ fn check_ambiguities<M>(plugin: impl Plugins<M>, set_logger: bool, ambiguities_e
     let main_app_ambiguities = count_ambiguities(app.main());
     assert_eq!(
         main_app_ambiguities.total(),
-        // FIXME: We should find those ambiguity and fix it, this should be 0
-        ambiguities_expected,
+        0,
         "Main app has unexpected ambiguities among the following schedules: \n{main_app_ambiguities:#?}.",
     );
 }
@@ -102,7 +97,7 @@ fn count_ambiguities(sub_app: &SubApp) -> AmbiguitiesCount {
                 info!("Conflicting systems: {system_a:?} and {system_b:?} over components:");
                 for component in components {
                     let component_info = sub_app.world().components().get_info(*component).unwrap();
-                    info!("{}", component_info.name());
+                    info!("{:?}: {}", component_info.id(), component_info.name());
                 }
             },
         );
diff --git a/src/plugin/plugin.rs b/src/plugin/plugin.rs
index 7191e78..9f00793 100644
--- a/src/plugin/plugin.rs
+++ b/src/plugin/plugin.rs
@@ -136,8 +136,10 @@ where
                     .in_set(PhysicsSet::SyncBackend),
                 // Run Bevy transform propagation additionally to sync [`GlobalTransform`]
                 (
-                    bevy::transform::systems::sync_simple_transforms,
-                    bevy::transform::systems::propagate_parent_transforms,
+                    bevy::transform::systems::sync_simple_transforms
+                        .ambiguous_with(bevy::ui::ui_layout_system),
+                    bevy::transform::systems::propagate_parent_transforms
+                        .ambiguous_with(bevy::ui::ui_layout_system),
                 )
                     .chain()
                     .in_set(RapierTransformPropagateSet),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions