Unfortunately not everything works as I expected.
One of my tests to check the correctness of TT is the following:
1) Search at fixed depth (above the search output)
Code: Select all
DEPTH SCORE TIME NODES MOVE
1 50 0 41 b1c3
2 0 0 193 b1c3
3 50 0 1082 b1c3
4 0 0 2661 b1c3
5 40 0 22289 b1c3
6 0 1 32851 b1c3
7 35 9 352978 e2e4
8 0 5 407536 e2e4
9 30 17 1449283 e2e4
10 20 65 4886609 e2e4
3) Unmake the move
4) Search again at the same depth
Code: Select all
DEPTH SCORE TIME NODES MOVE
1 20 0 1 e2e4
2 20 0 1 e2e4
3 20 0 1 e2e4
4 20 0 1 e2e4
5 20 0 1 e2e4
6 20 0 1 e2e4
7 20 0 1 e2e4
8 20 0 1 e2e4
9 20 0 1 e2e4
10 20 0 1 e2e4
Now my doubts are quite simple to explain. In my scenario:
1) Search at fixed depth (same results posted above)
2) Search the opponent move.
Code: Select all
DEPTH SCORE TIME NODES MOVE
1 -20 0 1 b8c6
2 -20 0 1 b8c6
3 -20 0 1 b8c6
4 -20 0 1 b8c6
5 -20 0 1 b8c6
6 -20 0 1 b8c6
7 -20 0 1 b8c6
8 -20 0 1 b8c6
9 -20 0 1 b8c6
10 -20 175 12761647 e7e5
This is, I guess, because benefits of iterative deepening are lost (in my case my history / killer tables aren't filled at all).
To prove I'm right I've cleared the TT after the first search, and, as expected, visited nodes are much less (also SUM (nodes) < 12761647).
Code: Select all
DEPTH SCORE TIME NODES MOVE
1 10 0 45 b8c6
2 -40 0 184 b8c6
3 10 0 1115 b8c6
4 -35 0 6140 g8f6
5 0 0 30924 e7e5
6 -35 1 151873 d7d5
7 0 8 660983 e7e5
8 -30 18 1409089 e7e5
9 -20 41 3310374 e7e5
10 -20 55 4001236 e7e5
I'm used to clear history and killer tables before every new search call.
With some adjustments I think I can reuse such tables in the next search to achieve early cut-off, but I'm not sure I'm following the "right way" to do things.
Thanks for any reply,
Luca