mcostalba wrote:After one year I return at my attempt with Tablebases in Stockfish. My taget is still the same, to make TB to look more natural, without strange scores, hiding mates and unnatural sacrifices...but keeping same ELO level of current implementation.
This year I am trying a much more conservative approach.
Code: Select all
Currently TB are probed just after TT and in case probe succeeds we immediately return with the (odd) TB score. This proposal is to return immediately only in case of lose or draw position, but keep searching at much reduced depth in case of a winning position. Moreover disable further TB probing in the sub-tree below that node.
I'm not sure it is helpful to treat TB wins and TB losses differently in the middle of the tree (unless you are talking about win/loss relative to the root position). It should not matter whether a TB position is entered by a capture by the winning side (in which case the TB probe returns a TB loss) or by a (re)capture by the losing side (in which case the TB probe returns a TB win).
If the TB win or TB loss is outside (alpha, beta), it would seem to make sense to immediately return alpha or beta. (Perhaps it is possible to treat a TB win/loss as, say, a score of +10/-10. So alpha or beta (or maybe +10 or -10) would be returned immediately if TB win and beta < 10 or TB loss and alpha > -10.)
What value to return if SF continues to search the subtree but does not find a mate score? Returning the score of the subtree would make SF blind to the TB win or TB loss. Returning a TB win/loss value would make sure that SF does not miss the TB win or loss. If it is desired to prevent all "unnatural play", then perhaps it would work to return the same +10 or -10 value.
Differently from Ronald idea, in my proposal we keep searching but at much reduced depth and we don't override the search score with the TB one.
Not overriding the search score and at the same time reducing the search depth seems like a very bad idea.
Suppose the search reaches a KRPPvKR ending. The TB probe shows that it is winning. Now you let SF search the KRPPvKR subtree at reduced depth, making it highly unlikely that SF will figure out that the position is winning, and then you return the value of that reduced search (probably drawish) even though it is 100% certain that SF would be able to convert the position. How is that a good idea?
In my proposal, SF would continue to search if the TB win (or loss) value is outside the (alpha, beta) window. If the search of the subtree returns a mate score, then that score is returned. If not, then the TB win (or loss) value is returned.
My proposal should eliminate "unnatural play" like an unnecessary queen sac to get into a winning TB position if the search has sufficient time to figure out that avoiding the queen sac also leads to mate. (Arguably, if SF is unable to see that keeping its queen also wins, then saccing the queen is the right thing to do, whether some people might consider the move unnatural or not.)
Nevertheless, if such queen sacs must be removed whatever it takes, then it might work to set the vaue of a TB win/loss to, say, +10/-10. (This might still cause SF to fail to convert a winning position, but it should be rare.)