The simple fix is replacing -probe_ab(...) with -Tablebases::probe_wdl(pos, success). Very slightly more efficient would be:mcostalba wrote:Code: Select all
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' } }
Code: Select all
pos.do_move(move, st, pos.gives_check(move, ci));
int v = pos.ep_square() == SQ_NONE ? -probe_ab(pos, -2, -wdl + 1, success)
: -Tablebases::probe_wdl(pos, success);
pos.undo_move(move);
if (*success == 0) return 0;
if (v == wdl)
return v == 2 ? 1 : 101;
}
}