New API for supporting mut aliasing safety#1753
Open
Indra-db wants to merge 46 commits intoSanderMertens:masterfrom
Open
New API for supporting mut aliasing safety#1753Indra-db wants to merge 46 commits intoSanderMertens:masterfrom
Indra-db wants to merge 46 commits intoSanderMertens:masterfrom
Conversation
Contributor
Author
|
ci test, I expect a failure somewhere, I cannot run tests locally due to bake being problematic (see discord) |
Contributor
Author
|
all tests passing 🥳 |
Contributor
@Indra-db could you link the message, I think i also have similar issues |
Contributor
Author
|
Tldr, Sander told me to use |
Contributor
Author
|
@Reddy-dev this was my thread where I was dumping my experience (which I closed) |
Contributor
Author
|
update to latest main |
03f2a1c to
3e9b117
Compare
d4af765 to
82365c3
Compare
Owner
commit b3b50fc Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Sep 14 01:15:40 2025 +0900 unused parameter fix. commit f23337b Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sat Sep 13 18:53:24 2025 +0900 add tests to verify safety info is correctly initialized commit 87b9a1f Merge: 936aba1 98d3437 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sat Sep 13 18:15:14 2025 +0900 update to latest main commit 936aba1 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 17:53:25 2025 +0900 remove define commit 0518a78 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 15:47:34 2025 +0900 FLECS_SI_INIT macro: cast column index to i16 commit 9a040b5 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 15:24:35 2025 +0900 forward declare ecs_safety_info_t commit e70778f Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 12:54:12 2025 +0900 update distr files commit 70240c9 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 12:45:17 2025 +0900 fix doc mention commit b60b666 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sun Aug 17 10:05:40 2025 +0900 remove entity argument from get_mut_id_from_record commit a05c550 Author: Indradb <60851042+Indra-db@users.noreply.github.com> Date: Sat Aug 16 22:57:48 2025 +0900 introduce safety info + ecs_get_id_from_record & refactor ecs_get_id methods to use it
…ty_info_t to ecs_lock_target_t, merge typedef def
…OS_API_IMPL define
8f5ff7d to
cc8a6da
Compare
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.

This PR introduces:
FLECS_MUT_ALIAS_LOCKSdefine, so there is no performance impact when it’s not enabled.End users of this internal API must use it themselves and panic when the mut-alias guarantee is violated.
ecs_lock_target_tholds information about where the lock should be applied. For sparse components/IDs (sparse and/or non-fragmenting) it will use thecomponent_recordfor locking. For table-column components it will lock the individual column.ecs_get_idandecs_get_mut_idhave been split, it now callsecs_record_get_id/ecs_record_get_mut_idwhich starts from an entity record. The main purpose is that theecs_record_get_idreturns anecs_get_ptrstruct instead of just a void*, which contains the lock target information. The second purpose of this change is that stop the Rust bindings for flecs from maintaining their owngetfunctions (a maintenance hell). Flecs-rust retrieves the record once, then uses itsgetcallback to retrieve component pointers. I believe the same approach could be used for the C++getcallback.Changes to
ecs_get_idandecs_get_mut_idneed to be benchmarked by Sander.