-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
What problem does this solve or what need does it fill?
bevy_hierarchy's internals are complex, performance-critical, and have panicking unsafe code in them.
The core reason for this is that we cannot let the graph become invalid: this leads to wasted work, subtle bugs and huge amounts of user frustration. And because we use unsafe code internally that relies on the assumption of validity for soundness, this can become a soundness problem.
They're painful to maintain, and nearly impossible to replicate externally for other hierarchy-like code that wants to uphold these same variants.
What solution would you like?
#10756 adds component lifecycle hooks: operations that take effect when components are added or removed.
We should replace the existing complex code in bevy_hierarchy with this idiom, being sure to benchmark and optimize performance.
What alternative(s) have you considered?
We could wait until the fabled day that relations (#3742) finally gets shipped.
Additional context
This has been widely anticipated as one of the key benefits of that PR: I'm recording it here to make sure we don't forget (and can coordinate work).
While the user-facing API is also pretty gnarly and inconsistent, I'd like to leave that for future work to make sure that the correctness-sensitive internals get the review attention it needs.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status