Dirt wrote:hgm wrote:What bitbases could be responsible for such a large effect? f the 3+1, KBNK is the only one that Joker might bungle.
And of course Joker could be induced by a bitbase to trade down from a position it could easily win by knowing that KBNK is a sure win.
The difficulty of winning KBNK is a myth. It is extremely easy for a computer program to mate with bishop and knight. All you need is a piece square table for driving the king to the right corner, and a very shallow search. Here is my entire KBN vs K evaluation function, with a few little irrelevant details removed in the interest of brevity:
Code: Select all
const int DistanceBonus[8] = {0, 0, 100, 80, 60, 40, 20, 10};
const uint8_t KBNKMateTable[64] = {
200, 190, 180, 170, 160, 150, 140, 130,
190, 180, 170, 160, 150, 140, 130, 140,
180, 170, 155, 140, 140, 125, 140, 150,
170, 160, 140, 120, 110, 140, 150, 160,
160, 150, 140, 110, 120, 140, 160, 170,
150, 140, 125, 140, 140, 155, 170, 180,
140, 130, 140, 150, 160, 170, 180, 190,
130, 140, 150, 160, 170, 180, 190, 200
};
Value KBNKEvaluationFunction::apply(const Position &pos) {
Square winnerKSq = pos.king_square(strongerSide);
Square loserKSq = pos.king_square(weakerSide);
Square bishopSquare = pos.bishop_list(strongerSide, 0);
if(square_color(bishopSquare) == BLACK) {
winnerKSq = flop_square(winnerKSq);
loserKSq = flop_square(loserKSq);
}
Value result =
VALUE_KNOWN_WIN + DistanceBonus[square_distance(winnerKSq, loserKSq)] +
KBNKMateTable[loserKSq];
return (strongerSide == pos.side_to_move())? result : -result;
}
IIRC, a six ply search was sufficient to win against tablebase defence with this very simple evaluation. A six-ply search with so little material left is, of course, practically instant. Winning a game with less than five seconds left on the clock is easy.
Tord