Author: Robert Hyatt
Date: 12:17:46 04/08/02
Go up one level in this thread
On April 08, 2002 at 12:38:35, John Marountas wrote:
>Hello again !
>
>First of all, I want to thank those who replied at my question
>on Debugging the HashTables implementation.
>
>Obviously I had forgoten to mask the info about the side to move and
>the castle and ep rights into the HashKey. I fixed that by using the code below.
>I think the code is correct.
>
>//************************************************
>int ZobristKey(int side) throws IOException{
> int hashKey = 0;
>
> for(int p=0;p<64;p++){
> hashKey ^=zobrist[side][ brd.piece[p] ][p];
> }
>
> hashKey ^= side; //Side to move
> hashKey ^= ep_to; //Ep rights
> hashKey ^= castle; //Castle rights
What is "side" for example? 0/1? changing one bit is not really a safe
option. Ditto for castle...
>
> return hashKey;
>}
>//************************************************
>
>Then I run Pyotr and setup the following position:
>
>[D] r1bqkbnr/pppp1ppp/2n5/4p3/3PP3/5N2/PPP2PPP/RNBQKB1R b KQkq d3 0 3
>
>
>
>When searching into the HashTable I keep a record of the returned
>Lows,Highs and Hash Collisions. Here are the results:
>
>Hash Collisions: 1000
>Hash High : 173
>Hash Low : 0
>
>Best Move : 3...Nxd4
>
>Why there are so many collisions?
How do you define "collision"? Normally this means two different board
positions produce the same hash signature. If you are getting _those_ you
have a Zobrist hashing bug. If you mean two different signatures hash to the
same board position then perhaps your 64 bit random numbers are very poorly]
chosen...
>
>Then I continue the position by playing 4.Nxd4 and got the following results.
>Hash Collisions: 2280
>Hash High : 31
>Hash Low : 1
>
>Best Move : 4...e5xd4
>
>Again notice the hight of the Hash Collisions and the low of the other two
>numbers.
>Does any of these numbers has to do with my wrong implementation ?
>
>Thank in advance !
>Marountas John
>
>Pyotr's Website : http://www.digichess.gr/pyotr/
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.