Hi all,
Just looking at my code again, and I like to do null moves whenever possible. But I'm aware many engines only attempt null move when the score is above beta.
How much of a win is only doing null moves when score >= beta?
My testing, in my program, shows it makes practically no difference.
What have others found?
Null move pruning, only when score >= beta?
Moderators: hgm, Rebel, chrisw
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
-
- Posts: 96
- Joined: Fri Jul 06, 2018 1:09 am
- Location: Chicago, IL
- Full name: Josh Odom
Re: Null move pruning, only when score >= beta?
I haven't implemented null move pruning, but theoretically...
Pruning when score == beta should only fail for the same case as pruning when score > beta -- when the side to move is in zugzwang. Pruning for score >= beta should be strictly better, unless there is some other bug with your null pruning code. If you see very little impact from this change, then I suspect the case of null move pruning where score is exactly == beta is just rare.
Pruning when score == beta should only fail for the same case as pruning when score > beta -- when the side to move is in zugzwang. Pruning for score >= beta should be strictly better, unless there is some other bug with your null pruning code. If you see very little impact from this change, then I suspect the case of null move pruning where score is exactly == beta is just rare.
-
- Posts: 27808
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Null move pruning, only when score >= beta?
But I suppose he refers to the case score < beta.
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
-
- Posts: 360
- Joined: Thu Jan 22, 2015 3:21 pm
- Location: Zurich, Switzerland
- Full name: Jonathan Rosenthal
Re: Null move pruning, only when score >= beta?
There is only one way to find out. You make the change and measure the difference. Iirc in Winter it was below the threshold I could actually measure with my resources at the time, meaning it was single digit. Every engine is different though. It's quite possible the condition should not be added in your program at all.
-Jonathan
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
Re: Null move pruning, only when score >= beta?
..and that is what I am doing. So far, only considering nullmove when score>=beta is giving about +4 ELO, after 3600 games. So not a big deal, I thinkjorose wrote: ↑Fri Jan 25, 2019 10:12 pm There is only one way to find out. You make the change and measure the difference. Iirc in Winter it was below the threshold I could actually measure with my resources at the time, meaning it was single digit. Every engine is different though. It's quite possible the condition should not be added in your program at all.
-
- Posts: 96
- Joined: Fri Jul 06, 2018 1:09 am
- Location: Chicago, IL
- Full name: Josh Odom
Re: Null move pruning, only when score >= beta?
Wait, I think I am misunderstanding you. When you say "score", do you mean the static evaluation of the current position?
-
- Posts: 327
- Joined: Sat Mar 27, 2010 7:15 pm
-
- Posts: 855
- Joined: Sun May 23, 2010 1:32 pm
Re: Null move pruning, only when score >= beta?
probably when you have a static evaluation below beta and you give the opponent a free move, it's very difficult that you can have a beta cutoff, but also it will add very few node to verify that the result is below beta, so it make very small difference.
you can see "null move pruning" as : if my situation is so good that giving a free move to my opponent I still have the advantage, so I bet that I could say this is a good position.
Or if you look it from the previous move (opponent): if I have done a very bad move that even if I was given another free move I could not recover, the the move is with good probability bad.
removing "score >=beta" from the test you are removing the assertion that "your situation is so good" from the test.
you can see "null move pruning" as : if my situation is so good that giving a free move to my opponent I still have the advantage, so I bet that I could say this is a good position.
Or if you look it from the previous move (opponent): if I have done a very bad move that even if I was given another free move I could not recover, the the move is with good probability bad.
removing "score >=beta" from the test you are removing the assertion that "your situation is so good" from the test.