Skip to content

Remote entity reservation v9 #18670

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

Open
wants to merge 118 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
3472810
chunk data
ElliottjPierce Mar 31, 2025
2ce0fb4
get and set chunks
ElliottjPierce Mar 31, 2025
3a8f328
free and alloc
ElliottjPierce Mar 31, 2025
c37c32b
remote_alloc
ElliottjPierce Mar 31, 2025
d40c4ba
SharedAllocator
ElliottjPierce Mar 31, 2025
e028a6d
Allocator
ElliottjPierce Mar 31, 2025
af83bf3
construction
ElliottjPierce Mar 31, 2025
dac8921
fix small bug
ElliottjPierce Mar 31, 2025
cd864b4
fixed another small bug
ElliottjPierce Mar 31, 2025
b38df40
remote allocation
ElliottjPierce Mar 31, 2025
46dce5f
begin integrating the allocator
ElliottjPierce Mar 31, 2025
2bda8ec
fixed length methods
ElliottjPierce Mar 31, 2025
3bd5666
docs and fix errors
ElliottjPierce Mar 31, 2025
4752167
allocation implemented
ElliottjPierce Mar 31, 2025
45693d2
fix reserving
ElliottjPierce Mar 31, 2025
e010509
fix free
ElliottjPierce Mar 31, 2025
0c3507e
RemoteEntities
ElliottjPierce Mar 31, 2025
15e36d5
implement Debug again
ElliottjPierce Mar 31, 2025
c1bff6c
fixed bug where entity length was wrong
ElliottjPierce Apr 1, 2025
867baff
don't test unimplemented
ElliottjPierce Apr 1, 2025
cb298fa
rename for clarity
ElliottjPierce Apr 1, 2025
86c0cda
track pending and flush
ElliottjPierce Apr 1, 2025
c4e2f56
clarified flush behavior
ElliottjPierce Apr 1, 2025
7333626
allow remote pending to be flushed
ElliottjPierce Apr 1, 2025
a8ce70d
queue pending
ElliottjPierce Apr 1, 2025
3abdac7
flush reserve_entities
ElliottjPierce Apr 1, 2025
f729253
naming consistency
ElliottjPierce Apr 1, 2025
af9f9db
iterator drop warning
ElliottjPierce Apr 1, 2025
7edefb5
restore old `get` behavior
ElliottjPierce Apr 1, 2025
e11d173
fixed flushing
ElliottjPierce Apr 1, 2025
ee4aca2
performance note
ElliottjPierce Apr 1, 2025
fc8b229
improve bulk reservation performance via slice iterators
ElliottjPierce Apr 1, 2025
b8ca351
remove unimplemented benches
ElliottjPierce Apr 1, 2025
9a227ec
inlining
ElliottjPierce Apr 1, 2025
804c513
remove unneeded flush
ElliottjPierce Apr 1, 2025
7325370
removed or justified more flush calls
ElliottjPierce Apr 1, 2025
c3530d9
improve spawn batch perf by 50%
ElliottjPierce Apr 1, 2025
6aa5de6
added a early return for local
ElliottjPierce Apr 1, 2025
c9ddbde
Revert "added a early return for local"
ElliottjPierce Apr 1, 2025
6741f70
fixed doc
ElliottjPierce Apr 1, 2025
d4ab0be
fix test
ElliottjPierce Apr 1, 2025
773cddf
fix docs
ElliottjPierce Apr 1, 2025
4fa1764
improve clarity of pending list
ElliottjPierce Apr 2, 2025
7553d11
use atomics for Slot
ElliottjPierce Apr 2, 2025
e22b93f
new length tracking system
ElliottjPierce Apr 2, 2025
aef45a9
polish
ElliottjPierce Apr 2, 2025
ef1ff7d
Fix length encoding bug
ElliottjPierce Apr 2, 2025
2bb1ae5
fix generation logic
ElliottjPierce Apr 3, 2025
76f6709
suggestions from review
ElliottjPierce Apr 3, 2025
3352576
ensure the free list has valid data
ElliottjPierce Apr 3, 2025
bc1797e
Fix typos
ElliottjPierce Apr 3, 2025
91113a2
post review rename
ElliottjPierce Apr 3, 2025
ffbf746
fix doc
ElliottjPierce Apr 3, 2025
cdafe06
pack entities when supported
ElliottjPierce Apr 3, 2025
a3791ba
Retain benchmarks
ElliottjPierce Apr 3, 2025
9ee241b
fix compile
ElliottjPierce Apr 3, 2025
92a7c1c
justify `set_len` generation
ElliottjPierce Apr 3, 2025
bf9e308
use disabling for freeing
ElliottjPierce Apr 3, 2025
4fcb74c
remote allocation never leaks
ElliottjPierce Apr 3, 2025
2c08503
justify encode_pop
ElliottjPierce Apr 3, 2025
37732b2
updated FreeBufferLen docs
ElliottjPierce Apr 3, 2025
fd68df5
improve perf of Slot::set
ElliottjPierce Apr 3, 2025
1b77882
fix lint
ElliottjPierce Apr 3, 2025
3e7ad2c
added migration guide
ElliottjPierce Apr 4, 2025
1f186b9
relax safety on `Slot::get`
ElliottjPierce Apr 5, 2025
4a088b3
clean up safety comments
ElliottjPierce Apr 5, 2025
72ec8a8
simplified `map_to_indices`
ElliottjPierce Apr 5, 2025
3ec4d6a
simplified buffer construction
ElliottjPierce Apr 5, 2025
335f916
create a separate chunk buffer type
ElliottjPierce Apr 5, 2025
fa98c39
document new functions
ElliottjPierce Apr 5, 2025
9a7133d
renames
ElliottjPierce Apr 5, 2025
81618f0
use strong arcs for remote allocation
ElliottjPierce Apr 5, 2025
6d00049
removed Slot::ptr
ElliottjPierce Apr 5, 2025
27c17c6
fixed alloc_many bug
ElliottjPierce Apr 5, 2025
5fce1f9
fixed doc
ElliottjPierce Apr 5, 2025
a419834
fix alloc_many bug
ElliottjPierce Apr 5, 2025
a8e4fda
use try_from_bits
ElliottjPierce Apr 5, 2025
a590137
reded FreeCount
ElliottjPierce Apr 5, 2025
797310c
inlining
ElliottjPierce Apr 5, 2025
b9a9430
rename for clarity
ElliottjPierce Apr 5, 2025
880a98d
fixed doc
ElliottjPierce Apr 5, 2025
2447190
provide spinloop escape hatch
ElliottjPierce Apr 7, 2025
c3bc4ad
Merge branch 'main' into Remote-Entity-Reservation-v9
ElliottjPierce Apr 18, 2025
4fd8d92
fixed bevy platform rename
ElliottjPierce Apr 18, 2025
8850a55
Apply suggestions from code review
ElliottjPierce Apr 20, 2025
ab9f9fd
remove unneeded parentheses
ElliottjPierce Apr 20, 2025
f0d830f
Merge branch 'Remote-Entity-Reservation-v9' of https://github.com/Ell…
ElliottjPierce Apr 20, 2025
9e7c308
Clarify todo
ElliottjPierce Apr 21, 2025
f2b991a
fix wrong comment
ElliottjPierce Apr 21, 2025
4eead35
document and justify `Slot`
ElliottjPierce Apr 21, 2025
17506fe
Clarify comments
ElliottjPierce Apr 21, 2025
1fdbdfa
Fix more comments
ElliottjPierce Apr 21, 2025
8165830
Fix even more comments
ElliottjPierce Apr 21, 2025
e0e5ffd
clarify concurrency comments
ElliottjPierce Apr 21, 2025
29745c7
Merge branch 'Remote-Entity-Reservation-v9' of https://github.com/Ell…
ElliottjPierce Apr 21, 2025
10932c7
clarify what empty slot means
ElliottjPierce Apr 21, 2025
061c85a
Merge branch 'main' into Remote-Entity-Reservation-v9
ElliottjPierce May 8, 2025
1ce4951
fix Entities
ElliottjPierce May 8, 2025
4695899
pushed problems to allocator
ElliottjPierce May 8, 2025
d5b9566
fixed all the errors
ElliottjPierce May 8, 2025
3bf8506
small fixes
ElliottjPierce May 8, 2025
98d4ddc
fix free list iterator
ElliottjPierce May 8, 2025
2853878
tests pass
ElliottjPierce May 8, 2025
92be130
use AllocUniqueEntitiyRowIterator
ElliottjPierce May 8, 2025
3c653b5
final fixes to allocator
ElliottjPierce May 8, 2025
4841bea
final touches to Entities
ElliottjPierce May 8, 2025
f7ccc67
typos
ElliottjPierce May 8, 2025
392b12b
fix no u64 atomics
ElliottjPierce May 8, 2025
6241bee
redo migration guide
ElliottjPierce May 8, 2025
ca8babb
ok, now no u64 atomics should work.
ElliottjPierce May 8, 2025
08883b1
Better wording for a comment
ElliottjPierce May 9, 2025
5fdf8f4
Apply suggestions from Doot's review
ElliottjPierce May 11, 2025
016bbfd
use from_raw_and_generation
ElliottjPierce May 11, 2025
5fb2e20
clarify risks of set_state_risky
ElliottjPierce May 15, 2025
7213070
remove comment for num_free
ElliottjPierce May 15, 2025
961ad11
better naming of FreeBufferIterator
ElliottjPierce May 15, 2025
2fc167b
Merge branch 'main' into Remote-Entity-Reservation-v9
ElliottjPierce May 28, 2025
71921de
fix formatting
ElliottjPierce May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/bevy_app/src/sub_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ impl SubApp {
/// Runs the default schedule and updates internal component trackers.
pub fn update(&mut self) {
self.run_default_schedule();
self.world.entities().queue_remote_pending_to_be_flushed();
self.world.clear_trackers();
}

Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/archetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ pub struct ArchetypeId(u32);
impl ArchetypeId {
/// The ID for the [`Archetype`] without any components.
pub const EMPTY: ArchetypeId = ArchetypeId(0);
/// This represents an archetype that does not actually exist.
/// This can be used as a placeholder.
///
/// On an entity, this archetype signals that the entity is not yet part of any archetype.
///
/// # Safety:
///
/// This must always have an all-1s bit pattern to ensure soundness in fast entity id space allocation.
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1701,6 +1701,8 @@ impl<'w> BundleSpawner<'w> {
table.reserve(additional);
}

/// **Note:** This will not cause eny entities to be freed.
///
/// # Safety
/// `entity` must be allocated (but non-existent), `T` must match this [`BundleInfo`]'s type
#[inline]
Expand Down
Loading