Shopify/seafoam

Seafoam won't render phases nested under a group

Opened this issue · 2 comments

Capturing compiled methods from Graal includes a phase named "Before Inline" nested under "Call Tree" for any of the TruffleIR methods. seafoam ... list includes them in its output:

TruffleHotSpotCompilation-7241[Symbol#to_s].bgv:0  TruffleIR::Symbol#to_s()/Call Tree/Before Inline
TruffleHotSpotCompilation-7241[Symbol#to_s].bgv:1  TruffleIR::Symbol#to_s()/After phase org.graalvm.compiler.truffle.compiler.phases.inlining.AgnosticInliningPhase
TruffleHotSpotCompilation-7241[Symbol#to_s].bgv:2  TruffleIR::Symbol#to_s()/After Partial Evaluation
...

However, seafoam render for that phase always generates an empty graph:

digraph G {
  graph [bgcolor="white"];
}

I haven't looked into Seafoam's internals to see what's going on, so my suggestion of the issue affecting phases nested under groups may be incorrect. This is the only phase I've seen nested so far so I can't verify with others.

We should

  • add a test for this - we have graphs that should include these, and possibly all graphs should be non-empty which could be the simplest test to add

  • warn when someone tries to render an empty graph

I just spot-checked Seafoam 0.16 with TruffleRuby 24.1.0-dev JVM CE and didn't see any empty graphs. But, adding a warning when rendering an empty graph would be useful. We could then automate processing of all the example graph phases to see if we run into a problem.