World Chess

Sunday, November 18, 2007

Endgame tablebases

Computers have been used to analyze some chess endgame positions completely. Such endgame databases are generated in advance using a form of retrograde analysis, starting with positions where the final result is known (e.g. where one side has been mated) and seeing which other positions are one move away from them, then which are one move from those etc. Ken Thompson, perhaps better known as the key designer of the UNIX operating system, was a pioneer in this area. Endgame play had long been one of the great weaknesses of chess programs because of the depth of search needed, with some otherwise master-level programs being unable to win in positions that even intermediate human players would be able to force a win. The results of the computer analysis sometimes surprised people. In 1977 Thompson's Belle chess machine used the endgame tablebase for a king and rook against king and queen and was able to draw that theoretically lost ending against several masters (see Philidor position#Queen versus rook). This was despite not following the usual strategy to delay defeat by keeping the defending king and rook close together for as long as possible. Asked to explain the reasons behind some of the program's moves, Thompson was unable to do so beyond saying the program's database simply evaluated its moves as best it could. Most grandmasters declined to play against the computer in the queen versus rook endgame, but Walter Browne accepted the challenge. A queen versus rook position was set up in which the queen can win in thirty moves, with perfect play. Browne was allowed 2½ hours to play fifty moves, otherwise a draw would be claimed under the fifty move rule. After forty-five moves, Browne agreed to a draw, being unable to force checkmate or win the rook within the next five moves. In the final position, Browne was still seventeen moves away from checkmate, but not quite that far away from winning the rook. Browne studied the endgame, and played the computer again a week later in a different position in which the queen can win in thirty moves. This time, he captured the rook on the fiftieth move, giving him a winning position (Levy & Newborn 1991:144-48), (Nunn 2002:49). Other positions, long believed to be won, turned out to take more moves against perfect play to actually win than were allowed by chess's fifty move rule. As a consequence, for some years the official laws of chess were changed to extend the number of moves allowed in these endings. After a while, the law reverted back to fifty moves in all positions — more such positions were discovered, complicating the rule still further, and it made no difference in human play, as they could not play the positions perfectly. Over the years, other endgame database formats have been released including the Edward Tablebases, the De Koning Endgame Database (released in 2002) and the Nalimov Endgame Tablebases which is the current standard supported by most chess programs such as Rybka, Shredder or Fritz. All endgames with five or fewer pieces have been analyzed completely. Of endgames with six men all positions have been analyzed except for positions with five pieces against a lone king [7]. Some seven-piece endgames, have been analyzed by Marc Bourzutschky and Yakov Konoval [8]. In all of these endgame databases it is assumed that castling is no longer possible. The databases are generated by storing in memory the values of positions which have been encountered so far, and using these results to lop off the ends of the search trees if they arise again. Although the number of possible games after a number of moves rises exponentially with the number of moves, the number of possible positions with a few pieces is exponential only in the number of pieces — and effectively limited however many end game moves are searched. The simple expediency of remembering the value of all previously reached positions means that the limiting factor in solving end games is simply the amount of memory available in the computer. While computer memory sizes are increasing exponentially, there is no reason why end games of increasing complexity should not continue to be solved. A computer using these databases will, upon reaching a position in them, be able to play perfectly, and immediately determine whether the position is a win, loss or draw, plus the fastest or longest way of getting to that result. Knowledge of whether a position is a win, loss or draw is also helpful in advance since this can help the computer avoid or head towards such positions depending on the situation. Endgame databases featured prominently in 1999, when Kasparov played an exhibition match on the Internet against the Rest of the World. A seven piece Queen and pawn endgame was reached with the World Team fighting to salvage a draw. Eugene Nalimov helped by generating the six piece ending tablebase where both sides had two Queens which was used heavily to aid analysis by both sides.

No comments: