Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Search extensions on recaptures

86 views
Skip to first unread message

Chua Kong Sian

unread,
Mar 21, 1994, 11:03:43 PM3/21/94
to

I have been studying the search extension code for gnuchess for recaptures.
Here is the condition whereby recaptures are extended.

if (flag.rcptr && ply>2 && CptrFlag[ply-1] && CptrFlag[ply-2] &&
((ply<Sdepth+2 && CptrFlag[ply-1]==CptrFlag[ply-2]) ||
(score > alpha && score < beta)))
++depth; /* extend by 1 ply */


To put it into words, if ply-1 & ply-2 moves are captures, then if
a) both captures are to the same square OR
b) the estimated score of this position is within (alpha,beta)
then the position is extended by 1 ply.

Let me deal with a) first. The intention to extend the recapture when it
is on the same square is fine, but unfortunately the implemention is
incorrect as currently CptrFlag does NOT store the square when the capture
is taking place, but is simply a binary 1/0 flag. To fix this, look for
the following line further down

CptrFlag[ply] = (node->flags & capture);

and change this to

CptrFlag[ply] = (node->flags & capture ? TOsquare+1 : 0);

This change should improve the performance by at least 10% and probably as
much as 25% in positions with plenty of captures.


For b), the condition to extend depends on the current (alpha,beta) window.
This is bad as it can give rise to alpha-beta inconsistencies. Furthermore,
as we are using PVS to guide the search, there will be many nodes whereby
the alpha-beta window is zero. Perhaps the approach adopted by Hitech could
be adopted here. If the score is within a 1/2 pawn window around
the root score, then the recapture is extended. So instead of using

(score > alpha && score < beta)

we instead use

(score > root->score - valueP/4 && score < root->score + valueP/4);

There might be another better approach, so any criticisms or suggestions
would be appreciated.

To summarize, the first change is a good thing and should be added.
The second change is merely a suggestion.

Kong Sian

0 new messages