bevy/crates/bevy_ecs/src
andriyDev f163649b48
Use component_access_set to determine the set of conflicting accesses between two systems. (#19495)
# Objective

- Fixes #4381

## Solution

- Replace `component_access` with `component_access_set` when
determining conflicting systems during schedule building.
- All `component_access()` impls just forward to
`&component_access_set().combined_access`, so we are essentially trading
`Access::is_compatible` for `FilteredAccessSet::is_compatible`.
- `FilteredAccessSet::get_conflicts` internally calls
`combined_access.is_compatible` as the first step, so we can remove that
redundant check.

## Testing

- Un-ignored a previously failing test now that it passes!
- Ran the `build_schedule` benchmark and got basically no change in the
results. Perhaps are benchmarks are just not targetted towards this
situation.
```
$ critcmp main fix-ambiguity -f 'build_schedule'
group                                          fix-ambiguity                          main
-----                                          -------------                          ----
build_schedule/1000_schedule                   1.00       2.9±0.02s        ? ?/sec    1.01       2.9±0.05s        ? ?/sec
build_schedule/1000_schedule_no_constraints    1.02     48.3±1.48ms        ? ?/sec    1.00     47.4±1.78ms        ? ?/sec
build_schedule/100_schedule                    1.00      9.9±0.17ms        ? ?/sec    1.06     10.5±0.32ms        ? ?/sec
build_schedule/100_schedule_no_constraints     1.00   804.7±21.85µs        ? ?/sec    1.03   828.7±19.36µs        ? ?/sec
build_schedule/500_schedule                    1.00    451.7±7.25ms        ? ?/sec    1.04   468.9±11.70ms        ? ?/sec
build_schedule/500_schedule_no_constraints     1.02     12.7±0.46ms        ? ?/sec    1.00     12.5±0.44ms        ? ?/sec
```
2025-06-09 19:40:52 +00:00
..
entity Replace (Partial)Ord for EntityGeneration with corrected standalone method (#19432) 2025-06-07 22:29:13 +00:00
error More uninlined_format_args fixes (#19396) 2025-05-28 02:35:18 +00:00
event Remove apostrophes in possessive its (#19244) 2025-05-26 19:53:14 +00:00
observer Remove entity placeholder from observers (#19440) 2025-06-09 19:37:56 +00:00
query Mention Mut in QueryData docs, clarify behaviour of Mut vs &mut in Mut docs (#19254) 2025-06-09 19:21:04 +00:00
reflect bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
relationship Add a despawn_children method to EntityWorldMut and EntityCommands (#19283) 2025-06-09 19:31:40 +00:00
schedule Use component_access_set to determine the set of conflicting accesses between two systems. (#19495) 2025-06-09 19:40:52 +00:00
storage Remove invalid entity locations (#19433) 2025-05-31 16:34:33 +00:00
system Clarify docs for transmute_lens functions (#19233) 2025-06-09 19:10:59 +00:00
world Remove entity placeholder from observers (#19440) 2025-06-09 19:37:56 +00:00
archetype.rs Trigger ArchetypeCreated event when new archetype is created (#19455) 2025-06-02 22:27:45 +00:00
batching.rs Nonmax all rows (#19132) 2025-05-26 17:39:55 +00:00
bundle.rs Remove entity placeholder from observers (#19440) 2025-06-09 19:37:56 +00:00
change_detection.rs Mention Mut in QueryData docs, clarify behaviour of Mut vs &mut in Mut docs (#19254) 2025-06-09 19:21:04 +00:00
component.rs Only get valid component ids (#19510) 2025-06-06 20:59:57 +00:00
entity_disabling.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
hierarchy.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
intern.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
label.rs Remove upcasting methods + Cleanup interned label code (#18984) 2025-05-26 15:38:12 +00:00
lib.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
name.rs Make entity generation a new type and remove identifier (#19121) 2025-05-08 04:03:05 +00:00
never.rs Use never_say_never hack to work around Rust 2024 regression for fn traits (#18804) 2025-04-14 19:59:48 +00:00
removal_detection.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
resource.rs refactor(utils): move SyncCell and SyncUnsafeCell to bevy_platform (#19305) 2025-05-27 04:57:26 +00:00
spawn.rs Increase upper limit of children! (#18865) 2025-05-06 00:58:30 +00:00
traversal.rs Add missing words in Traversal doc comment (#19298) 2025-05-19 19:34:59 +00:00