rgoomes wrote:Isn't it easier to just add the depth to my hash table (perft_t struct), like I did above?
But yeah.. now how I use the depth? Can you show me some code?
There are two considerations:
a) the integrity of used zobrist keys in perft demands for a unique behaviour in generating such keys.
If you can secure that by simply adding a number, fine. I instead am using specialized zorbrist atoms
having an equal amount of zero- and one-bits. Adding a depth value to the key also might exceed the
hashing range area.
b) zobrist keys should distribute widely over the hashing area. Simply adding numbers will place them
probably as neighbours. I have a replacement sceme searching within a short range area to the original
key entry, thus your approach there would be performance killing.
I will add no code, because my hashed perft does a lot more. It additionally separates move types:
Code: Select all
XFEN 00: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
+-*--b--c--d--*--f--g--*-+
8 |[r][n][b][q][k][b][n][r]| Compiled on Feb 19 2015
7 |[p][p][p][p][p][p][p][p]| MS Vis.Studio C/C++ 64-Bit Vers. 18.0
6 | ::: ::: ::: :::|
5 |::: ::: ::: ::: | Break, when time >= 250.0 sec
4 | ::: ::: ::: :::|
3 |::: ::: ::: ::: | (run with 4-fold TT hashing)
2 |<P><P><P><P><P><P><P><P>|
1 |<R><N><B><Q><K><B><N><R>|
(w)+-*--b--c--d--*--f--g--*-+
Ply Moves all [x] [ep] all [+] [++] Prom Cstl Time
1: 20 0 0 0 0 0 0 0.00
2: 400 0 0 0 0 0 0 0.00
3: 8902 34 0 12 0 0 0 0.00
4: 197281 1576 0 469 0 0 0 0.01
5: 4865609 82719 258 27351 0 0 0 0.10
6: 119060324 2812008 5248 809099 46 0 0 0.53
7: 3195901860 108329926 319617 33103848 1628 0 883453 6.34
8: 84998978956 3523740106 7187977 968981593 147215 0 23605205 1:29.37
9: 2439530234167 125208536153 319496827 36095901903 6315946 17334376 1784356000 26:11.63