Shame

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Shame

Post by Henk »

I just found out that my engine can not finish a KQK end game. PSQ table says that King should stay in center. Don't know if that's the only reason. My engine also does not know that KK is a draw.
lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: Shame

Post by lauriet »

Hey, you better fix it :D
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Shame

Post by Henk »

lauriet wrote:Hey, you better fix it :D
Don't know if there is an easy way. Less code the better. Also it should not slow down search in normal positions.
User avatar
Bo Persson
Posts: 243
Joined: Sat Mar 11, 2006 8:31 am
Location: Malmö, Sweden
Full name: Bo Persson

Re: Shame

Post by Bo Persson »

Henk wrote:I just found out that my engine can not finish a KQK end game. PSQ table says that King should stay in center. Don't know if that's the only reason.
At least it's one reason. Your Queen needs the support of her king to be able to mate the other king along the edge of the board. They should both close in on him to restrict his movements.
Henk wrote:My engine also does not know that KK is a draw.
So there is some room for improvement. :-)

When fixing this, you might consider that without a Q or R, you probably have a draw long before reaching KK.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Shame

Post by Henk »

Strange alpha beta search with TTable is able to solve this easily while PVS can't. Difference is only three lines of code. After a few moves the algorithm should see a mate in eight or so.

[d] 4k3/8/8/8/8/8/8/6KQ w - - 0 1
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Shame

Post by Henk »

Even simple alpha beta search can go wrong. I forgot to try best move from previous iteration first but returning best move found so far that is stored in TTable. So once in a while if time is up you get really bad moves. For search did not end and it did not try move from previous iteration first.

Also mate scores may not be stored and retrieved right from TTable.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Shame

Post by Sven »

Henk wrote:Strange alpha beta search with TTable is able to solve this easily while PVS can't. Difference is only three lines of code. After a few moves the algorithm should see a mate in eight or so.
Let us guess more of these three lines, then we can try to guess the bug ...
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Shame

Post by Henk »

So perhaps after all possible perft tests has been done. Next step is to solve mate in N problems with alpha beta search and no TTable.

Success is a choice.
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: Shame

Post by Aleks Peshkov »

Perft with TT helped me to detect bugs that would be very difficult to discover otherwise.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Shame

Post by Henk »

Sven Schüle wrote:
Henk wrote:Strange alpha beta search with TTable is able to solve this easily while PVS can't. Difference is only three lines of code. After a few moves the algorithm should see a mate in eight or so.
Let us guess more of these three lines, then we can try to guess the bug ...
My guess is it that it had something to do with TTable. As always. No TTable no bugs.