Skip to content

Revert "Entity path methods and bsn entity path resolving (#24018)"#24034

Merged
cart merged 1 commit into
bevyengine:mainfrom
alice-i-cecile:entity-path-reversion
Apr 29, 2026
Merged

Revert "Entity path methods and bsn entity path resolving (#24018)"#24034
cart merged 1 commit into
bevyengine:mainfrom
alice-i-cecile:entity-path-reversion

Conversation

@alice-i-cecile
Copy link
Copy Markdown
Member

This reverts commit 98c6910.

Objective

@cart's objections:

  1. I'm not sure top-level World methods for path-driven access is justifiable in its current form. For anything but the smallest application, looping over every Name in the app to find the one you're looking for is pretty much never what you want
  2. Calling Name::to_string() and collecting the result in a Vec isn't going to cut it performance wise. Even within the scoped context of entity access we shouldn't be doing any allocations or "recomputations". Just the act of comparison across all entities is arguably too expensive

Solution

Revert it for now and go back to revising the work before landing it.

Plan going forward

Core plan:

  1. An EntityRef API that is always relative to the current entity
  2. Grab the Children component.
  3. Iterate over it, read the Name on each component, see if it matches the current piece of the path.
  4. Add docs discouraging usage in most cases; users should prefer EntityTemplate and pre-resolved connections.

As discussed here, opt-in names indexing (both all names for inspector use cases and based on With filters for e.g. animation) should be considered too, but doesn't need to be in the MVP. @laundmo suggests the use of a trie, while Sander says that a hashmap is adequate in flecs.

@alice-i-cecile alice-i-cecile added this to the 0.19 milestone Apr 29, 2026
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events labels Apr 29, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in ECS Apr 29, 2026
@alice-i-cecile alice-i-cecile added S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers labels Apr 29, 2026
@cart cart added this pull request to the merge queue Apr 29, 2026
Merged via the queue into bevyengine:main with commit 0a056c7 Apr 29, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in ECS Apr 29, 2026
tychedelia pushed a commit to processing/bevy that referenced this pull request Apr 30, 2026
…#24018)" (bevyengine#24034)

This reverts commit 98c6910.

# Objective

@cart's
[objections](https://discord.com/channels/691052431525675048/749335865876021248/1499119335828881529):

1. I'm not sure top-level World methods for path-driven access is
justifiable in its current form. For anything but the smallest
application, looping over every Name in the app to find the one you're
looking for is pretty much never what you want
2. Calling Name::to_string() and collecting the result in a Vec isn't
going to cut it performance wise. Even within the scoped context of
entity access we shouldn't be doing any allocations or "recomputations".
Just the act of comparison across all entities is arguably too expensive

## Solution

Revert it for now and go back to revising the work before landing it.

## Plan going forward

[Core
plan](https://discord.com/channels/691052431525675048/749335865876021248/1499120012034838692):

1. An EntityRef API that is always relative to the current entity
2. Grab the Children component.
3. Iterate over it, read the Name on each component, see if it matches
the current piece of the path.
4. Add docs discouraging usage in most cases; users should prefer
`EntityTemplate` and pre-resolved connections.

As discussed
[here](https://discord.com/channels/691052431525675048/749335865876021248/1499120218927271987),
opt-in names indexing (both all names for inspector use cases and based
on With filters for e.g. animation) should be considered too, but
doesn't need to be in the MVP. @laundmo suggests the use of a trie,
while Sander says that a hashmap is adequate in flecs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants