Question on Null Move Pruning

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
jfern2011
Posts: 12
Joined: Mon Aug 07, 2017 3:24 pm
Location: Los Angeles

Question on Null Move Pruning

Post by jfern2011 » Tue Aug 29, 2017 4:45 am

Why do we search null moves with null windows? Is it because if a node is passed the null window [alpha, alpha+1] and fails low, then our position is so good that no move can refute the null move?

PK
Posts: 818
Joined: Mon Jan 15, 2007 10:23 am
Location: Warsza
Contact:

Re: Question on Null Move Pruning

Post by PK » Tue Aug 29, 2017 5:53 am

Because null window is faster, and is enough to provide information we need. When we make a null move, opponent gets huge odds. It does not matter if, given that odds, he gains a queen, or just a small positional advantage, it does not matter how far above beta he can get, so bigger window is not necessary. Tee only thing that matters is when he cannot beat beta. Null window is enough to recognize this.

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Question on Null Move Pruning

Post by hgm » Tue Aug 29, 2017 6:38 am

The narrower the window, the more cut-nodes you will have, and the easier it will be to find the cut-moves in those, all lowering the required number of nodes. So never ask the search for more information than you need. In null-move pruning you only want to know whether the null move fails high or not. You won't use the score itself either way.

Aleks Peshkov
Posts: 870
Joined: Sun Nov 19, 2006 8:16 pm
Location: Russia

Re: Question on Null Move Pruning

Post by Aleks Peshkov » Tue Aug 29, 2017 12:06 pm

Null move heuristic should not be done on PV-nodes. To my limited understanding all non-PV nodes in PVS are searched with null-window.

Henk
Posts: 5797
Joined: Mon May 27, 2013 8:31 am

Re: Question on Null Move Pruning

Post by Henk » Tue Aug 29, 2017 12:09 pm

Aleks Peshkov wrote:Null move heuristic should not be done on PV-nodes. To my limited understanding all non-PV nodes in PVS are searched with null-window.
I even don't understand why no null move in PV nodes. I can understand first move of PV must no be null move for that is an invalid move.

mjlef
Posts: 1421
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Question on Null Move Pruning

Post by mjlef » Tue Aug 29, 2017 12:28 pm

Aleks Peshkov wrote:Null move heuristic should not be done on PV-nodes. To my limited understanding all non-PV nodes in PVS are searched with null-window.
You can use nullmove on PV nodes, provided beta is less than whatever is infinity for your program. It has not tested well in the past.

mjlef
Posts: 1421
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Question on Null Move Pruning

Post by mjlef » Tue Aug 29, 2017 12:43 pm

jfern2011 wrote:Why do we search null moves with null windows? Is it because if a node is passed the null window [alpha, alpha+1] and fails low, then our position is so good that no move can refute the null move?
You probably mean [beta-1, beta]. Null move saves search nodes by assuming a score is so good that if we let the opponent move twice in a row and it cannot get the score below beta, then the present node is most likely a fail high node. In non-PV nodes that is the same as [alpha, alpha+1], but in PV nodes it is not, of course.

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Question on Null Move Pruning

Post by hgm » Tue Aug 29, 2017 1:29 pm

Indeed, but it is the null-move reply that we call Search() for, and I suppose he is referring to the argumentsof that call.

Michael Sherwin
Posts: 3041
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Question on Null Move Pruning

Post by Michael Sherwin » Tue Aug 29, 2017 5:11 pm

Alpha & Beta swapping and negation has always been confusing to me. Am I doing it right or wrong. The way I do it does not match any of the examples given.

Null Move

Code: Select all

    MakeMove(&nullMove);
    score = -Search(-beta, -beta + 1, depth - 1 - r);
    TakeBack();
    if(score >= beta) {
      PosStore(beta, depth, LOWER, &nullMove);
      return beta;
    } 
Search, Zero Window

Code: Select all

        score = -Search(-alpha - 1, -alpha, depth - lmr);
        if(score > alpha)
          score = -Search(-beta, -alpha, depth - 1);
I hate if statements. Pawns demand if statements. Therefore I hate pawns.

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Question on Null Move Pruning

Post by hgm » Tue Aug 29, 2017 5:47 pm

This is wrong. But you get away with it if beta = alpha+1, as it would be in a non-PV PVS node.

Post Reply