i was kind of wondering about the negative overflow (isn't that underflow) but i was trusting you that it worked ... isn't there still a potential problem with the transitive property if i.doc + seed causes positive integer overflow?
(i guess it's okay because the overflow is the same regardless of whether it's i or j, but in the previous case the overflow happend *after*the hash call.
FWIW: i still think newComparator should be something like...
public ScoreDocComparator newComparator(IndexReader reader, String fieldname) throws IOException
return new RandomComparator(seed ^ reader.getVersion());
...so that people who want orderings that are randomized per each <commit/> can just use...
<field name="random" type="random" />
With the attachment as is, most changes to the index (ie: add a few documents, delete a few documents) won't have a significant impact on the "random" order because they won't change the majority of the docIds... you have to change the "seed" to see any noticable effects.