ddugovic / Stockfish

Retired multi-variant fork of popular UCI chess engine; please use Fairy-Stockfish instead
https://github.com/ianfab/Fairy-Stockfish
GNU General Public License v3.0
132 stars 44 forks source link

"TB hash table size too low!" for antichess tablebases #558

Closed thomas-daniels closed 5 years ago

thomas-daniels commented 5 years ago

I'm loading the following tables from https://tablebase.lichess.ovh/tables/antichess/ using the SyzygyPath option:

And Stockfish errors:

TB hash table size too low!

thomas-daniels commented 5 years ago

Did some changes on tbprobe.cpp, with Niklas' assistance.

ddugovic commented 5 years ago

Interesting... I'm trying to duplicate (I don't understand this code particularly well right now so I'm unsure what to ask):

setoption name SyzygyPath value tb
info string Found 145 tablebases
bench giveaway
...
bench
...
thomas-daniels commented 5 years ago

It may not be a problem with only 145 tablebase files, but the full set is 8400...

ddugovic commented 5 years ago

Ah... I've only got 2-3-4-5 tablebase files, so I'll defer to whatever you think is best...

thomas-daniels commented 5 years ago

I have zero clue about the technical details regarding Size and Overflow. All I know is that both of my mentioned changes don't crash, which is equally good in my book, but there's probably a difference...

niklasf commented 5 years ago

Putting more than 256 elements into the last hash bucket is a lot. So short of changing the hashtable implementation, I'd recommend going with Size << 15. There will be a minor cost for Syzygy lookups in other variants, because the larger table will be less cache efficient.

ddugovic commented 5 years ago

OK, a minor cost sounds tolerable (tablebases are quite useful); the first Sygyzy lookup is costly anyway (although reads from disk are much faster than solving endgames).

niklasf commented 5 years ago

Looking at the history, we had an even larger hashTable in the past (166bf90e4172b77aa0c420ed271fa55e92301a70). Proposed fix: #559.