Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Pawn Hash Collisions in Crafty

Author: David Rasmussen

Date: 12:10:59 12/05/01

Go up one level in this thread


On December 05, 2001 at 14:05:12, Robert Hyatt wrote:

>On December 05, 2001 at 03:24:29, David Rasmussen wrote:
>
>>You don't seem to want to comment on the pawn hash collisions in Crafty, that I
>>have mentioned. Is that because they don't matter or because you don't believe
>>my experiment and think I have a bug?
>>
>>/David
>
>
>I commented once.  I have tested this in the past and didn't find any problem
>worth considering.  That isn't to say there isn't a collision problem, but I
>didn't encounter one when I tested (I did the same test that I did for the
>32 vs 64 bit hash signature, by storing the 32 bit pawn hash signature along
>with a full 32-byte board representation, and when the pawn hash matched and
>the full board did not, I reported errors.)  I didn't find enough errors to
>be concerned.  Certainly not your 300+ in a single search.  I don't recall
>getting more than a couple in a complete game when I tested.
>
>I could run it again if you are interested as I didn't save all the results,
>since it was done a _long_ while back.  I used to do 64 bit pawn hash signatures
>too until someone (Bruce I think) mentioned he used 32 bits there and I thought
>I would give it a try...

Please run it again :)
If it was a long time ago, maybe faster computers or something makes the
difference? I don't know. All I know is that it is not difficult at all to make
my experiment, and on the other hand it is hard to make errors implementing it.
So if that is what your suggesting is the case here, I really don't think so.

All I do, is in EvaluatePawns(), instead of returning on a table hit, I remember
the entry from the table, that would have been returned (I know the score is
returned, but...), and do the pawn calculations anyway. At the end of the
function, I check if the calculated values of allw, allb, passed_w, passed_b are
the same as the ones we would have returned from the table. If not, we have a
collision. To be ekstra sure, I have tried to print out selected positions that
collide. To give you an example:

       +---+---+---+---+---+---+---+---+
    8  | *R| *N| *B| *Q| *K| *B| *N| *R|
       +---+---+---+---+---+---+---+---+
    7  | *P| *P| *P| *P|   | *P| *P| *P|
       +---+---+---+---+---+---+---+---+
    6  |   |   |   |   |   |   |   |   |
       +---+---+---+---+---+---+---+---+
    5  |   |   |   | *P| P |   |   |   |
       +---+---+---+---+---+---+---+---+
    4  |   |   |   |   |   |   |   |   |
       +---+---+---+---+---+---+---+---+
    3  |   |   |   |   |   |   |   |   |
       +---+---+---+---+---+---+---+---+
    2  | P | P | P |   |   | P | P | P |
       +---+---+---+---+---+---+---+---+
    1  | R | N | B | Q | K | B | N | R |
       +---+---+---+---+---+---+---+---+
         a   b   c   d   e   f   g   h

PawnHashKey == 1666863077

       +---+---+---+---+---+---+---+---+
    8  | *R|   |   | *Q| *K| *B|   | *R|
       +---+---+---+---+---+---+---+---+
    7  | *P| *P| *P|   |   | *P| *P| *P|
       +---+---+---+---+---+---+---+---+
    6  |   |   | *N|   |   | *P|   |   |
       +---+---+---+---+---+---+---+---+
    5  |   |   |   |   |   |   |   |   |
       +---+---+---+---+---+---+---+---+
    4  |   |   |   |   | P |   |   |   |
       +---+---+---+---+---+---+---+---+
    3  |   |   |   |   |   |   |   | P |
       +---+---+---+---+---+---+---+---+
    2  | P | P | P | P |   | P |   | P |
       +---+---+---+---+---+---+---+---+
    1  | R |   | B | Q | K | B |   | R |
       +---+---+---+---+---+---+---+---+
         a   b   c   d   e   f   g   h

PawnHashKey == 1666863077

You can try these positions yourself if you want to. These two came with the
first 1.5 second.

These pawnstructures aren't exactly the same. And I have done this for the first
many collisions. _All_ of them _are_ real collisions. So I really can't see what
you think is wrong with this experiment. It is pretty simple: For the second of
the two positions above, the entry from the first position is returned, and that
must misevaluation problems. Not only with the pawns themselves, but also with
2nd order evaluation that depends on pawns (rooks on open files etc.)

/David



This page took 0 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.