static null move pruning is stockfish

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

static null move pruning is stockfish

Post by silentshark »

Just having a peek at the SF code. It's really nicely written, I must say.

Static null move pruning looks very much like something that's been in use for years (in gnuchess over 10 years ago etc.), but the SF implementation is far more sophisticated. One like confuses me, though. In the test for whether or not to do the pruning, we have:

Code: Select all

&&  refinedValue >= beta + futility_margin(depth, 0))
now.. I think that at depth 1, futility_margin(1,0) is 0, so the test becomes

Code: Select all

&&  refinedValue >= beta
which is really aggressive pruning.. I'd assumed that futility_margin would always be somewhat higher. Have I missed something?
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: static null move pruning is stockfish

Post by mcostalba »

silentshark wrote: which is really aggressive pruning.. I'd assumed that futility_margin would always be somewhat higher. Have I missed something?
You missed that from depth 1 you go directly in qsearch where, if the above condition holds, you return immediately through stand pat so this is just a little shortcut.
User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

Re: static null move pruning is stockfish

Post by silentshark »

mcostalba wrote:
silentshark wrote: which is really aggressive pruning.. I'd assumed that futility_margin would always be somewhat higher. Have I missed something?
You missed that from depth 1 you go directly in qsearch where, if the above condition holds, you return immediately through stand pat so this is just a little shortcut.
What a quick reply! Thanks.

I thought it would be at depth or <1 not <=1 you go into qsearch? i.e

Code: Select all

    if &#40;depth < OnePly&#41;
        return qsearch&#40;pos, ss, alpha, beta, Depth&#40;0&#41;, ply, threadID&#41;;
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: static null move pruning is stockfish

Post by zamar »

silentshark wrote: I thought it would be at depth or <1 not <=1 you go into qsearch? i.e

Code: Select all

    if &#40;depth < OnePly&#41;
        return qsearch&#40;pos, ss, alpha, beta, Depth&#40;0&#41;, ply, threadID&#41;;
In stockfish OnePly = 2.

So we go to qsearch if (depth < 2). So depth == 1 never happens.. Little unorthodox perhaps?
Joona Kiiski
User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

Re: static null move pruning is stockfish

Post by silentshark »

zamar wrote:
silentshark wrote: I thought it would be at depth or <1 not <=1 you go into qsearch? i.e

Code: Select all

    if &#40;depth < OnePly&#41;
        return qsearch&#40;pos, ss, alpha, beta, Depth&#40;0&#41;, ply, threadID&#41;;
In stockfish OnePly = 2.

So we go to qsearch if (depth < 2). So depth == 1 never happens.. Little unorthodox perhaps?
aha! that explains things.. many thanks :D