Crafty Search Extensions

Discussion of chess software programming and technical issues.

Moderator: Ras

GothicChessInventor

Crafty Search Extensions

Post by GothicChessInventor »

I have an old copy of Crafty with the following code:

Code: Select all

#define LimitExtensions(extended,ply)\
            extended = Min(extended,ply);
            if(ply > 2 * iteration_depth) {
              if(ply < 4 * iteration_depth)
        extended = extended*(4*iteration_depth - ply)/(4*iteration_depth);
        else
        extended = 0;
        }
I have been tweaking this a bit on my own (primarily to hunt for cutoffs and also to curtail extensions when hunting for mates) and I introduced some horrible bug of course!

:)

I am wondering, has there been an "update" to this section of code in the latest version of Crafty? If so, I'd enjoy reading about the new code and what it does.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty Search Extensions

Post by bob »

This is what we currently are using:

# if !defined(LIMITEXT)
#define LimitExtensions(extended,ply) \
extended=Min(extended,PLY); \
if (ply > 2*shared->iteration_depth && !tree->no_limit) { \
if (ply <= 4*shared->iteration_depth) \
extended=extended*(4*shared->iteration_depth-ply)/ \
(2*shared->iteration_depth); \
else \
extended=0; \
}
# else
#define LimitExtensions(extended,ply) \
extended=Min(extended,PLY); \
if (ply > 2*shared->iteration_depth) { \
if (ply <= 4*shared->iteration_depth) \
extended=extended*(4*shared->iteration_depth-ply)/ \
(2*shared->iteration_depth); \
else \
extended=0; \
}
# endif

Note the conditional compilation option that is an either/or sort of compile-time switch. We have some times of moves that now get extended without the "limit" being imposed...
GothicChessInventor

Re: Crafty Search Extensions

Post by GothicChessInventor »

I have to hand it to you. I tried experimenting with all kinds of numerator/denominator combinations for the search extension multipliers, I even simulated it in an Excel worksheet, and you've got the implementation with the best numerics!

I thought for sure ratios of 3.0 and 1.5 would outperform 4 and 2 since it seemed like there were some pointless extensions going on, but statistically, 4/2 is better than 3/1.5

Very nice. :D
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Crafty Search Extensions

Post by bob »

GothicChessInventor wrote:I have to hand it to you. I tried experimenting with all kinds of numerator/denominator combinations for the search extension multipliers, I even simulated it in an Excel worksheet, and you've got the implementation with the best numerics!

I thought for sure ratios of 3.0 and 1.5 would outperform 4 and 2 since it seemed like there were some pointless extensions going on, but statistically, 4/2 is better than 3/1.5

Very nice. :D
we run lots of tests. null move R=2~3 (adaptive null move) is exactly the same deal. I have tried every combination from 1~1, 1~2, 2~2, ..., 5~5. 2~3 is the clear winner. Most everything I have done has been tested like that. I just re-tested the null-move settings as above to be sure that nothing has changed since the last time I tried, such as faster hardware, deeper depth, search reductions. 2~3 is still better by a significant margin.

Ditto for the extension amounts we are using...