|
|
|
|
|
by mtlmtlmtlmtl
1454 days ago
|
|
I recommend anyone who's interested in this topic, or in data structures and optimisation, to pick apart Stockfish' transposition table implementation[0,1]. It's essentially a highly customised hash table. It has to handle multiple threads reading and replacing entries, with no locking. It can't grow dynamically, and so it has to "age out" entries. Think of it like hash table implementation with the difficulty set to brutal. You can't grow dynamically(too many entries). You can't store the key, since it'll almost double the size of each entry. You can't use locks. Lookup times need to be practically constant time. [0]: https://github.com/official-stockfish/Stockfish/blob/master/... [1]: https://github.com/official-stockfish/Stockfish/blob/master/... |
|