Skip to content

Add more granular system sets for state transition schedule ordering#13763

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
MiniaczQ:state-schedule-ordering
Jun 10, 2024
Merged

Add more granular system sets for state transition schedule ordering#13763
alice-i-cecile merged 8 commits intobevyengine:mainfrom
MiniaczQ:state-schedule-ordering

Conversation

@MiniaczQ
Copy link
Contributor

@MiniaczQ MiniaczQ commented Jun 9, 2024

Objective

Fixes #13711

Solution

Introduce smaller, generic system sets for each schedule variant, which are ordered against other generic variants:

  • ExitSchedules<S> - For OnExit schedules, runs from leaf states to root states.
  • TransitionSchedules<S> - For OnTransition schedules, runs in arbitrary order.
  • EnterSchedules<S> - For OnEnter schedules, runs from root states to leaf states.

Also unified ApplyStateTransition<S> schedule which works in basically the same way, just for internals.

Testing

  • One test that tests schedule execution order

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 9, 2024
@MiniaczQ MiniaczQ force-pushed the state-schedule-ordering branch from 89e7472 to b5cfb7c Compare June 9, 2024 01:05
@NthTensor NthTensor added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events X-Contentious There are nontrivial implications that should be thought through S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 9, 2024
@alice-i-cecile
Copy link
Member

We should collaborate on either this or #13724: they seem very similar :)

Copy link
Contributor

@lee-orr lee-orr left a comment

Choose a reason for hiding this comment

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

Overall the PR is good - the main issue was in the test, so I'd recommend applying some changes there (I provided suggestions) - but once they're in I'll be happy with this.

MiniaczQ and others added 3 commits June 9, 2024 21:39
Co-authored-by: Lee-Orr <lee-orr@users.noreply.github.com>
Copy link
Contributor

@benfrankel benfrankel left a comment

Choose a reason for hiding this comment

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

Some documentation nits & a question.

@benfrankel
Copy link
Contributor

Replaced StateTransitionSteps in favor of ExitSchedules, TransitionSchedules, EnterSchedules.

This in the changelog seems not entirely accurate. StateTransitionSteps is still around, and the new system sets provide internal ordering.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 9, 2024
@MiniaczQ MiniaczQ force-pushed the state-schedule-ordering branch from 8187a21 to dd100cc Compare June 9, 2024 21:55
@alice-i-cecile alice-i-cecile 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-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Jun 9, 2024
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.

Good tests, reasonable implementation. If you can get CI green I'll merge this tomorrow during the merge train.

@MiniaczQ MiniaczQ force-pushed the state-schedule-ordering branch from dd100cc to ad188aa Compare June 9, 2024 22:15
Copy link
Contributor

@benfrankel benfrankel left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the added test, but the implementation looks good.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 10, 2024
Merged via the queue into bevyengine:main with commit 6d0b750 Jun 10, 2024
mockersf pushed a commit that referenced this pull request Jun 10, 2024
…13763)

# Objective

Fixes #13711 

## Solution

Introduce smaller, generic system sets for each schedule variant, which
are ordered against other generic variants:
- `ExitSchedules<S>` - For `OnExit` schedules, runs from leaf states to
root states.
- `TransitionSchedules<S>` - For `OnTransition` schedules, runs in
arbitrary order.
- `EnterSchedules<S>` - For `OnEnter` schedules, runs from root states
to leaf states.

Also unified `ApplyStateTransition<S>` schedule which works in basically
the same way, just for internals.

## Testing

- One test that tests schedule execution order

---------

Co-authored-by: Lee-Orr <lee-orr@users.noreply.github.com>
@MiniaczQ MiniaczQ deleted the state-schedule-ordering branch September 7, 2024 19:14
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-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Contentious There are nontrivial implications that should be thought through

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordered OnExit and OnEnter

5 participants