Unfortunately, someone basically relied on it being deterministic in 4.0, and now that we have upgraded we are finding discrepancies. What we'd like to do is compile against 4.0 and resort the same sets to get back what we were getting, we just want to make sure that when we do that, we can rely on the sorts being the same as they previously were. In other words, is the quicksort implementation Array.Sort in 4.0 deterministic?
So you want to find out for a particular version whether Array.Sort
is deterministic. That is a much easier problem.
Decompile the .NET BCL code (or look at the reference source). If the implementation is using only deterministic operations (i.e. not using Random
) the result is also deterministic.
Last time I looked the sorting code fit onto just a few pages. You'll quickly sift through it. My guess: It will obviously be deterministic (if your comparer is as well!).