static null move pruning is stockfish

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
silentshark
Posts: 236
Joined: Sat Mar 27, 2010 6:15 pm
Contact:

static null move pruning is stockfish

Post by silentshark » Sun Jun 13, 2010 12:14 pm

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 7:17 pm

Re: static null move pruning is stockfish

Post by mcostalba » Sun Jun 13, 2010 12:21 pm

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: 236
Joined: Sat Mar 27, 2010 6:15 pm
Contact:

Re: static null move pruning is stockfish

Post by silentshark » Sun Jun 13, 2010 12:33 pm

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 6:03 am

Re: static null move pruning is stockfish

Post by zamar » Sun Jun 13, 2010 2:07 pm

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: 236
Joined: Sat Mar 27, 2010 6:15 pm
Contact:

Re: static null move pruning is stockfish

Post by silentshark » Sun Jun 13, 2010 2:30 pm

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

Post Reply