<div dir="ltr"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 31, 2014 at 11:56 AM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><br>
> On 2014-Jul-31, at 10:33, Sean Silva <<a href="mailto:chisophugis@gmail.com">chisophugis@gmail.com</a>> wrote:<br>
><br>
> ; RUN: verify-uselistorder < %s.bc -preserve-bc-use-list-order -num-shuffles=5<br>
><br>
> quick question: is the shuffling nondeterministic? I think we really need to avoid a test that is nondeterministic.<br>
><br>
<br>
<br>
</div>Designed it to be deterministic (if it's not there's a bug).</blockquote><div><br></div><div>Ok, I guess that's not a problem. I guess it's sort of weird to see an option like -num-shuffles being used like this. Why not just test 1 shuffle? or 10? Testing 5 "random" shuffles just so that it tests the same 5 shuffles every time doesn't seem very productive. If it's going to test 5 deterministic shuffles then it should at least check 5 specific shuffles like reverse, pipe organ, interleave, etc.</div>
<div><br></div><div>At the very least, the number "5" should not be on every RUN line if it is just some arbitrary default number of shuffles to try and has no reason to vary from test to test.</div><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">  Here's<br>
what's supposed to happen.<br>
<br>
  - Seeds the random number generator.  The RNG is seeded at the<br>
    beginning of each shuffle (shuffle 0 uses default+0, shuffle 1 uses<br>
    default+1, etc.).<br>
  - Visits every Value in a deterministic order.<br>
  - Assigns a random number to each use in the Value's use-list in a<br>
    deterministic order.<br>
  - Sorts the use-list using `Value::sortUseList()`, which is a stable<br>
    sort.<br>
<br></blockquote><div><br></div><div>This would be great to add to the top-of-file comment in the .cpp file.</div><div><br></div><div>-- Sean Silva </div></div><br></div></div>