Depth

Home * Search * Depth



Depth is the height or nominal depth in plies between the root and so called horizon nodes (depth 0), where a heuristic value is assigned to. Thus, depth is the number of half moves the search nominally looks ahead.

Despite quiescence search, where usually winning captures and even some checks are tried at or behind the search horizon, until positions become sufficiently quite, selectivity of modern chess programs, caused by extensions, pruning and reductions, notably check extensions, nNMP and LMR, leads to bushy, non-uniform trees where some branches are searched deeper than nominal, but others shallower. A depth reduction R of multiple plies is often performed in forward pruning techniques like null move pruning and multi-cut.

=Draft versus Ply-Index= Most likely inside the search routine, a ply-index is used to index stacks or arrays with pre-saved search information. This index is initialized with zero at the root, and is then incremented after making a move each time the recursive search is called. This index measures the ply-distance from the current node to the root and would therefor be sufficient to determine the remaining depth to the horizon, also called draft: draft ::= depth at the root - ply index However, there are various reasons to decouple the depth to horizon from the ply-index or depth from root, which are often passed as independent parameters to a recursive search routine (see code below). While the ply-index is incremented by one each time, the draft may be independently altered by various extension- or reduction-schemes and may also consider fractional extensions. =Fractional Plies= Some programs extend or reduce in fractions of one ply. Inside an iterative deepening framework, the search depth is incremented, usually by one ply - or by a fraction of one ply, for instance 1/2 ply.

Amir Ban on Junior in rgcc, March 1998 : The brute-force ply depth is indeed half the publicized depth. All the rest are extensions (in conventional terminology, I don't think of them this way). If you set Junior to depth 12, e.g., then you should be able to find a 7-ply combination where it fails. If I am doing a good job, then you should have a hard time finding one.

The question of what this is equivalent to in terms of other programs, e.g. a null-mover with "standard" extensions is interesting, but I don't know the answer. In tournament conditions middlegame Junior typically gets 14-16 depths, and it looks competitive tactically.

=Depth Comparison of different programs= Due to different implementations, the reported search depth of chess programs is not comparable in general. Programs like The King (Chessmaster), Junior and Rybka are known for interpreting depth differently for whatever reasons.

=Selective Search Depth= Some programs also report a selective search depth beside the nominal search depth, most often much greater than the nominal search depth. Some programs determine the highest distance to the root at any node, others only at the horizon.

int highestDepth;

int iterativeDeepening { ...  highestDepth = 0; for (depth = 0; depth <= maxdepth; depth += DEPTH_OF_ONE_PLY) { score = abSearch( -oo, +oo, depth, 0 ); if (timeIsOver (...) ) break; }  ... }

int abSearch( int alpha, int beta, int depth, int ply ) { depth += determineExtensions(...); depth -= determineReductions(...); if( depth <= 0 ) return quiesce( alpha, beta ); if ( ply > highestDepth ) highestDepth = ply;

for ( all moves) { score = -abSearch( -beta, -alpha, depth - DEPTH_OF_ONE_PLY, ply + 1 ); if( score >= beta ) return beta;  // beta cutoff if( score > alpha ) alpha = score; // alpha acts like max in MiniMax }  return alpha; } =Maximum Search Depth= The Maximum Search Depth of a depth-first search is usually determined by a compile time constant in ply units (MAX_PLAY). It is used to statically allocate arrays like a Triangular PV-Table, or search stacks inside the programs data- or bss segment. While 64 was quite common, todays programs tend to use higher values, e.g. 128. A search routine should nevertheless check the upper bound of the search stack to immediate return a lazy evaluation score or material balance when the ply index threatens overflow. =Diminishing Returns= Despite the existence of pathology in searching some trees, where a deeper minimax search results in worse play, it is quite consensus in Chess that deeper search yields in stronger play. Strength improvement from depth d to depth d+1 was first systematically examined by Ken Thompson with Belle in Computer Chess Strength, as introduced at the Advances in Computer Chess 3 conference in 1981. Thompson found Belle (n+1) scored about 80% versus Belle (n), which roughly translates to a 200 Elo improvement playing one ply deeper, while the improvement seemed constant independent from the used depths from 3 to 8, while a second experiment indicated a falloff beyond depth 7.

Also, in other board games such as Othello and Checkers, additional plies of search translated into decreasing benefits, giving rise to Diminishing returns for deeper searching. In their 1997 paper Diminishing Returns for Additional Search in Chess, Junghanns, Schaeffer, Brockington, Björnsson and Marsland conclude the existence of Diminishing returns in Chess as well, somehow hidden by the high percentage of errors made by chess programs for lower search depth.

In self-play experiments with Crafty, Robert Hyatt, Monroe Newborn and later Ernst A. Heinz with DarkThought steadily discovered new best moves while searching deeper. In further experiments, Heinz found indications of decreasing returns from increasing search in chess. In his 2001 ICGA Journal paper Self-Play, Deep Search and Diminishing Returns he gave following match results (3,000 games each) :


 * 12-ply was 84 Elo points better than 11 ply
 * 11-ply was 92 Elo points better than 10 ply
 * 10-ply was 115 Elo points better than 9 ply

Tony van Roon-Werten made following statement on Diminishing Returns : If two programs play with 5 vs 6 ply search, the second engine has a 20% depth advantage. With 10 vs 11 it's only 10%. So of course the difference in wins is smaller. ...

Diminishing returns are only proven (IMO) if 6 vs 5 wins more games than 12 vs 10 because only then are you comparing something linear and you give a linear advantage.

Ed Schröder conducted self-play experiments with ProDeo 1.74 playing different depths. Schröder also suggests that ProDeo has a branching-factor of roughly 2, in other words an additional ply corresponds to a doubling of time. In the following table the values indicate the Elo advantage of ProDeo playing with depth A against itself with depth B. The exact tournament conditions can be studied on his webpage.

=See also=
 * Alpha-Beta Conspiracy Search
 * Fractional Extensions
 * Iterative Deepening
 * Knowledge | Search versus Evaluation
 * Match Statistics
 * Odd-Even Effect
 * Playing Strength
 * Ply
 * Search Pathology
 * Selectivity
 * SEX Algorithm
 * The Technology Curve

=Publications=

1978 ...

 * James Gillogly (1978). Performance Analysis of the Technology Chess Program. Ph.D. Thesis. Tech. Report CMU-CS-78-189, Carnegie Mellon University

1980 ...

 * Ken Thompson (1982). Computer Chess Strength. Advances in Computer Chess 3
 * Joe Condon, Ken Thompson (1983). BELLE. Chess Skill in Man and Machine
 * Dana S. Nau (1983). Decision quality as a function of search depth on game trees. Journal of the ACM, Vol. 30, No. 4
 * Hermann Kaindl (1983). Searching to Variable Depth in Computer Chess. Proceedings of IJCAI 83, pp. 760-762. Karlsruhe. pdf
 * Monroe Newborn (1985). A Hypothesis Concerning the Strength of Chess Programs. ICCA Journal, Vol. 8, No. 4
 * Alexander Szabo, Barbara Szabo (1988). The Technology Curve Revisited. ICCA Journal, Vol. 11, No. 1
 * David Levy, David Broughton, Mark Taylor (1989). The SEX Algorithm in Computer Chess. ICCA Journal, Vol. 12, No. 1

1990 ...

 * David McAllester, Deniz Yuret (1993). Alpha-Beta Conspiracy Search. ps (draft) » Alpha-Beta Conspiracy Search
 * Robert Hyatt, Monroe Newborn (1997). CRAFTY Goes Deep. ICCA Journal, Vol. 20, No. 2
 * Andreas Junghanns, Jonathan Schaeffer, Mark Brockington, Yngvi Björnsson, Tony Marsland (1997). Diminishing Returns for Additional Search in Chess. Advances in Computer Chess 8, pdf
 * Ernst A. Heinz (1998). DarkThought Goes Deep. ICCA Journal, Vol. 21, No. 4

2000 ...

 * Ernst A. Heinz (2000). A New Self-Play Experiment in Computer Chess. Massachusetts Institute of Technology, Laboratory of Computer Science, Technical Memo No. 608, zipped ps, pdf
 * Ernst A. Heinz (2000). New Self-Play Results in Computer Chess. CG 2000
 * Ernst A. Heinz (2001). Self-play Experiments in Computer Chess Revisited. Advances in Computer Games 9
 * Ernst A. Heinz (2001). Modeling the “Go Deep” Behaviour of CRAFTY and DARK THOUGHT. Advances in Computer Games 9
 * Ernst A. Heinz (2001). Self-Play, Deep Search and Diminishing Returns. ICGA Journal, Vol. 24, No. 2
 * David Levy (2002). SOME COMMENTS ON REALIZATION PROBABILITIES AND THE SEX ALGORITHM. ICGA Journal, Vol. 25, No. 3
 * Ernst A. Heinz (2003). Follow-Up on Self-Play, Deep Search, and Diminishing Returns. ICGA Journal, Vol. 26, No. 2
 * Jonathan Schaeffer (2004). 8. Search Depth. in AI- and Search, Online Course, slides as pdf
 * Jan Renze Steenhuisen (2005). New Results in Deep-Search Behaviour. ICGA Journal, Vol. 28, No. 4, CiteSeerX
 * Matej Guid, Ivan Bratko (2007). Factors affecting diminishing returns for searching deeper. CGW 2007 » Crafty, Rybka, Shredder, Diminishing Returns
 * Matej Guid, Ivan Bratko (2007). Factors affecting diminishing returns for searching deeper. ICGA Journal, Vol. 30, No. 2, pdf

2010 ...

 * Diogo R. Ferreira (2013). The Impact of the Search Depth on Chess Playing Strength. ICGA Journal, Vol. 36, No. 2
 * Tamal T. Biswas, Kenneth W. Regan (2015). Quantifying Depth and Complexity of Thinking and Knowledge. ICAART 2015, pdf
 * Tamal T. Biswas, Kenneth W. Regan (2015). Measuring Level-K Reasoning, Satisficing, and Human Error in Game-Play Data. IEEE ICMLA 2015, pdf preprint
 * Matej Guid, Ivan Bratko (2017). Influence of Search Depth on Position Evaluation. Advances in Computer Games 15

=Postings=

1983 ...

 * chess strength by Ken Thompson, net.chess, January 7, 1982

1996 ...

 * Fractional depth increments by S. Read, rgcc, January 18, 1996
 * Diminishing Returns in Search by Jouni Uski, rgcc, September 6, 1996
 * HIARCS 5 Maximum Search Depth by Kevin Miller, rgcc, January 7, 1997
 * Ply depth (was: Deep Blue) by Moritz Berger, rgcc, February 18, 1997
 * Suggested chess experiment by Henri H. Arsenault, rgcc, February 17, 1999

2000 ...

 * diminishing returns w/ increased search depth? by Peter Kappler, CCC, January 27, 2000
 * A New Self-Play Experiment - Diminishing Returns Shown with 95% Conf. by Ernst A. Heinz, CCC, May 24, 2000 » Diminishing Returns
 * Faster, deeper and more of such... by Ed Schröder, CCC, September 14, 2000 » Search Statistics
 * ICGA_J (June) self-play information by Guy Haworth, CCC, September 05, 2001
 * About diminishing returns (Uri) by Jouni Uski, CCC, November 22, 2001
 * The probability to find better move is simply irrelevant for diminishing returns by Uri Blass, CCC, February 09, 2002
 * The law of diminishing returns by Ed Schröder, CCC, July 12, 2002
 * Regarding Qsearch with Fractional ply extensions by Federico Corigliano, CCC, August 11, 2003 » Quiescence Search
 * In chess we will reach diminishing returns just like in Checkers 1994 by Jorge Pichard, CCC, October 29, 2003
 * diminishing returns by Duncan Roberts, CCC, January 30, 2004
 * Shredder 8 secret: search depth? by Jouni Uski, CCC, March 23, 2004
 * Re: Shredder 8 secret: search depth? by Vasik Rajlich, CCC, March 23, 2004 » Shredder, Junior, Fritz


 * Diminishing returns by Tony Werten, CCC, April 29, 2004
 * Diminishing returns of increasing search depth by Jarkko, CCC, July 18, 2009

2010 ...

 * Node counts at a given depth/iteration in search by BB+, OpenChess Forum, May 23, 2011
 * Counting depth as a function of number of legal moves by Pio Korinth, CCC, February 28, 2012
 * Elo versus speed by Peter Österlund, CCC, April 02, 2012
 * From 5 ply to 6.... by Fernando Villegas, CCC, May 06, 2012
 * Elo Increase per Doubling by Adam Hair, CCC, May 07, 2012
 * Diminishing returns in fixed depth testing revisited by Jesús Muñoz, CCC, August 25, 2012
 * Houdini 3-Houdini 3: Nutzen der Bedenkzeitverlängerung by Patrick Götz, CSS-Forum, December 07, 2012 (German) » Houdini
 * Elo points gain from doubling time by Kai Laskos, CCC, December 10, 2012 » Komodo
 * Scaling at 2x nodes (or doubling time control). by Kai Laskos, CCC, July 23, 2013 » Houdini, Knowledge, Diminishing Returns
 * Time to depth measuring tool by Peter Österlund, CCC, July 28, 2013 » Parallel Search
 * Stockfish depth vs. others; challenge by Larry Kaufman, CCC, November 24, 2013 » Stockfish
 * How many plies are searched in a typical chess program? by Stephen Dause, CCC, November 09, 2014

2015 ...

 * Fractional plies and transposition tables by Alexandru Mosoi, CCC, April 18, 2015 » Depth - Fractional Plies, Transposition Table
 * Doubling of time control by Andreas Strangmüller, CCC, October 21, 2016 » Doubling TC, Diminishing Returns, Playing Strength, Komodo
 * Stockfish 8 - Double time control vs. 2 threads by Andreas Strangmüller, CCC, November 15, 2016 » Doubling TC, Diminishing Returns, Playing Strength, Stockfish
 * Diminishing returns and hyperthreading by Kai Laskos, CCC, December 27, 2016 » Diminishing Returns, Match Statistics, Playing Strength, Thread
 * Ridiculous QSearch Depth by Jonathan Rosenthal, CCC, March 03, 2017 » Quiescence Search
 * Depth reduced but ELO increased by Tom King, CCC, March 16, 2019 » Countermove Heuristic, Playing Strength

=External Links=
 * Depth from Wikipedia
 * Depth-limited search from Wikipedia
 * Diminishing returns from Wikipedia
 * Draft (disambiguation) from Wikipedia
 * Depth of Satisficing by Ken Regan, Gödel's Lost Letter and P=NP, October 06, 2015 » Depth, Match Statistics, Pawn Advantage, Win Percentage, and Elo, Stockfish, Komodo
 * Roy Hargrove Quintet - Depth, Newport Jazz Festival, August 11, 2001, YouTube Video

=References= Up one Level