jakobhellermann/bevy_mod_debugdump

Schedule ordering unreadable

BrettWitty opened this issue · 5 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?

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.

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?

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

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!

Looks great! Awesome work!