bugs in hash tables

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Michael Sherwin
Posts: 2799
Joined: Fri May 26, 2006 1:00 am
Location: OH, USA

Re: bugs in hash tables

Post by Michael Sherwin » Sun Aug 12, 2007 5:10 pm

PK-4 wrote:I was intrigued by the beauty of the problem and the failure of strong engines to find the right move b8a6 with deep search. So I added some code to the endgame knowledge base of my engine as described by the following pseudocode:

Code: Select all

//nobles are N,B,R,Q
if(lone rivalside king)
{
    if(all ownside pawns on one rookfile)
    {
         if(ownside has no nobles or only bishop of wrong color)	
        {
            if(rivalside king stands on or adjacent to queening square)
                return DRAW;
        }
    }
}
//Q. Why do the indents disappear?
Not surprisingly, my engine now finds b8a6 at search depth of 3.
Regards,
Mike

User avatar
hgm
Posts: 22180
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Contact:

Re: bugs in hash tables

Post by hgm » Sun Aug 12, 2007 6:35 pm

Uri Blass wrote:It is correct that I only need the last 50 non reversable moves for repetition but I want also to support analyze when the human can take back moves and having one big table for all the game is the simplest solution.
OK, I see. To implement takeback I remember all moves since the game started (which you have to do anyway, as a hashkey alone doesn't allow you to reconstruct the position). An undo is than performed as starting a new game, and force the first N-2 or N-1 moves.

Uri Blass
Posts: 8009
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: bugs in hash tables

Post by Uri Blass » Sun Aug 12, 2007 7:37 pm

hgm wrote:
Uri Blass wrote:It is correct that I only need the last 50 non reversable moves for repetition but I want also to support analyze when the human can take back moves and having one big table for all the game is the simplest solution.
OK, I see. To implement takeback I remember all moves since the game started (which you have to do anyway, as a hashkey alone doesn't allow you to reconstruct the position). An undo is than performed as starting a new game, and force the first N-2 or N-1 moves.
correct but when I have one table for zobrist keys the takeback is more simple because I do not need to calculate the zobrist key when I undo move and it is enough to calculate it when I make moves.

Uri

Post Reply