Difference between revisions of "Checkmate"

From Chessprogramming wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 105: Line 105:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61134 Mate scores from IID] by [[Matthew R. Brades]], [[CCC]], August 16, 2016 » [[Internal Iterative Deepening]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61134 Mate scores from IID] by [[Matthew R. Brades]], [[CCC]], August 16, 2016 » [[Internal Iterative Deepening]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61731 Why do engines lack mate solving?] by [[Rasmus Althoff]], [[CCC]], October 15, 2016 »  [[Mate Search]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61731 Why do engines lack mate solving?] by [[Rasmus Althoff]], [[CCC]], October 15, 2016 »  [[Mate Search]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=64428 Mate Score] by [[Tamás Kuzmics]], [[CCC]], June 27, 2017
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67049 Mate scores in TT (a new?... approach)] by Vince Sempronio, [[CCC]], April 09, 2018
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67049 Mate scores in TT (a new?... approach)] by Vince Sempronio, [[CCC]], April 09, 2018
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67078 Yet another Mate scores in TT thread] by [[Andrew Grant]], [[CCC]], April 12, 2018 » [[Score]], [[Transposition Table]]
 
* [http://www.talkchess.com/forum/viewtopic.php?t=67078 Yet another Mate scores in TT thread] by [[Andrew Grant]], [[CCC]], April 12, 2018 » [[Score]], [[Transposition Table]]
Line 110: Line 111:
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=68146 A mate suite to test multi-pv and new engines] by [[Uri Blass]], [[CCC]], August 06, 2018
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=68146 A mate suite to test multi-pv and new engines] by [[Uri Blass]], [[CCC]], August 06, 2018
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71337 Trying to find a weird mate in 1...] by [[Martin Bryant]], [[CCC]], July 22, 2019 » [[#FiebergMateInOne|Fieberg's mate-in-1]]
 
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=71337 Trying to find a weird mate in 1...] by [[Martin Bryant]], [[CCC]], July 22, 2019 » [[#FiebergMateInOne|Fieberg's mate-in-1]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74411 Correct way to store and extract mate scores] by Ian Mitchell, [[CCC]], July 08, 2020 » » [[Score]], [[Transposition Table]]
+
==2020 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74411 Correct way to store and extract mate scores] by Ian Mitchell, [[CCC]], July 08, 2020 » [[Score]], [[Transposition Table]]
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=2&t=77834 mate suite for chess engines] by [[Uri Blass]], [[CCC]], July 30, 2021
 
<span id="Leonid"></span>
 
<span id="Leonid"></span>
 
==Leonid's Positions==
 
==Leonid's Positions==

Latest revision as of 20:27, 5 August 2021

Home * Chess * Checkmate

Shannon Larratt - Fool's mate (2007) [1] [2] [3]

Checkmate (often shortened to mate) occurs if a king is under immediate attack by one (or two) opponent pieces (in check) and has no way to remove it from attack on the next move. Checkmate is the object of the game of chess, it ends with the mate giving player as the winner, and the mated player the loser.

Mate Score

At the Root

At the root the score of a mated player is the worst score one can get, that is a negative score with the greatest absolute value of the score range. It is quite common and sufficient to use something like this in C, C++:

#include <limits.h>
/* (-32768/2 = -16384) */
#define VALUE_MATED (SHRT_MIN/2)

Inside a 16-bit short integer range, assuming centipawn evaluation, it translates to roughly being 16 queens down. Note that using SHRT_MIN instead of SHRT_MIN/2 as mate value has issues in greater/less comparisons of additive expressions, where summands around SHRT_MIN or SHRT_MAX may under- or overflow, which has somehow relaxed with the advent of the usual 32-bit sign-extension.

Down the Tree

Inside a negamax based search, most [4] programs assign VALUE_MATED + ply distance to the root as worst case score if entering a node, which if propagated as mate score along the Principal Variation to the root, translates in mate in odd plies (positive values), or getting mated in even plies. However, those scores need ply-adjustment if stored as exact score inside the transposition table, and re-adjustment if retrieving from TT. An alternative approach, not only related to mate scores was proposed by Harm Geert Muller, The Delay Penalty as implemented in Micro-Max [5] [6] [7] [8].

Detecting Mate

Some programs rely on pseudo-legal move generation, and find Checkmate if all those moves are in fact illegal after making and finding the "refutation" of capturing the king. At the latest, if no legal move was found, programs need the information whether the king is in check to decide about checkmate or stalemate score. Despite, most programs (should be) are aware of check in advance, and use special move generator(s) if in check or even in double check:

  1. Double check
    1. Only King moves or captures
  2. Single check
    1. Capture the checking piece
    2. King moves or captures
    3. In case of distant checks, interposing a piece between the threatening sliding piece and the king

See also

Publications

1952

1965 ...

1980 ...

1990 ...

2000 ...

2010 ...

Forum Posts

1997 ...

Re: Using too-shallow mate scores from the hash table by David Eppstein, CCC, July 06, 1998
Re: Using too-shallow mate scores from the hash table by Don Dailey, CCC, July 07, 1998
Is "Interesting mate test..." the longest ever thread.... by Tina Long, CCC, September 11, 1999

2000 ...

2005 ...

2010 ...

2015 ...

2020 ...

Leonid's Positions

Positions by Leonid Liberman

External Links

References

Up one Level