Repository navigation
Upgrade flecs core to upstream master 6e4cd338a - #301
Merged
Merged
Conversation
…ut, meta member tests
…, add reuse tests
…_fragment wildcard gets
…s, refresh stale snapshots
# Conflicts: # flecs_ecs/src/core/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade flecs core to upstream master 6e4cd338a
Flecs core: Upgrades base from
9930c85to upstream master6e4cd338a(474 upstream commits).Vendored via: Fork integration branch
8a7c39fab(mergesindradb/on-replace,table_column_locks_cr_locks,indradb/rust).User-Facing Additions
Hierarchy & Entities
world.entity_child_of(parent)/entity_named_child_of()/prefab_child_of()/prefab_named_child_of()— fragmenting(ChildOf, parent)pair storage. Each distinct parent is a distinct pair id, so children of different parents live in different tables: fast per-parent iteration, fullcascade/upquery support, but many parents means many tables and reparenting is an archetype move. Same mechanism as the.child_of()builder method.world.entity_with_parent(parent)/entity_named_with_parent()— non-fragmenting hierarchy via the newflecs::Parentcomponent (plus(ParentDepth, depth)value pair). The parent is column data, so all children share tables regardless of parent: no table explosion with thousands of parents, and reparenting is a cheap component write instead of an archetype move. Built for deep or highly dynamic scene graphs.cascade-style queries →child_of; huge parent counts / frequent reparenting →with_parent.flecs::Parent,flecs::TreeSpawner, andflecs::ParentDepth.World::each_alive_entity(),World::new_mini(),World::release(),is_defer_suspended(), and the entity range API (entity_range_new/set/get,EntityRange).set_ptr/set_ptr_with_sizenow accept pairs (impl IntoId, upstream #1866); modules get(With, Singleton).Queries & Optimization
world.sparse_query::<T>()): Cache-less, allocation-free iteration directly over sparse component storages. Component requirements checked at compile time.#[flecs(traits(Sparse))],traits(DontFragment), andtraits((OnInstantiate, ...))now emitComponentInfoconsts (IS_SPARSE,IS_DONT_FRAGMENT,ON_INSTANTIATE). Invalid sparse-query combinations fail at compile time.get/try_get/clonedon compile-time sparse/dont_fragment components bypass table-record lookups and read directly from sparse storage. (Parity with C++is_get_sparse_component; non-pair components only).group_byis now unsorted by default. Added.group_by_ordered(), group flags,Query::each_group(),System::set_group()/clear_group(), andQuery::has()/has_table()/has_table_range().Systems, Observers & Hooks
Observer::update::<T>()andSystem::update::<T>(). Builders now create entities lazily; system phase is set viadesc.phase.Component::on_validate(): Runs beforeon_set/OnSet. Returningfalsesuppresses them.Component::on_replace():(entity, prev, next)callback invoked beforenextoverwritesprev.Meta & Examples
UntypedComponent::create_member_entities()(required for member DSL queries/metrics/alerts),flecs::meta::Map/Valuetypes,EcsTypeKindvariants, and member accessors.API Renames (rust-idiomatic naming)
_w_→_with_throughout the Rust API (the_w_abbreviation stays C-only):set_ptr_with_size,path_with_sep,path_from_with_sep,set_rate_with_tick_source,entity_bulk_with_entity_ids,EntityView::new_with_parent/new_with_id/new_with_entity/new_with_entity_ids. FFI symbols (sys::ecs_field_w_size, etc.) are unchanged, they mirror C.Breaking Changes
EntityView::child()andchild_named(). Useworld.entity_child_of(parent)orentity_named_child_of(parent, name)instead.4fd6b8dcaparity). Entities left in a namespace a module is reparented out of are deleted with it — don't share a module's pre-reparent namespace with your own entities.flecs::Private/FlecsInternals. Builtin ID renumbering updated to match upstream.create_member_entities()per type if needed.group_byiteration order is now unspecified unlessgroup_by_orderedis explicitly used.(OnInstantiate, Inherit)to a compile-time sparse component now asserts in debug builds. Use#[flecs(traits(...))]instead.on_replaceonly fires on genuine replacement. Ported C/C++ code relying on it for first-time initialization must migrate toon_add/on_set.Soundness & Bug Fixes
CachedRefread uninitialized memory in release profiles because bindings lacked theFLECS_DEBUGtrailing fields. Bindings are now profile-matched, andCachedRefstores the component ID directly.flecs_safety_locks,ecs_get_ptr_tis a barevoid*; field accesses now go throughget_ptr_raw()/get_ptr_null()helpers (Rust mirror of C'sECS_GET_PTR_PTR/ECS_GET_PTR_NULL), fixing every feature-subset combination incargo hack --each-feature.it.columnsprimary path withit.trsnull-guarded. This fixes multiple null-dereference aborts (hooks, sparse terms, enum systems) that previously caused infinite panic loops.field::<T>Validation: Pair terms now verify thatecs_get_typeid(term_id)matchesTin release builds to prevent type reinterpretation mismatches.getnow resolves the concrete ID viaecs_searchbefore casting; null-table guarded.Tooling & Infrastructure
bindgennow runs twice per regeneration to generate distinctbindings.rs(FLECS_DEBUG) andbindings_release.rs(FLECS_NDEBUG) modules, automatically selected by Cargo's build profile.abi_testusingecs_rust_sizeof_*shims to assert that Rustsize_ofperfectly matches Csizeofacross both profiles.regenerate_bindingremoved fromflecs_ecs_sysdefault features (standalone sys builds no longer silently clobber committed bindings); regen viacargo make regenerate-bindings(full addon feature set); new CIbindings-checkjob regenerates and fails on drift.ecs_checkcompiles out underNDEBUG). Integratedrstesttemplates for fragment/sparse/dont_fragment component lifecycles.