Hi,
I don't know anything about null move pruning, but I know someone using verified null move pruning (using reduction depth 3, then verifying it with normal null move pruning).
I'm using hash tables, and QS, so would like to get the search depth a bit deeper with null move pruning, but I don't which version to use.
Is there any good pseudocode I can use that will fit in around QS?
Thanks
Null move pruning
Moderators: hgm, Rebel, chrisw
-
- Posts: 27809
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Null move pruning
I think most people nowadays don't bother with verification anymore. Just start with recursive NMP (i.e. an unlimited number of null moves in a branch). You could forbid two null in direct succession ("double null move"), but even that is not needed, and some even claim that double null move is better. In fact micro-Max does an unlimited number of null moves in direct succession, and even then NMP enhances its search enormously.
Reduce by 3 ply, or by 3 ply deep in the tree, and by 2 close to the leaves.
Reduce by 3 ply, or by 3 ply deep in the tree, and by 2 close to the leaves.
-
- Posts: 1056
- Joined: Fri Mar 10, 2006 6:07 am
- Location: Basque Country (Spain)
Re: Null move pruning
Page Bruce Moreland:
http://www.seanet.com/~brucemo/topics/nullmove.htm
WikiChess:
http://chessprogramming.wikispaces.com/ ... ve+Pruning
http://www.seanet.com/~brucemo/topics/nullmove.htm
WikiChess:
http://chessprogramming.wikispaces.com/ ... ve+Pruning
Code: Select all
//we proved a null move
if (do_null && !incheck) {
if (piece_mat[side] >= piece_value[KNIGHT]) {
depthnull = depth - 1 - R - (depth>5);
old_ep = ep; // now make mullmove
ep = -1;
side ^= 1;
xside ^= 1;
old_hash = hash;
set_hash();
x = -search(-beta, -beta + 1, depthnull, FALSE);
hash = old_hash; // now undo mullmove
xside ^= 1;
side ^= 1;
if (depth >= 7 && x >= beta) { //now verification in endgame (not want zugzwangs)
if (piece_mat[side] <= 1260) {
depthnull = depth - 6;
x = search_no_full(alpha, beta, depthnull);
}
}
ep = old_ep;
if (x >= beta)
return beta; //prunning
}
}
-
- Posts: 316
- Joined: Wed Apr 12, 2006 10:47 pm
Re: Null move pruning
Thanks, I was already looking at Bruce Morlands site..
I don't get it though, where it says..
Then supposing we're at a white node, what is the null move?
It doesn't say anything about generating moves like it does in the regular code with GenerateLegalMoves().
I thought the idea was to let black(in this instance) have 2 moves, so that if his score is still bad, whites move must have been strong.
I don't get it though, where it says..
Code: Select all
MakeNullMove();
val = -AlphaBeta(depth - 1 - R, -beta, -beta + 1);
UnmakeNullMove();
if (val >= beta) return beta;
It doesn't say anything about generating moves like it does in the regular code with GenerateLegalMoves().
I thought the idea was to let black(in this instance) have 2 moves, so that if his score is still bad, whites move must have been strong.
Colin
Re: Null move pruning
The null move is still a move from the point of view of the search code. You do everything you do for a normal move except that you don't move anything on the board.
Black made his move, white is doing his null move and you call search() so black will play again.
HJ.
Black made his move, white is doing his null move and you call search() so black will play again.
HJ.