Null Move Pruning

Home * Search * Selectivity * Pruning * Null Move Pruning



Null Move Pruning, also called Null Move Heuristic (NMH), is a method based on the Null Move Observation to reduce the search space by trying a "null" or "passing" move, then seeing if the score of the subtree search is still high enough to cause a beta cutoff. Nodes are saved by reducing the depth of the subtree under the null move. The value of this depth reduction is known as R.

=History=

Mater II
In computer chess, Null Move was already used in threatening mate in one detection, as elaborated by George Baylor and Herbert Simon in A chess mating combinations program, 1966, the description of Mater II. Routine G17 asks if a proposed move threatens mate in one move. It determines the answer by assuming Black does nothing on his turn, that is, by playing a "No Move" and then seeing if White can enforce an immediate checkmate.

Kaissa
Null Move pruning was already used in Kaissa, as described by their authors 1975 in Some Methods of Controlling the Tree Search in Chess Programs, at the end of chapter 2: 2. The Order of Move Considerations: A less trivial idea was that sometimes an extension of the game tree by introducing of dummy move can lead to a reduction of the search tree. In positions with material advantage (with respect to limits) it was permitted to try a so-called "blank" move in which ones own pieces are not moved. Certainly in positions with "Zugzwang" (the side to move must weaken his position) this may lead to errors.

However, the standard of the program's play is still such that such errors do not essentially lower it. (We plan to develop in the future a procedure for recognizing "Zugzwang" positions, and to forbid a blank move in them.) The reduction of search takes place in this case, because the blank move proves to be a closing one and furthermore does not generate complex forcing variations.

Beal's NMQS
Null move was further examined by Don Beal, as already elaborated in his Advances in Computer Chess 5 lecture. He proposed a so called Null Move Quiescence Search (NMQS) as a selective layer between a regular full width search and quiescence search, later dubbed Generalized Quiescence Search. The full width search was called with two depth parameters, both considered inside the transposition table, full-depth and q-depth. Full-depth was recursively decremented as usual, but instead of calling quiescence at the full-depth horizon, NMQS with q-depth was called - q-depth recursively decremented in this layer as well. As long as q-depth is greater than zero, the hash move, if any, is searched first regularly. Next, NMQS calls quiescence for the other side to move, to check for a possible null move beta-cutoff, before proceeding the remaining moves in usual manner. As pointed out by Chun Ye in his 1992 thesis, NMQS permits more flexible iterative deepening concerning full-depth in an outer and q-depth in an inner loop.

Schaeffer
In his 1987 ICCA Journal paper Speculative Computing, Jonathan Schaeffer mentioned The Null-Move Algorithm or Don Beal's null-move, and used it non-recursively up to once per search path in his tactical scout solver Minix (Mini-Phoenix), which up and then gave the parallel running Phoenix, which was a less deep searcher than Minix, some tactical hints.

Goetsch and Campbell
Gordon Goetsch and Murray Campbell published the results of some experiments with Null move pruning in 1988 and 1990, already considering recursive NMP with depth reduction of 1, also mentioned in Chun Ye's 1992 thesis with source code as implemented inside the Chinese Chess program Abyss.

Morsch and Donninger
Null move pruning was used recursively to possibly occur multiple times inside a path of the search by Frans Morsch inside his chess engines Quest and Fritz. Frans exchanged his ideas with Chrilly Donninger, who popularized null move by his Null Move and Deep Search paper in the ICCA Journal 1993. =Schemes= Most typical engines use recursive null move with an R value of 2 or 3. Recursive null move pruning is simply allowing more than one null move in one branch of the search. Fruit uses a depth reduction factor R=3, with no null move pruning when down to king and pawns for the side to move, or when in check. The default for Fruit is to try a null search if the static evaluation is greater than beta, or the depth less than four. Newer versions of Fruit as well as Toga default to always doing a null search, as long as there is at least one piece of value greater than a pawn for that side.

Adaptive Null Move Pruning
Ernst A. Heinz proposed refinements with Adaptive Null Move Pruning. Some programs vary R with depth, or based on evaluation features, such as being in or near the endgame.

Restrictions on use
Obviously, the null move cannot be used when the side to move is in check, because that would result in an illegal position. But there are more less obvious restrictions on using null move safely. The theoretical basis of null move pruning, as coined by Christophe Théron, is the null move observation. The null move observation is the fact that in chess, in almost every position, the side to move will have a move to play that is better than doing nothing.

There are a few situations in which this assumption does not hold. The null move will produce very bad results in zugzwang positions - positions in which not moving would be the best move, if it were legal. For this reason, some conditions must be used for when the null move is tried in search. Most engines do not try the null move in the endgame, because that is where zugzwang positions are most likely to occur, because there are fewer pieces to move. It is debatable whether a programmer should allow the null move search descend directly to the quiescence search. Most probably it is worthwile only with more tactically aware versions of quiescence.

Some other ways to combat the negative effect of the null move observation are listed here:

Zugzwang Verification
Concerning null move failures in zugzwang, there were proposals by Stefan Plenkner 1995, and later the Verified Null-Move Pruning approach by Eli David and Nathan S. Netanyahu. Recently Robert Hyatt tested Verified Null-Move Pruning extensively with a lot of variations and depth reductions for the verified search, and concluded it does not help at all in Crafty similar with extended null-move reductions. However, Marco Costalba states that verification search has almost nothing to do with zugzwang.

Double Null Move
Widely discussed in computer chess forums was the Double Null Move idea by Vincent Diepeveen to perform two consecutive null moves to detect zugzwang.

Variable NM Bound
The idea to permit a null move cutoff not only if the null move search returns a value greater than or equal to beta, but also if the value is slightly less - that is using a bound of beta minus some tempo bonus, was already proposed by Gordon Goetsch and Murray Campbell in 1988 as future research idea. Yngvi Björnsson and Tony Marsland substantiated the idea as implemeted in The Turk, where the number of potentially good alternative moves (numPGAM) per side in the path from the root to the current node as estimated by positive scores of generated moves from the history heuristic, was used to determine a tempo bonus of 10 or 20 centipawns - the higher numPGAM, the lower the probability that an erroneous forward pruning decision will propagate up the tree. if ( nullMoveAllowed && ...) { int bound = beta; if ( inNullMoveSearch == 0 ) { tempo = 10*(numPGAM > 0) + 10* numPGAM > 15);     bound -= tempo; // variable bound   }   makeNullMove; ++inNullMoveSearch;   score = -zwSearch(1-bound, depth-R-1)   unmakeNullMove; --inNullMoveSearch;   if ( score >= bound ) {      return beta; // null move pruning   } } For zwSearch, see Zero Window Search inside the Principal Variation Search. =Threat Detection=

Mate Threats
As suggested in Donninger's paper, concerning the deep search, null move is not only about pruning, but also about detecting threat moves by the opponent to improve further move ordering and to possibly trigger mate threat extensions. However, some kind of fail-soft framework is necessary to recognize "I get mated, if I do nothing", otherwise the hard bound of a null window null-move search around beta will limit the upper bound to beta-1. Another, possibly too expensive solution with a fail-hard framework, is to play a bit with the search window, if the null move doesn't fail high: if ( nullMoveAllowed && depth >= X && ...) { makeNullMove score = -zwSearch(1-beta, depth-R-1) // -AlphaBeta (0-beta, 1-beta, depth-R-1) if (score >= beta ) { // fail high on null move unmakeNullMove; return beta; // null move pruning } else { if ( zwSearch( VALUE_MATE/2, depth-R-1) > VALUE_MATE/2 ) extend; // mate threat extension inside a fail hard framework unmakeNullMove; } }

Botvinnik-Markoff Extension
Null move is also the base of the Botvinnik-Markoff Extension, as proposed by Sergei Markoff - as a tribute to the computer chess pioneer and former World Chess Champion Mikhail Botvinnik, who addressed related issues in his publications.

Influence on Move Ordering
Most of the time, null move is refuted by a capture. Therefore it makes sense to extract a move that refuted null move from the transposition table, record the target square of such a move, to give a move ordering boost for escaping from that square. Also, there is a strong conjecture that in programs using history move ordering, even a failed null move search helps by filling the history tables faster.

=Test Results=
 * Null Move Pruning Test Results - various experimental test results of null move pruning
 * Null Move Test-Positions, where Null Move may fail due to zugzwang

=See also=
 * Enhanced Forward Pruning
 * Extensions
 * Fail-High Reductions
 * Knowledge | Search versus Evaluation
 * Multi-Cut
 * Null Move Observation
 * Null Move Reductions
 * ProbCut
 * Reductions
 * Reverse Futility Pruning (Static Null Move Pruning)

=Publications=

1966

 * George W. Baylor, Herbert A. Simon (1966). A chess mating combinations program. AFIPS Joint Computer Conferences, reprinted 1988 in Computer Chess Compendium

1975

 * Georgy Adelson-Velsky, Vladimir Arlazarov, Mikhail Donskoy (1975). Some Methods of Controlling the Tree Search in Chess Programs. Artificial Intelligence, Vol. 6, No. 4, pp. 361-371. ISSN 0004-3702. Reprinted (1988) in Computer Chess Compendium

1980 ...

 * Gordon Goetsch, Murray Campbell (1988). Experimenting with the Null Move Heuristic in Chess. AAAI Spring Symposium Proceedings, pp. 14-18.
 * Don Beal (1989). Experiments with the Null Move. Advances in Computer Chess 5, a revised version is published (1990) under the title A Generalized Quiescence Search Algorithm. Artificial Intelligence, Vol. 43, No. 1, pp. 85-98. ISSN 0004-3702, edited version in (1999). The Nature of MINIMAX Search. Ph.D. thesis, IKAT, ISBN 90-62-16-6348. Chapter 10, pp. 101-116

1990 ...

 * Don Beal (1990). A Generalized Quiescence Search Algorithm. Artificial Intelligence, Vol. 43, No. 1, pp. 85-98. ISSN 0004-3702
 * Gordon Goetsch, Murray Campbell (1990). Experiments with the Null-Move Heuristic. Computers, Chess, and Cognition, pp. 159-168
 * Chun Ye (1992). Experiments in Selective Search Extensions. M.Sc. thesis, Department of Computing Science, University of Alberta, pdf
 * Chrilly Donninger (1993). Null Move and Deep Search: Selective-Search Heuristics for Obtuse Chess Programs. ICCA Journal, Vol. 16, No. 3
 * Stefan Plenkner (1995). A Null-Move Technique Impervious to Zugzwang. ICCA Journal, Vol. 18, No. 2
 * Ernst A. Heinz. (1999). Adaptive null-move pruning. ICCA Journal, Vol. 22, No. 3, ps

2000 ...

 * Yngvi Björnsson, Tony Marsland (2000). Selective Depth-First Search Methods. in Jaap van den Herik, Hiroyuki Iida (eds.) (2000). Games in AI Research. Universiteit Maastricht, pdf preprint
 * Omid David, Nathan S. Netanyahu (2002). Verified null-move pruning. ICGA Journal, Vol. 25 No. 3
 * Don Beal (2006). Review of a nullmove-quiescence search mechanism from 1986. [[FILE:alg1986review.txt]] (Draft)
 * Omid David, Nathan S. Netanyahu (2008). Extended Null-Move Reductions. CG 2008, pdf

2010 ...

 * Kunihito Hoki, Masakazu Muramatsu (2012). Efficiency of three Forward-Pruning Techniques in Shogi: Futility Pruning, Null-move Pruning, and Late Move Reduction (LMR). Entertainment Computing, Vol. 3, No. 3
 * Daniel S. Abdi (2013). Analysis of pruned minimax trees. pdf » Alpha-Beta, Late Move Reductions

=Forum Posts=

1995 ...
1997 1998 1999
 * Null Move heuristic by Valavan Manohararajah, rec.games.chess, July 28, 1995
 * Null move depth reductions by Tom King, rgcc, February 02, 1997 » Depth Reduction R
 * Null move? by MLC, rgcc, October 07, 1997
 * Searching correctly with the Nullmove ==> no zugzwang problems anymore by Vincent Diepeveen, rgcc, October 23, 1997
 * During Null Move search by Peter Fendrich, CCC, June 02, 1998
 * Extend or not extend in a nullmove tree by Roland Pfister, CCC, June 08, 1998 » Extensions
 * Zero-width Window Null Move Search by Dezhi Zhao, CCC, June 15, 1998 » Null Window
 * search extension by Werner Inmann, CCC, July 08, 1998
 * Null move reductions by Roberto Waldteufel, CCC, October 04, 1998
 * Confusion on Null Move by KarinsDad, CCC, February 09, 1999
 * A Null Move Enhancement? by Daniel Homan, CCC, February 10, 1999


 * Singular Extensions, Nullmove deepsearch by Frank Schneider, CCC, February 16, 1999 » Singular Extensions
 * NULL MOVE by Sylvain Lacombe, CCC, February 24, 1999
 * To skin a cat (was Re: NULL MOVE) by Don Dailey, CCC, February 24, 1999


 * Null move around (beta-1, beta) by Tom King, rgcc, March 05, 1999
 * Null move idea by Heiner Marxen, CCC, June 04, 1999
 * Null move mate extension by James Robertson, CCC, June 25, 1999
 * It is a nullmove killer (zugzwang) by Rémi Coulom, CCC, November 05, 1999 » Zugzwang
 * Pseudo-code for verification search by Dan Homan, CCC, November 06, 1999

2000 ...
2001 2002 2003 2004
 * Pseudo C code for double nullmove + PVS by Vincent Diepeveen, CCC, August 06, 2000
 * is this nullmove? problems in pulsar algorithm by Mike Adams, CCC, September 20, 2000 » Pulsar
 * Can nullmoves behave like this? by Severi Salminen, CCC, January 08, 2001
 * Nullmove: when to avoid it? by Leen Ammeraal, CCC, February 28, 2001
 * An idea for all you chess programmers. by Paul, Winboard Forum, March 16, 2001
 * Double Nullmove by David Rasmussen, CCC, March 30, 2001
 * Double Null move? by Steve Maughan, CCC, July 13, 2001
 * Null move R=2 vs Null move R=2/3 by Tom King, CCC, August 09, 2001 » Depth Reduction R
 * Crafty-IsiChess,CCT4,r11 ==> A move to avoid? by José Antônio Fabiano Mendes, CCC, January 29, 2002
 * Double Nullmove by Andreas Herrmann, CCC, April 25, 2002
 * Null-Move: Difference between R = 2 and R = 3 in action by Omid David, CCC, July 11, 2002
 * Verified Null-Move Pruning, ICGA 25(3) by Omid David, CCC, November 20, 2002
 * new thoughts on verified null move by Scott Farrell, CCC, November 23, 2002
 * An interesting forward pruning experiment - with pseudo description by Vincent Diepeveen, rgcc, February 08, 2003
 * The "same threat extension" as effective way to resolve horizon problem by Sergei Markoff, CCC, October 01, 2003 » Botvinnik-Markoff Extension
 * a question to Tord about detecting threats in null move by Uri Blass, CCC, October 03, 2003
 * Re: not using nullmove? by Tord Romstad, CCC, February 13, 2004
 * mtd(f) and null move by Peter Alloysius, CCC, March 11, 2004 » MTD(f)
 * When to do a null move search - an experiment by Tord Romstad, CCC, April 26, 2004
 * double null move help by Daniel Shawul, CCC, July 04, 2004
 * An MTD(f) question about NULL MOVE searching by Dann Corbit, CCC, July 16, 2004 » MTD(f)
 * null move question(Fruit) by Jan K., CCC, July 22, 2004
 * Verified Null-moving by Tor Lattimore, CCC, August 12, 2004 » Verified Null Move Pruning
 * mate threat extension/null move by Rick Bischoff, CCC, September 25, 2004

2005 ...
2006 2007 2008 2009
 * recusive null move in iterative search by Daniel Shawul, Winboard Forum, March 25, 2005 » Iterative Search
 * Reductions and null move refutations by Tord Romstad, Winboard Forum, April 18, 2005 » Reductions, Late Move Reductions
 * depthnull by Pedro Castro, Winboard Programming Forum, July 04, 2005
 * Verified null-move pruning by Tom King, Winboard Programming Forum, March 09, 2006
 * Simple NULL move enhancement, checks in qsearch by Mark Lefler, Winboard Programming Forum, April 14, 2006
 * NMP on ALL nodes by Onno Garms, Winboard Programming Forum, April 15, 2007 » All Nodes
 * Re: Search or Evaluation? by Mark Uniacke, Hiarcs Forum, October 14, 2007
 * Null Move by Stuart Cracraft, CCC, November 23, 2007
 * fractal null move by Pawel Koziol, CCC, November 28, 2007
 * null move threat extension by Andrew Short, CCC, October 23, 2008
 * Null move in quiescence search idea from Don Beal, 1986 by Eelco de Groot, CCC, Aug 17, 2009 » Quiescence Search, Don Beal
 * verified null move by Robert Hyatt, CCC, June 21, 2009
 * Null-moves and zugzwang by Luca Hemmerich, CCC, September 25, 2009 » Zugzwang

2010 ...
2011 2012 2013 2014
 * Using Heinz in 2010 is not optimal by Milos Stanisavljevic, CCC, January 01, 2010
 * Null-move pruning and the hash table by Robert Purves, CCC, March 28, 2010 » Transposition Table
 * Null moves gain by Giuseppe Cannella, Winboard Forum, May 13, 2010
 * nullmove and repetitive draw detection by Edward Yu, CCC, June 20, 2010 » Repetitions
 * Stockfish null move pre-condition by Rein Halbersma, CCC, July 22, 2010 » Stockfish
 * Extended Null-Move Reductions by Alvaro Cardoso, CCC, August 20, 2010
 * Less null move pruning by trans map by Onno Garms, CCC, March 13, 2011 » Onno
 * Null Move Pruning by Alex Farley, CCC, April 03, 2011
 * Null move alternative in endgames by Aleks Peshkov, CCC, November 16, 2011
 * TT avoid nullmove flag by Matthew R. Brades, CCC, August 02, 2012 » Transposition Table
 * Nullmove vs classic selective search by Ed Schröder, CCC, August 04, 2012
 * Null Move Fail by CDaley11, OpenChess Forum, January 10, 2013
 * Two questions by Jerry Donald, CCC, February 11, 2013
 * nullmove verification vs avoid null by Martin Sedlak, CCC, September 14, 2013
 * Null move, razoring and mate threats by Jon Dart, CCC, October 28, 2013 » Razoring
 * Is SF DD greater efficiency would be null move pruning? by Jonathan Lee, CCC, December 22, 2013 » Stockfish
 * fixing the null move search "bug" by Uri Blass, CCC, February 01, 2014 » Stockfish
 * Disabling Null Move Pruning in Stockfish by Louis Zulli, CCC, February 15, 2014 » Stockfish
 * Null move and LMR by Laurie Tunnicliffe, CCC, March 12, 2014 » Late Move Reductions
 * Null move pruning on PV nodes by Eric Oldre, CCC, July 22, 2014 » PV-Nodes

2015 ...
2016 2017 2018 2019
 * Why not two consecutive null moves ? by Henk van den Belt, CCC, May 07, 2015
 * thoughts on null-move reduction by Youri Matiounine, CCC, June 14, 2015 » Null Move Reductions
 * Null move: minimum depth by Henk van den Belt, CCC, September 14, 2015
 * Null Move in Quiescent search by Laurie Tunnicliffe, CCC, December 09, 2015 » Quiescence Search, Search Pathology
 * When to do null move by J. Wesley Cleveland, CCC, June 05, 2016
 * Calculating R value for Null Move by Andrew Grant, CCC, June 23, 2016 » Depth Reduction R
 * Null Move recommendations by kickstone, OpenChess Forum, July 29, 2016
 * Null Move in LMR by Laurie Tunnicliffe, CCC, August 10, 2016 » Late Move Reductions
 * Nullmove bugs by Matthew R. Brades, CCC, August 28, 2016
 * What is wrong with doing Nulls & ttcuts in a pv node ? by Mahmoud Uthman, CCC, January 21, 2017 » PV-Nodes, Transposition Table
 * NULL Move code question by thevinenator, OpenChess Forum, January 27, 2017 » CPW-Engine_search
 * null move by Folkert van Heusden, CCC, April 14, 2017
 * tt move vs null move by Erin Dame, CCC, May 27, 2017 » Hash Move, Null Move
 * End game and Null move by Laurie Tunnicliffe, CCC, June 12, 2017
 * Fifty move counter and Null move by Tamás Kuzmics, CCC, August 09, 2017 » Fifty-move Rule, Halfmove Clock
 * Rethinking r in null move by Michael Sherwin, CCC, August 18, 2017 » Depth Reduction R
 * Question on Null Move Pruning by Jason Fernandez, CCC, August 29, 2017
 * Threat detection by Harm Geert Muller, CCC, September 09, 2017 » Threat Detection, Threat Move
 * Making null move better? by Michael Sherwin, CCC, January 25, 2018
 * Null move pruning, only when score >= beta? by Tom King, CCC, January 25, 2019
 * idea: null-move analogy by Harm Geert Muller, CCC, March 06, 2019

=External Links=
 * Selective Search Techniques in REBEL (null-move) from Programmer Corner by Ed Schröder » Rebel
 * A presentation describing the power and flaws in null move pruning: Null Move pruning (pdf) Slides by Lucas Bradstreet
 * Null-move heuristic from Wikipedia
 * Larry Coryell & The Eleventh House - Ain't It Is (Aspects), 1976, YouTube Video
 * feat. Terumasa Hino, Gerry Brown, John Lee, Mike Mandel, and guests ... Michael Brecker, Randy Brecker, James Mtume et al.

=References=

Up one level