Skip to content

Change flattened dependency graph from DiGraph<NodeId> to DiGraph<SystemKey> #20172

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

Merged
merged 4 commits into from
Jul 19, 2025

Conversation

ItsDoot
Copy link
Contributor

@ItsDoot ItsDoot commented Jul 17, 2025

Objective

Semantically, the fully flattened dependency graph never contains SystemSetKeys, so lets encode that into its type.

Solution

  • Added GraphNodeId trait.
  • Generalized DiGraph and UnGraph with a new GraphNodeId N type parameter.
  • Generalized most functions involving DiGraph/UnGraph to take a GraphNodeId type parameter.
  • Added Graph::try_into function to help us convert from DiGraph<NodeId> to DiGraph<SystemKey>. Does it look a bit gnarly? Yea.

Testing

Re-using current tests.

@ItsDoot ItsDoot added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 17, 2025
@ItsDoot ItsDoot requested review from chescock and hymm and removed request for chescock July 17, 2025 06:59
@ItsDoot
Copy link
Contributor Author

ItsDoot commented Jul 18, 2025

Thoughts on GraphNodeId now? I removed the two extra related traits as suggested by @chescock and also renamed the associated types to match their semantics.

EDIT: Since it's only a 16 line file now, I could also co-locate it in the same file as Graph.

@alice-i-cecile @chescock

@alice-i-cecile alice-i-cecile requested a review from chescock July 18, 2025 04:10
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate the explictness about systems vs system sets. I think this is a net improvement as a result.

@ItsDoot ItsDoot 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 Jul 19, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 19, 2025
Merged via the queue into bevyengine:main with commit face4f1 Jul 19, 2025
34 checks passed
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 D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes 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.

4 participants