Null Move

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Null Move

Post by lauriet »

White (human) has just moved and Black (computer) will start to calculate. With recursive Null Move would the sequence be:

White (again......its got a free extra move)
Black moves (may be a cutoff here)
White moves
White moves again
Black moves (may be a cutoff here)
White moves
White moves again
Black moves (may be a cutoff here)
etc
etc

Cheers
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Null Move

Post by Dann Corbit »

It's a good idea to never do two null moves in a row.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
User avatar
hgm
Posts: 27819
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Null Move

Post by hgm »

It would more typically be

black moves (pointless move, after it already found something pretty good in the root)
black moves again (pointless move)
black moves again (pointless move)
black moves again (pointless move)
...

or

black moves
white moves (pointless move)
white moves (pointless move)
white moves (pointless move)
...

The idea is that there is no need to actively refute pointless moves when you are already enough ahead. You just sit and wait while the opponent is wasting his time, and at the end of the line you will still be ahead as much as you already were, and cash the fail high.

So what really happens is that you do an exhaustive search of what the opponent could do to hurt you in 1, 2, 3, ... moves while you do nothing. As soon as you find a sequence of moves that does end in his favor, you start looking what you have to do to thwart his plan in the easiest possible way, by replacing your last null move by something else, hoping that you will find a move that cures the problem. (E.g. you recapture something, instead of letting him take it and then move away again.) If not, you back up further and try an alternative for the null move there, etc.
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: Null Move

Post by abulmo2 »

Dann Corbit wrote: Wed Apr 22, 2020 7:51 am It's a good idea to never do two null moves in a row.
If I remember well, Vincent Diepeven was a proponent of two consecutive null moves to avoid zugwang; but, of course, triple null moves should then be avoided.
Richard Delorme
User avatar
hgm
Posts: 27819
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Null Move

Post by hgm »

Micro-Max does an arbitrary number of null moves in a row, and it doesn't seem to hurt it.

Inserting a pair of consecutive null moves in a line is just a peculiar implementation of Internal Iterative Deepening: you search the same position with the same side to move at (doubly) reduced depth. If both the null moves are the first move searched in their respective nodes, this search happens before the unreduced search, and the info it leaves in the hash will then help to guide the latter. (E.g. because the unreduced search now finds a hash move. If there already was a hash move, it would likely be good enough to cause a hash cut in the node after the second null move, so that the second null move hardly took any effort.)

The second null move would either fail high or low; if it fails high, the first null move fails low, and the position before it is searched to full depth anyway. If the second null move fails low, it is like it was't playtried at all, and the fate of the first null move will be decide by whether any of the real moves can refute it.
Dann Corbit
Posts: 12542
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Null Move

Post by Dann Corbit »

If I recall correctly, double null move is best used when you are down to kingz and pawns. The good thing about it is that you can keep using null move pruning and get greater depth where normally it would just be turned off. Also, if you have one null move refuted by the next null move you avoid zugzwang. But you also need enough depth to the horizon. There is some formula for the depth but it was about ten plies to go, I think.

I don't remember if Stockfish uses double null move, but it does use Omid David's null move verification search.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Karlo Bala
Posts: 373
Joined: Wed Mar 22, 2006 10:17 am
Location: Novi Sad, Serbia
Full name: Karlo Balla

Re: Null Move

Post by Karlo Bala »

abulmo2 wrote: Wed Apr 22, 2020 9:38 am
Dann Corbit wrote: Wed Apr 22, 2020 7:51 am It's a good idea to never do two null moves in a row.
If I remember well, Vincent Diepeven was a proponent of two consecutive null moves to avoid zugwang; but, of course, triple null moves should then be avoided.
A double null move has a flow, you can see in the discussion between Vincent and Christophe Theron some 20 years ago :)
I hope they are saved in some old CCC achieves.

You can use a shallower (than null) verification search which is better than a double null. And ... instead of doing verification after the null move, you can actually do it before (and avoid all that static conditions to do null or not to do). If it fails you skip the null move.
Best Regards,
Karlo Balla Jr.
lauriet
Posts: 199
Joined: Sun Nov 03, 2013 9:32 am

Re: Null Move

Post by lauriet »

>It would more typically be

>black moves (pointless move, after it already found something pretty good in the root)
>black moves again (pointless move)
>black moves again (pointless move)
>black moves again (pointless move)
or
>black moves
>white moves (pointless move)
>white moves (pointless move)
>white moves (pointless move)
*******************************************************************************************************************************************************

Wow ! is that right. Black plays his move and then keeps letting white play, until the end of that line ?
I thought the idea was to give (say) white a free move (thats 2 in a row) and then search normally at a shallower depth ???
When I step through my code it does in fact go -> B, W, W, W and I thought this was an error.

So surely if white gets 3 or 4 moves in a row he can do a LOT of damage to black.
User avatar
hgm
Posts: 27819
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Null Move

Post by hgm »

Yes, he usually can. But that is exactly the idea. He has on average 40 moves in each turn, and from the zillions of sequences of 4 moves only a handful of lines correspond to a coherent plan that does damage. All the rest is pointless shuffling of pieces, and the null move is a good method to deal with that cheaply (by not continuing those lines very deep because of the accumulated reduction). So you just keep it up until he really starts to do damage that you cannot recoup afterwards, and then you search for an alternative pre-emptive defense against it by replacing the latest null move by something useful (and thus with more depth). This way you focus the search effort on lines with reasonable black play.

In recursive null move "searching normally" means trying a null move first.