Null move Pruning

Discussion of chess software programming and technical issues.

Moderator: Ras

DaOnlyOwner
Posts: 4
Joined: Thu Oct 28, 2021 12:13 pm
Full name: Ingo Haas

Null move Pruning

Post by DaOnlyOwner »

Hello,
I have developed an engine and I recently implemented null move pruning.

However I don't understand why we pass - beta + 1 as an argument in the function call (like this):

Code: Select all

-alphabeta(depth-1-R,-beta,-beta+1)
Why not how it's always done with -alphabeta(depth-1-R,-beta,-alpha)?
User avatar
Ras
Posts: 2720
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Null move Pruning

Post by Ras »

DaOnlyOwner wrote: Fri Oct 29, 2021 12:19 amHowever I don't understand why we pass - beta + 1 as an argument in the function call (like this):

Code: Select all

-alphabeta(depth-1-R,-beta,-beta+1)
Why not how it's always done with -alphabeta(depth-1-R,-beta,-alpha)?
Because with null move, your alpha is (beta-1), hence -alpha = -(beta-1) = -beta+1. You're trying to see whether you get a fail-high, i.e. whether you get a score of at least beta returned. Anything below beta would not be a fail-high, so you make the window as small as possible, that's why you choose alpha as beta-1.
Rasmus Althoff
https://www.ct800.net
User avatar
hgm
Posts: 28426
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Null move Pruning

Post by hgm »

If the null move doesn't score above beta, you won't use its score, and consequently you don't care wheter is scores above or below alpha. Requesting the search to determine the exact score, just to discard it, is a waste of time.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Null move Pruning

Post by Henk »

null window searches may pollute killer administration? Or better bad killer moves than no killer moves
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Null move Pruning

Post by Desperado »

DaOnlyOwner wrote: Fri Oct 29, 2021 12:19 am Hello,
I have developed an engine and I recently implemented null move pruning.

However I don't understand why we pass - beta + 1 as an argument in the function call (like this):

Code: Select all

-alphabeta(depth-1-R,-beta,-beta+1)
Why not how it's always done with -alphabeta(depth-1-R,-beta,-alpha)?
Another point to the already mentioned ones is, that most people do not use nullmove at a pv node.
In PVS that means you only do nullmove when the window is already closed, which then, is equivalent to "-beta,-alpha".

Finally you want to test against a bound and normally you test against beta.
But you do not need to do this. If you decide to test against beta +- margin you can do that too.

You should think of what the idea behind nullmove is. The idea is to check for a serious threat or
more general you want to know if you have a move that will refute the predecessor (e.g. by beating beta).
The assumtion then is, that if the nullmove move will do it, a real move will do it too. (if we exclude Zugzwang situations).

"Testing" for a bound in a search means that you will always use a nullwindow (bound-1,bound) because you are only interested if the value is >= bound.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Null move Pruning

Post by Henk »

I tried to use null moves to test if there were threats on both sides. If no threats than stop searching. But too slow I guess. So I now believe null moves are too slow for using extra threat detection.
DaOnlyOwner
Posts: 4
Joined: Thu Oct 28, 2021 12:13 pm
Full name: Ingo Haas

Re: Null move Pruning

Post by DaOnlyOwner »

Thanks guys, I think I finally got it.