bevyengine / bevyengine/bevy

non-determinism in `ui_layout_system` can hide bugs and makes it harder to write tests

Open
#25,412 0 comments 0 reactions 0 assignees View on GitHub
A-UI C-Refinement
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

In `ui_layout_system` the order the nodes are updated isn't deterministic. This can hide bugs and makes it harder to write tests.

Example here:

https://github.com/bevyengine/bevy/issues/25303

If `ui_root_node_query` visits the new root second it's fine, but if it visits it first, there's a panic.

## What solution would you like?

Visit roots in UI stack order maybe.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the ui_layout_system and ui_root_node_query, then read the failure described in issue #25303. Determine how root visitation order is produced and make it deterministic according to UI stack order; done means the order is stable and the reported panic scenario is covered by a reproducible test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.