bevy_mod_debugdump icon indicating copy to clipboard operation
bevy_mod_debugdump copied to clipboard

Schedule ordering unreadable

Open BrettWitty opened this issue 3 years ago • 3 comments

The arrows (which I assume are the system ordering) in print_schedule all merge together in the left-hand side and the information is not helpful. I'm aware some of this is the idiosyncrasies of dot, but it'd be nice to find a way to make it readable. Each arrow gets a new distinct colour?

BrettWitty avatar Mar 29 '22 23:03 BrettWitty

The labels are currently generated with contraint=false, which leads to the problem. Without it, the labels are more readable, but the diagram as a whole isn't schedule_graph

Different colors definitely help, but the order of systems is still very unreadable: grafik

Setting the rankdir=TD is fine for stages with a lot of defined orderings: grafik but makes stages without order completely flat and wide grafik


The first image where contraint=false is removed looks the best to me, maybe you can force dot to layout the subgraphs all next to each other? Alternatively you could have a graph for each stage of the schedule, where you'd lose the global overview but gain more space for intra-stage ordering.

jakobhellermann avatar Mar 31 '22 16:03 jakobhellermann

Yeah, graphviz doesn't make it easy!

I agree with your take. Does the first image suggest correctly that vertically adjacent systems will probably run concurrently? Or is bevy's scheduling opaque?

BrettWitty avatar Mar 31 '22 21:03 BrettWitty

There are two aspects of systems that define whether two of them can run in parallel. The first one is explicit after/before conditions, that is what's currently being visualized and in that regard, vertically adjacent systems can run concurrently.

The other aspect is compatibility of Component/Resource access. If you have two systems that each take a Res<Resource> they can run in parallel, but if one of them was a ResMut they would have to run at different points in time, and their order is unspecified. (The same applies to components in queries, Query<&mut ComponentA> can't run with Query<&ComponentA>). This aspect of scheduling is not visualized currently (except maybe for tooltips on the systems that display their access).

Relevant issue: #7

jakobhellermann avatar Mar 31 '22 22:03 jakobhellermann

The graph has been redesigned a lot, and now looks a lot more readable:

new graph

I'm gonna close this issue, but if you have any more feedback feel free to open a new one!

jakobhellermann avatar Mar 06 '23 19:03 jakobhellermann

Looks great! Awesome work!

BrettWitty avatar Mar 06 '23 21:03 BrettWitty