lucasart wrote:Isn't it enough to just use probe_wdl() in the search (excluding QS) ?
You have to do something special once the game has reached a tablebase position. Otherwise all won positions look the same and the search will often not make progress.
So one option is to simply stop probing once the root position has 6 (or 5) pieces or less.
Another option is to use root_probe(), but for this the DTZ tables need to be present. This function filters out moves that would lose half a point or more (taking into account the 50-move rule).
There is now a fallback for when DTZ tables are not present: root_probe_wdl(). This also filters out bad moves, but it cannot guarantee progress. If this fallback is used, I let the search do probes for positions that have one piece less than what is currently on the board.
Other schemes are of course possible.
- it might be a good idea to selectively use probe_wdl() in the qsearch, e.g. for material configurations that are known to be difficult to get right in the evaluation. And it might be a good idea not to probe near the leaves in the regular search for material configurations that are known to be easy to get right in the evaluation.
- there is a choice for what to do with won/lost positions that are drawn under the 50-move rule (probe_wdl() returns values -2, -1, 0, 1, 2). You could choose to ignore the 50-move rule and just regard those as won/lost. Or you can use the fact that the engine knows how to keep a draw and is rather likely to win within 50 moves those winning positions that are drawn under the 50-move rule. (If you don't want to use DTZ tables, you probably want to ignore the 50-move rule).
Is there a non trivial gain (elo-wise) in the root_probe() stuff ?
If you don't take any special measures when the root position is in the tablebases, this will definitely affect Elo because the engine will draw positions that are won. The Elo gained by having the DTZ tables around is likely to be very small, though. (I have considered only having DTZ tables for tablebases with non-trivial wins, i.e. where probe_wdl() might not make sufficient progress or where the 50-move rule may come into play, but in the end I did not see much reason for that. The 6-piece DTZ tables are only a bit larger than the WDL tables (for 7-piece they might even be smaller) and they can be stored on almost arbitrarily slow drives without loss of performance.)