Comparing results

Discussion of chess software programming and technical issues.

Moderator: Ras

verminox

Re: Comparing results

Post by verminox »

Shouldn't there also be some sort of fitness test for the random strings in the Zobrist hash function?

I mean, if by chance, in a particular instance of the engine, the following condition holds:

Code: Select all

Zobrist[wKe1] XOR Zobrist[bQe2] = Zobrist[wKe2]
Then the engine will not at all consider capturing the black queen at e2 with the king on e1 because the two transpositions seem the same (will have the same hash value), and hence are evaluated with the score of the queen checking the king.

Of course, the keywords here are by chance, but still, wouldn't we all be safer if we generated all the random bit strings using some sort of hamming distance test or something? Somebody who grasps information theory well might be able to help us.
User avatar
hgm
Posts: 28387
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Comparing results

Post by hgm »

This has been discussed here several times in the past. I have tested randomly generated artificially shortened Zobrist keys for containing subsets of 6 or 7 dependent ones. (Like your example does have 3 dependent ones.) My conclusion was that simple random generation in all cases I tested had about the number of dependencies that you would expect. (When you use enough keys, there must always be some dependencies of this kind.)

Hamming distance was not relevant for key quality; in fact the algorithm that generates a set of keys with maximal Hamming distance generates each key as the XOR of two others!

I tried tricks to increase the size of the minimal dependent set of keys that could occur together in a position, but this did not seem to reduce the number of collisions in an actual tree.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Comparing results

Post by bob »

verminox wrote:Shouldn't there also be some sort of fitness test for the random strings in the Zobrist hash function?

I mean, if by chance, in a particular instance of the engine, the following condition holds:

Code: Select all

Zobrist[wKe1] XOR Zobrist[bQe2] = Zobrist[wKe2]
Then the engine will not at all consider capturing the black queen at e2 with the king on e1 because the two transpositions seem the same (will have the same hash value), and hence are evaluated with the score of the queen checking the king.

Of course, the keywords here are by chance, but still, wouldn't we all be safer if we generated all the random bit strings using some sort of hamming distance test or something? Somebody who grasps information theory well might be able to help us.
You certainly don't want duplicates. Even values that are different in only one bit could be somewhat problematic.