Null move pruning

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Re: Null move pruning

Post by Dann Corbit »

cms271828 wrote:Ok, I've separated my search to include a root node, but I'm somewhat confused.
If you used null move in the root, and it returned a value, then I can see theres no move to play, which makes sense.

But, in the root, doesn't beta=infinity, so how can you have val>=beta occuring at the root? So at the root, the null move should never return.

Or perhaps I've missed the point :?
Most people don't use null move at the root.

Obviously, you can't use it for the first iteration, before you have a window.
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Null move pruning

Post by Desperado »

Hi,

just another question on the nullmove.
I wonder what board attributes are modified by a nullmove.

beside: colorToMove,hashkey

example:

1.ep-Capture possible! (epSquare is set)
2.nullmove
3. ep-Capture possible or not ?

every _normal_ 2nd move would destroy the right for a epCapture.

- what is with epStatus
- what is with halfmoveclock
- any other basic board-attributes modified i do not think of at the moment ?

Well that the hashkey has to be updated where the changed attributes
are hashed in, seems to be clear.

Michael
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Null move pruning

Post by Desperado »

bob wrote:
cms271828 wrote:Thanks, I can see why being in check and zugzwang is bad for nmp.

I'm not sure if theres anything I need to do in MakeNullMove() and UndoNullMove(), and also where should I take the first null move, and how often should I use null move?

Thanks
The only thing you need to do is clear the enpassant target, of course. If I play a null-move after you play a move like e7-e5, I no longer have an opportunity to make an EP capture, so the hash signature needs to be corrected for that, assuming you are currently factoring this in to your signature. If course, as part of that the 50 move counter has to be reset, as you are making an "irreversable" move (actually an illegal move). Ditto for your repetition detection as you can't possibly repeat a position that occurred before the null-move.
Hello Bob,

(just didnt saw this post before...)

1.?
well if there isnt the opportunity any longer to make an EP capture, i agree
with you that the nullmove is considered as "irreversible" move.
Otherwise it would be reversable or not ? (And who defined that rule,or simple why ?)

(well, i think because epCapture must be done immediatelly as next
move on a doublePawnPush, implies no move (also no nullmove) can
be done without loosing the opportunity for epCapture) in between.
That would affirm your statement).

2.?
While the nullmove is neither a pawnMove nor a capture, one may argue
that the halfmoveclock has to be incremented (and not reset, you also
increment the treeheight,reduce depth... which influences the entries of the hashtable, and the result of the search ?!) .
A nullmove is at the end a placeholder for one of the regular moves available (which of course _can_ increment the counter) (considered as the weakest move).

At the moment i dont see a reason to reset the counter !?
(maybe there are some reasons).

3.?

And why you can not repeat a position on nullmove ? (i dont have
now in mind the case with epcapture).

ex: 1.move null 2. moveback null 3. repeatedPosition

when null is placeholder for a reversible move:

ex: 1. Nf3 (Nf6) 2. Ng1 (Ng8) 3. Nf3

Also not clear for me ?!

Michael