<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>4. The patch introduces a new SCC formation algorithm (double layer with support for CG mutation on the fly), however design document on how this works is missing.  It needs to document </div><div>    * What exactly is expected (in terms of vistation order) when a) an edge is added; b) an edge is deleted; c) when a new node is introduced and connected. </div><div>    * How ref-edges are formed, how indirect callsites are handled etc.</div><div>    * If it is a modification of the classic SCC formation algorithm, describe the change and prove that the algorithm works as expected.</div><div><br></div></div></div></div></blockquote><div><br></div><div>FWIW: I agree that for algorithms this complex, where we have no other reference for how they are supposed to work, and no way to know what invariants make them correct or not (other than reading code), we should have some design doc.</div><div><br></div><div>In this case, it should not be hard to prove that you can validly form both ref and non-ref SCC's at once:<br><br></div><div>If you were to always follow non-ref edges first, and eagerly collapse non-ref SCC's, you can easily prove it will discover the maximal set of non-ref sccs (because it's depth first, if there was a cycle that could be formed with non-ref edges, it will form it), and each will collapse to a node in the ref SCC graph which will then form ref-scc's on top of it by following ref-edges.</div><div><br></div><div>If you do not follow non-ref edges first, you will get into situations where it could have formed a non-ref SCC but formed a ref SCC instead, and the non-ref SCC can be non-maximal.</div><div><br></div><div><br></div></div></div></div>