Schedule graph broken
odecay opened this issue · comments
Schedule graph seems to have broken recently.
Not quite sure what caused it, seems like its not finding a requirement https://github.com/jakobhellermann/bevy_mod_debugdump/blob/c055c00cc7417859aa38c630d9b39077bb339437/src/schedule_graph.rs#L430 for printing here. Other clue is the StateTransitionStageLabel which comes from Loopless.
I don't really understand what missing downcast means in this context or what could be causing it. Is there a missing downcast impl on something in loopless?
Missing downcast: StateTransitionStageLabel(TypeId { t: 12401367547488415915 }, "littlefighter2::GameState")
thread 'main' panicked at 'assertion failed: found', /home/xxxx/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_mod_debugdump-0.4.0/src/schedule_graph.rs:430:9
stack backtrace:
0: rust_begin_unwind
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/core/src/panicking.rs:142:14
2: core::panicking::panic
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/core/src/panicking.rs:48:5
3: bevy_mod_debugdump::schedule_graph::add_dependency_labels
4: bevy_mod_debugdump::schedule_graph::system_stage_subgraph
5: bevy_mod_debugdump::schedule_graph::build_schedule_graph
6: bevy_mod_debugdump::schedule_graph::schedule_graph_dot_styled_inner
7: bevy_mod_debugdump::print_schedule
8: littlefighter2::main
at ./src/main.rs:317:5
9: core::ops::function::FnOnce::call_once
at /rustc/f2d93935ffba3ab9d7ccb5300771a2d29b4c8bf3/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Just for reference, I've bisected the repo, and the commit that caused the problem is 2f7d848. I don't have (yet) any idea why it did.
Problem likely related to:
.add_system(
move_to_target
.run_in_state(GameState::InGame)
.after(set_target_near_player),
)
.add_system(
enemy_attack
.run_in_state(GameState::InGame)
.after(move_to_target),
)
I have noticed some warnings from Bevy about non-existent labels. Looks the same as what @64kramsystem pointed out:
2022-07-05T21:29:18.534560Z WARN bevy_ecs::schedule::graph_utils: littlefighter2::movement::move_to_target wants to be after unknown label: SystemTypeIdLabel("littlefighter2::set_target_near_player")
2022-07-05T21:29:18.534579Z WARN bevy_ecs::schedule::graph_utils: littlefighter2::enemy_attack wants to be after unknown label: SystemTypeIdLabel("littlefighter2::movement::move_to_target")
Yea I missed it but should be fixed now. Looks like loopless has issues with bevy autolabeling systems? It may be only when you add them with another loopless condition like .run_in_state()