Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Chess program improvement project (copy at Winboard::Programming)

Author: Kolss

Date: 03:24:15 03/07/06

Go up one level in this thread


On March 07, 2006 at 02:44:23, Uri Blass wrote:

>On March 06, 2006 at 21:14:43, Stuart Cracraft wrote:
>
> >teedee - Temporal Differences Chess
>>v1 2006
>>copyright (c) 2004,2005,2006
>>Stuart Cracraft (cracraft@cox.net)
>>
>>*** Problem   Solution(s): Qg6 (bm)
>>[D] 2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 w - - bm Qg6
>> 1/ 9 e5c6 -2690  0.01      565 e5c6 d6c6
>> 2/10 f6h5 -2828  0.04     2488 f6h5 c6e5 d4e5
>> 3/10 f6h5 -2586  0.07     5370 f6h5 d6f8
>> 4/10>f6h5 -2185  0.08     5945 f6h5 d6f8 e5c6 b7c6 h5f4
>> 4/13 f6h5 -2003  0.15    13003 f6h5 g7g6 h5f6 c6e5 d4e5
>> 5/14>f6h5 -1602  0.18    14952 f6h5 g7g6 h5f6 c6e5 d4e5 d6e5
>> 5/17 f6e8 1127  0.41    37600 f6e8 d6e5 d4e5 d8e8
>> 6/21>f6e8 1527  0.91    90041 f6e8 d6e5 d4e5 d8e8 f1f7 e6f7
>> 6/21 Mg3g6  99988  0.96    94722 g3g6 d6f8 e5f7 e6f7 g6h7
>
>I wonder why your program need depth 6 to see the solution that is mate in 2.
>
>I think that you should try to look at the tree to see the lines that it
>searched after g3g6
>
>Movei needs only 2 plies for this problem.
>
>After Qg6 and black move qsearch finds the mate.
>
>I know that you have not checks in the qsearch but even without checks in the
>qsearch I see no logical reason to have depth 6.
>
>I wonder if null move prevents you to see it earlier or there is another reason.
>How many plies do you need to solve this position if you disable null move
>pruning?
>
>I believe that you use null move with R=2 so I think that even if null move
>prevents you to see the mate at depth 3 you should see it at least at depth 4
>thanks to check extension.
>
>Qg6 Null Qh7+ is exactly 4 plies if you use R=2
>
>Qg6 Null Qh7+ should be extended thanks to check extension so even with no
>function that tell you if a position is a mate you should see a mate score.
>
>Maybe one of your problems is that you do not extend checks when the remaining
>depth is 0 but do it only when the remaining depth is more than 0.
>
>If this is the case then
>I suggest that when the remaining depth is 0 before going to qsearch you check
>if the king of the side to move is under threat and add one ply to the depth so
>you do not go to qsearch in this situation.
>
>Uri


Hello,

This answer somewhat goes along with Uri's comment, so I placed it as an answer
to his post...

There are several scenarios what a search could do in this MATE in 2 position. I
list a few:


SCENARIO 1: null move R=2, no checks in quiescence search (QS), no futility
pruning:

Ply 4:
Remaining depth (D) = 4
1. Qg6 => D = 3
1. ... null => D = 0
white goes to QS: eval possible (probably) worse than for other moves (such as
1. Ne8); try captures such Nxc6 which do not give a better score than alpha; 2.
Qh7# is NOT TRIED, as it is a quiet move.
MOVE IS NOT FOUND.

Ply 5:
D = 5
1. Qg6 => D = 4
1. ... null => D = 1
2. Qh7# (assuming here that the checkmate is recognized in QS! - make sure that
black cannot stand pat here, but is forced to try all evasion moves until one
causes a cut-off; if there are no moves, return checkmate!) => null move refuted
with mate threat
1. ... fxg6 => D = 4 (3 + 1 for mate threat)
2. Qh7#
[...]
MOVE IS FOUND.


SCENARIO 2: null move R=3, no checks in QS, no futility pruning:

analogous to the above, move should only be found at depth 6!


SCENARIO 3: null move R=2, no checks in QS, futility pruning with remaining
depth = 1:

Ply 5:
D = 5
1. Qg6 => D = 4
1. ... null => D = 1
futility pruning applied at D = 1 => 2. Qh7# is NOT TRIED, as it is pruned away
as a stupid (or quiet) move which gains no material (MG = 0) or does not improve
the position.
MOVE IS NOT FOUND.

Ply 6:
D = 6
1. Qg6 => D = 5
1. ... null => D = 2
no futility pruning at D = 2
2. Qh7#
MOVE IS FOUND.


SCENARIO 4: null move R=2, checks in QS, no futility pruning:

Ply 1:
D = 1
1. Qg6 => D = 0
black goes to QS: eval > beta (after e.g. 1. Ne8) => stand pat, move refuted
MOVE IS NOT FOUND.

Ply 2:
D = 2
1. Qg6 => D = 1
1. ... null => D = 0
white goes to QS: eval < alpha; try moves; probably a capture move already
refutes the null move, but at the latest Qh7# (a checking quiet move!) does;
null move refuted.
1. ... fxg6 => D = 0
white goes to QS: eval << alpha; captures all fail to bring score > alpha
2. Qh7# (checks in QS)
MOVE IS FOUND.


You can add arbitrarily move scenarios. Be sure you know what you do in your
program, and then think about whether that is what you want to do. E.g., you may
have to define more exceptions to futility pruning (be more careful with pruning
moves) if you do not use checks in QS. If you have no checks in QS, do heavy
pruning at D = 1, and use R = 3, then you may even need 7 plies to find this
mate in 2...

Also, make sure (certainly, you already to this) that you never ever allow a
side to stand pat and return static eval if it is in check; it must be forced to
try all legal moves (until a cut-off occurs), if there are none, return
checkmate.

I hope this helps a bit - it is really important to understand what the program
/ search does if you want to understand why it fails to solve seemingly easy
positions.

Best regards - Munjong.



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.