Why not two consecutive null moves ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Why not two consecutive null moves ?

Post by mar »

Interesting. I recently switched from NMP+verification to hybrid NMP+NMR, this seems to have helped a bit in some positions while not losing elo (bullet only).
i.e. at low depths I prune (<=6) otherwise I reduce current node to 2/3 depth
User avatar
hgm
Posts: 27790
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Why not two consecutive null moves ?

Post by hgm »

This reduced search is just to check if there is a zugzwang? In that case it seems a wast of time when you have many mobile pieces. What do you do if the reduced search fails low? Do a full-depth search?
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Why not two consecutive null moves ?

Post by mar »

Yes I do (in parent node). To be more specific, I do this:
do nullmove, if it fails high, then I either prune at low depth or reduce current node (expecting to fail high).
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Why not two consecutive null moves ?

Post by Henk »

mar wrote:Yes I do (in parent node). To be more specific, I do this:
do nullmove, if it fails high, then I either prune at low depth or reduce current node (expecting to fail high).
So what happens in the case you reduce current node and it fails low ?
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Why not two consecutive null moves ?

Post by mar »

It almost never fails low.
If a zw node fails low then it produces a cutoff in parent node.
mar
Posts: 2554
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Why not two consecutive null moves ?

Post by mar »

Sorry, of course I don't because it then produces a cutoff.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Why not two consecutive null moves ?

Post by bob »

Henk wrote:How many real plies does a null move reduction need to make it work correctly ? For instance do I need to test depth >= R + 2 if Null move reduction reduces with R. (My null move reduction does not reduce with R + 1)

Code: Select all

 if &#40;depth >= R + 2 && depth < pos.MaxDepth&#41;
 &#123;
        if &#40;NullMoveCutOff&#40;entry, depth, ub, out nullMoveValue&#41;)
        &#123;
             bestMove = null;
             return nullMoveValue;
        &#125;

 &#125;
The main danger is allowing a null-move to take you to a VERY selective search where you miss tactical threats, particularly mates. If your q-search includes at least one ply of non-capturing checks, then you can feel pretty safe reducing with r=3 everywhere, since you still get checks even if you collapse directly into q-search. If you do not do q-search checks, I would leave one ply of full-width search on the end to be sure that you are not playing oblivious to a serious tactical threat.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Why not two consecutive null moves ?

Post by Henk »

bob wrote:
Henk wrote:How many real plies does a null move reduction need to make it work correctly ? For instance do I need to test depth >= R + 2 if Null move reduction reduces with R. (My null move reduction does not reduce with R + 1)

Code: Select all

 if &#40;depth >= R + 2 && depth < pos.MaxDepth&#41;
 &#123;
        if &#40;NullMoveCutOff&#40;entry, depth, ub, out nullMoveValue&#41;)
        &#123;
             bestMove = null;
             return nullMoveValue;
        &#125;

 &#125;
The main danger is allowing a null-move to take you to a VERY selective search where you miss tactical threats, particularly mates. If your q-search includes at least one ply of non-capturing checks, then you can feel pretty safe reducing with r=3 everywhere, since you still get checks even if you collapse directly into q-search. If you do not do q-search checks, I would leave one ply of full-width search on the end to be sure that you are not playing oblivious to a serious tactical threat.
My q-search does not recognize mate. It only searches zero or more captures. So if it gives the opponent a full-width search returning a move that attacks a king it would not be detected in q-search. It would only prevent it from doing captures (except capture of the king) at level 0. That means that two full-width searches looks safer. But maybe that might be too expensive.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Why not two consecutive null moves ?

Post by bob »

Henk wrote:
bob wrote:
Henk wrote:How many real plies does a null move reduction need to make it work correctly ? For instance do I need to test depth >= R + 2 if Null move reduction reduces with R. (My null move reduction does not reduce with R + 1)

Code: Select all

 if &#40;depth >= R + 2 && depth < pos.MaxDepth&#41;
 &#123;
        if &#40;NullMoveCutOff&#40;entry, depth, ub, out nullMoveValue&#41;)
        &#123;
             bestMove = null;
             return nullMoveValue;
        &#125;

 &#125;
The main danger is allowing a null-move to take you to a VERY selective search where you miss tactical threats, particularly mates. If your q-search includes at least one ply of non-capturing checks, then you can feel pretty safe reducing with r=3 everywhere, since you still get checks even if you collapse directly into q-search. If you do not do q-search checks, I would leave one ply of full-width search on the end to be sure that you are not playing oblivious to a serious tactical threat.
My q-search does not recognize mate. It only searches zero or more captures. So if it gives the opponent a full-width search returning a move that attacks a king it would not be detected in q-search. It would only prevent it from doing captures (except capture of the king) at level 0. That means that two full-width searches looks safer. But maybe that might be too expensive.
Just so you have at least one ply to recognize mates. Which means you have to extend when you give a check rather than extending when you escape check, or you will need 2 plies at the end.