pos.do_move(move, st, pos.gives_check(move, ci));
int v = -probe_ab(pos, -2, -wdl + 1, success); <------------- This is wrong
pos.undo_move(move);
if (*success == 0) return 0;
if (v == wdl)
return v == 2 ? 1 : 101; <---------------- Here we immediately return '1'
}
}
The simple fix is replacing -probe_ab(...) with -Tablebases::probe_wdl(pos, success). Very slightly more efficient would be:
mcostalba wrote:The point is that DTZ files store a "don't care" value also in case the only possible legal moves are captures.
This is not correct.
The DTZ tables store a don't care only in case:
- the position is a draw, or
- the position is a win or cursed win with dtz = 1 (or dtz = 101).
In the latter case there will be a (cursed) winning capture or pawn move.
Not even losing mate positions are stored as don't care.
The position you were looking at is in the "missing" side of the DTZ table. So the 1-ply probing round must somehow have gone wrong.