Node counts at a given depth/iteration in search
Posted: Mon May 23, 2011 3:47 am
If an iterative search is merely increasing "depth", then the profile of depths of opened nodes should look the same from one iteration to the next. For instance, in a uniform tree with branching factor 2, there are 50% of the nodes at depth X, 25% at depth X-1, etc., and this doesn't change from one iteration to the next. In perfectly ordered alpha-beta, there will be an odd/even effect. In practise, qsearch will modify this, as will transposition tables, IID, and more.
So I modified IvanHoe to count, for each iteration, the number of nodes opened at each depth. I counted null moves (this is one reason why I chose IvanHoe rather than Stockfish -- though IvanHoe has its own quirks with make_move in PV displays and the "top_analysis" code as opposed to gameplay).
Here are the raw depth counts from a depth 20 search with 256MB in the opening position.
Here are the percentages
Here are the "moving" percentages, though I'd guess some of these are too near the root to be of much value.
It is difficult to extrapolate from one position, and even more data for this one might be useful. One statistical measure is the "average depth" of an opened node, which behaves as
In an ideal iterative depth-based search, this number should go up by 1 at each iteration. So the search at iteration 20 is really not that much "deeper" than that at iteration 19, at least in this example.
I did a few other positions, and the results still seemed to show an "average depth" gain of less than 1 as the iterations increase, though perhaps not as pronounced as above -- in the current TCEC position
"1n4k1/r1b2qp1/1p3p2/4pP1p/2PpN3/P2P2PP/1Q1B4/5RK1 b - - 0 32", I got this:Ideally, one would like to use such "statistical" information on the search profile to determine which nodes to extend, when to use more time, or the like, but that seems to be hard to realise in practise.
So I modified IvanHoe to count, for each iteration, the number of nodes opened at each depth. I counted null moves (this is one reason why I chose IvanHoe rather than Stockfish -- though IvanHoe has its own quirks with make_move in PV displays and the "top_analysis" code as opposed to gameplay).
Here are the raw depth counts from a depth 20 search with 256MB in the opening position.
Code: Select all
Dp Iter16 Iter17 Iter18 Iter19 Iter20
0 45 22 23 43 22
1 209 239 303 249 146
2 1945 1843 1683 2289 1695
3 4901 5343 5121 5262 3204
4 21922 20244 21235 27347 18484
5 34551 39382 67607 63398 45608
6 85012 106860 160548 227442 184654
7 124170 135104 295477 333699 282654
8 169366 221123 410082 644275 608041
9 200970 256798 629915 764217 750276
10 187059 297808 697422 1075935 1023668
11 172671 278312 796728 1134349 1139478
12 145934 258857 738294 1230789 1245559
13 126882 227649 669976 1117824 1150965
14 102301 199457 576971 1000245 1028578
15 78317 174232 487356 844262 836121
16 57867 142300 398086 673770 661877
17 38967 115306 312304 530702 526115
18 26770 89250 236608 384870 384361
19 15806 68309 170661 275103 291216
20 9472 50356 117724 182858 199249
21 5198 33849 79783 119249 141855
22 3207 22429 53499 75284 94702
23 1577 13717 35301 47576 62354
24 891 7679 23937 30325 37694
25 340 3805 15869 19939 23258
26 206 1825 10809 13519 12652
27 64 792 6755 8559 6581
28 31 312 4092 5723 3289
29 7 122 2899 3525 1628
30 2 48 1659 2060 811
31 0 25 1097 1057 343
32 0 1 527 490 133
33 0 0 346 263 49
34 0 0 130 153 15
35 0 0 78 75 3
36 0 0 44 45 1
37 0 0 15 16 1
38 0 0 7 7 1
39 0 0 1 2 0
Code: Select all
Dp Iter16 Iter17 Iter18 Iter19 Iter20
0 0.00 0.00 0.00 0.00 0.00
1 0.01 0.01 0.00 0.00 0.00
2 0.12 0.07 0.02 0.02 0.02
3 0.30 0.19 0.07 0.05 0.03
4 1.36 0.73 0.30 0.25 0.17
5 2.14 1.42 0.96 0.58 0.42
6 5.26 3.85 2.28 2.10 1.71
7 7.68 4.87 4.20 3.08 2.63
8 10.48 7.97 5.83 5.94 5.65
9 12.43 9.26 8.96 7.05 6.97
10 11.57 10.74 9.92 9.92 9.51
11 10.68 10.04 11.33 10.46 10.58
12 9.03 9.33 10.50 11.35 11.57
13 7.85 8.21 9.53 10.31 10.69
14 6.33 7.19 8.21 9.22 9.55
15 4.84 6.28 6.93 7.78 7.77
16 3.58 5.13 5.66 6.21 6.15
17 2.41 4.16 4.44 4.89 4.89
18 1.66 3.22 3.37 3.55 3.57
19 0.98 2.46 2.43 2.54 2.70
20 0.59 1.82 1.67 1.69 1.85
21 0.32 1.22 1.13 1.10 1.32
22 0.20 0.81 0.76 0.69 0.88
23 0.10 0.49 0.50 0.44 0.58
24 0.06 0.28 0.34 0.28 0.35
25 0.02 0.14 0.23 0.18 0.22
26 0.01 0.07 0.15 0.12 0.12
27 0.00 0.03 0.10 0.08 0.06
28 0.00 0.01 0.06 0.05 0.03
29 0.00 0.00 0.04 0.03 0.02
30 0.00 0.00 0.02 0.02 0.01
31 0.00 0.00 0.02 0.01 0.00
32 0.00 0.00 0.01 0.00 0.00
Code: Select all
Iter16 Iter17 Iter18 Iter19 Iter20
X-15 0.01 0.07 0.07 0.25 0.42
X-14 0.12 0.19 0.30 0.58 1.71
X-13 0.30 0.73 0.96 2.10 2.63
X-12 1.36 1.42 2.28 3.08 5.65
X-11 2.14 3.85 4.20 5.94 6.97
X-10 5.26 4.87 5.83 7.05 9.51
X-9 7.68 7.97 8.96 9.92 10.58
X-8 10.48 9.26 9.92 10.46 11.57
X-7 12.43 10.74 11.33 11.35 10.69
X-6 11.57 10.04 10.50 10.31 9.55
X-5 10.68 9.33 9.53 9.22 7.77
X-4 9.03 8.21 8.21 7.78 6.15
X-3 7.85 7.19 6.93 6.21 4.89
X-2 6.33 6.28 5.66 4.89 3.57
X-1 4.84 5.13 4.44 3.55 2.70
X-0 3.58 4.16 3.37 2.54 1.85
X+1 2.41 3.22 2.43 1.69 1.32
X+2 1.66 2.46 1.67 1.10 0.88
X+3 0.98 1.82 1.13 0.69 0.58
X+4 0.59 1.22 0.76 0.44 0.35
X+5 0.32 0.81 0.50 0.28 0.22
Code: Select all
16 10.77
17 12.08
18 12.53
19 12.76
20 12.94
I did a few other positions, and the results still seemed to show an "average depth" gain of less than 1 as the iterations increase, though perhaps not as pronounced as above -- in the current TCEC position
"1n4k1/r1b2qp1/1p3p2/4pP1p/2PpN3/P2P2PP/1Q1B4/5RK1 b - - 0 32", I got this:
Code: Select all
14 8.21
15 11.09
16 11.24
17 10.46
18 11.59
19 13.90
20 14.93
21 15.25
22 15.67