Skip to content

Remove flush_and_reserve_invalid_assuming_no_entities#16460

Merged
alice-i-cecile merged 4 commits intobevyengine:mainfrom
SpecificProtagonist:remove-flush-reserve-invalid-and
Dec 3, 2024
Merged

Remove flush_and_reserve_invalid_assuming_no_entities#16460
alice-i-cecile merged 4 commits intobevyengine:mainfrom
SpecificProtagonist:remove-flush-reserve-invalid-and

Conversation

@SpecificProtagonist
Copy link
Copy Markdown
Contributor

@SpecificProtagonist SpecificProtagonist commented Nov 21, 2024

Objective

flush_and_reserve_invalid_assuming_no_entities was made for the old rendering world (which was reset every frame) and is usused since the 0.15 retained rendering world, but wasn't removed yet. It is pub, but is undocumented apart from the safety comment.

Solution

Remove flush_and_reserve_invalid_assuming_no_entities and the safety invariants this method required for EntityMeta, EntityLocation, TableId and TableRow. This reduces the amount of unsafe code & safety invariants and makes #16047 easier.

Alternatives

  • Document flush_and_reserve_invalid_assuming_no_entities and keep it unchanged
  • Document flush_and_reserve_invalid_assuming_no_entities and change it to be based on EntityMeta::INVALID

Migration Guide

  • exchange Entities::flush_and_reserve_invalid_assuming_no_entities for reserve and flush_as_invalid and notify us if that's insufficient

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide labels Nov 21, 2024
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Nov 21, 2024
@alice-i-cecile alice-i-cecile added the C-Code-Quality A section of code that is hard to understand or change label Nov 21, 2024
@alice-i-cecile
Copy link
Copy Markdown
Member

I feel quite strongly that we should get rid of this. Keeping around unsafe backdoors with no users is just asking for surprising problems. For the migration guide, I mostly want them to tell us why they were using this!

@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Nov 21, 2024
Co-authored-by: Benjamin Brienen <[email protected]>
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 22, 2024
Merged via the queue into bevyengine:main with commit 1a6b94c Dec 3, 2024
ecoskey pushed a commit to ecoskey/bevy that referenced this pull request Jan 6, 2025
# Objective

`flush_and_reserve_invalid_assuming_no_entities` was made for the old
rendering world (which was reset every frame) and is usused since the
0.15 retained rendering world, but wasn't removed yet. It is pub, but is
undocumented apart from the safety comment.

## Solution

Remove `flush_and_reserve_invalid_assuming_no_entities` and the safety
invariants this method required for `EntityMeta`, `EntityLocation`,
`TableId` and `TableRow`. This reduces the amount of unsafe code &
safety invariants and makes bevyengine#16047 easier.

## Alternatives
- Document `flush_and_reserve_invalid_assuming_no_entities` and keep it
unchanged
- Document `flush_and_reserve_invalid_assuming_no_entities` and change
it to be based on `EntityMeta::INVALID`


## Migration Guide
- exchange `Entities::flush_and_reserve_invalid_assuming_no_entities`
for `reserve` and `flush_as_invalid` and notify us if that's
insufficient

---------

Co-authored-by: Benjamin Brienen <[email protected]>
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 C-Code-Quality A section of code that is hard to understand or change M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants