Page 1 of 1

static null move pruning is stockfish

Posted: Sun Jun 13, 2010 2:14 pm
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?

Re: static null move pruning is stockfish

Posted: Sun Jun 13, 2010 2:21 pm
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.

Re: static null move pruning is stockfish

Posted: Sun Jun 13, 2010 2:33 pm
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;;

Re: static null move pruning is stockfish

Posted: Sun Jun 13, 2010 4:07 pm
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?

Re: static null move pruning is stockfish

Posted: Sun Jun 13, 2010 4:30 pm
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