Answers.Body: <p>Software which can answer this question now exists, but has not yet been applied to FIDE-rated tournaments.</p>
  <p>Miguel Ambrona (see <a href="https://chasolver.org/FUN22-full.pdf" rel="nofollow noreferrer">https://chasolver.org/FUN22-full.pdf</a>, presented at a conference in Sicily, Aug-2022) an algorithm to determine position deadness, and has applied it to the corpus of all Lichess games:</p>
  <pre><code>The Lichess Database of standard rated games includes 3,367,175,192 games to date (May 
  2022). We have applied our algorithm from Figure 9 to the final position of all games 
  that ended in a timeout and that were classified as 1-0 or 0-1. In total, 1,067,375,745 
  games (about 32% of all games) were analyzed in about 107 hours of CPU time (359 µs per 
  position  on average). All experiments were performed on a 3.5GHz Intel-Core 
  i9-9900X CPU with 32GB of RAM, running Ubuntu 20.04 LTS.
  
  Our analysis led to identifying a total of 90,546 games that were unfairly classified.
  Namely, games that were lost by the player who ran out of time, but their opponent could 
  not have checkmated them by any possible sequence of legal moves. We refer to Appendix B 
  for some remarkable positions of unfairly classified games; the remaining can be found 
  on the following link (where our tool can also be tried interactively without
  installation): https://chasolver.org.
  
  Our analysis identified all the unfairly classified games in the database. In all other
  games, the tool provided a checkmate sequence for the player who did not run out of time.
  </code></pre>
  <p>Here is one naturally-occurring dead position that lichess mis-classified:</p>
  <pre><code>
  [FEN &quot;8/8/p7/PP6/K7/1R6/1R6/k7 w - - 0 1&quot;]
  
  </code></pre>
  <ol>
  <li>... axb5+ 2. Ka3 (2.Kb4,Kxb5,Rxb5 stalemate) b4+ 3. Ka4,Kxb4,Rxb4 stalemate</li>
  </ol>
  <p>Miguel states:</p>
  <pre><code>We believe that our algorithms are suitable for practical use and in particular chess 
  servers (and chess software) can leverage them to accurately classify games after a 
  timeout, following Article 6.9 of the FIDE Laws of Chess. Furthermore, given the 
  results of Figure 11, chess servers could also apply our tools after every single
  move during games, to terminate games as soon as a dead position is achieved, 
  correctly applying Article 5.2.2.
  </code></pre>
  <p>It is evidently now computationally feasible for a similar exercise to be conducted for databases of FIDE-rated tournament games. One might identify positions which, like the example quoted above, would end just prior to a mandatory capture.</p>
  <p>Miguel separates &quot;dead position&quot; into 2 non-mutually-exclusive cases: &quot;White can't mate&quot; &amp; &quot;Black can't mate&quot;. Each is solved separately under his algorithm, and is useful in isolation because of Law 6.9 concerning time-out.</p>
  <p>His tool successfully solved all positions from the Lichess Database, (either finding a mate, or proving that none could exist). He notes that some artificial positions involving multiple floating bishops might take longer to terminate. Since the algorithm also works for every composition that I tried out with him, including some quite complicated ones, this is probably not a significant limitation.</p>
  <p>This is not entirely unexpected since we know from other work that determining deadness is PSPACE-complete when considered over nxn board, see: <a href="https://arxiv.org/abs/2010.09271" rel="nofollow noreferrer">https://arxiv.org/abs/2010.09271</a>.</p>
  <p>See also the se question linked to in the question, <a href="https://chess.stackexchange.com/questions/21933/when-checkmate-is-impossible-in-a-position?noredirect=1&amp;lq=1">When checkmate is impossible in a position</a>, where Miguel does mention his own work.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T08:08:20.487Z
Answers.Text: Thanks for the citation, that's extremely interesting work. One question: How can determining deadness (in generalized nxn chess) be proven PSPACE-complete without proving hierarchy collapse? Assuredly it's contained in coNP? After all, a state is dead if there does not exist a short mating sequence for white, and also does not exist a short mating sequence for black. Because the players are cooperating to mate, the quantifiers don't alternate. It seems to me that deadness is in coNP, and therefore deadness being PSPACE-complete would prove hierarchy collapse. Am I missing something?
Answers.UserDisplayName: QuestionAskingHuman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T08:18:36.123Z
Answers.Text: Hi, you're very welcome @QuestionAskingHuman. I've engaged with Miguel since I stumbled across his work in early 2022. For the complexity side, which is perhaps a separate issue, I've included an arxiv link to the relevant paper. Would be interested to get your thoughts.
Answers.UserDisplayName: Laska
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T08:23:30.703Z
Answers.Text: Thanks for the follow-up citation! I think I see the difference in assumption: They are assuming that in generalized nxn chess there is no analog to the 75-move rule, so helpmates may be exponentially long, which prevents the polysized witnesses I was alluding to, meaning that it's not in coNP. I assume the argument I made above holds if we give nxn chess the "poly(n)-move rule", setting a length limit on helpmates, but that's not their setting.
Answers.UserDisplayName: QuestionAskingHuman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T08:31:18.540Z
Answers.Text: Yes: if one applied 75M to nxn chess, one would surely need to scale the number 75 suitably! In practice, the rule is ignored for this kind of analysis, as it is in general endgame studies. There are interesting retro compositions which do rely on 50M, and a convention exists to switch on the rule.
Answers.UserDisplayName: Laska
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T07:58:31.923Z
Answers.LastActivityDate: 2022-08-23T09:24:15.150Z
Answers.LastEditDate: 2022-08-23T09:24:15.150Z
Answers.UserDisplayName: Laska
Body: <p>Tom7 <a href="http://tom7.org/chess/longest.pdf" rel="nofollow noreferrer">points out</a> that FIDE article 5.2.b reads:</p>
  <blockquote>
  <p>The game is drawn when a position has arisen in which neither player can
  checkmate the opponent’s king with any series of legal moves. The game is said to
  end in a ‘dead position’. This immediately ends the game, provided that the move
  producing the position was legal.</p>
  </blockquote>
  <p>As Tom7 explains, examine the following position. After white plays Qxd7+ it is <em>immediately</em> the case that no legal sequence of moves can lead to a checkmate. This is true <em>before</em> black recaptures the queen — and therefore, black <em>cannot</em> recapture the queen, as the game is already a 'dead position' by FIDE rule 5.2.b, and the game is already over. Specifically, there is no legal continuation of the game in which either player is mated (helpmated or otherwise), and therefore the game is already over after Qxd7+ (1/2-1/2).</p>
  <pre><code>[FEN &quot;3k4/3q4/8/5Q2/8/2K5/8/8 w - - 0 1&quot;]
  
  1. Qxd7+
  </code></pre>
  <p>This seems to be the pretty clear conclusion of 5.2.b, and I don't see how to escape this. Sure, in practice, players would probably &quot;play&quot; Kxd7 as a convention, even though the game is already over before the invalid recapture.</p>
  <p>But what if this situation arose in tournament?</p>
  <ol>
  <li>White plays Qxd7+.</li>
  <li>White hits the clock — I don't believe this is even necessary, as rule 6.2.a explicitly cites 5.2.b as &quot;completing&quot; a move immediately, due to the game immediately being over, much as it isn't necessary to hit the clock after delivering checkmate.</li>
  <li>Black's flag falls.</li>
  </ol>
  <p>The lay misinterpretation of 5.2.b would be that black's flag fell while white still had a queen, and therefore black loses. But a close reading of 5.2.b and 6.2.a shows that the game was already over the moment the queen was placed next to the king, and black had no obligation to do anything further — just sign the score sheets and get lunch.</p>
  <p>Has this ever come up in a tournament? I realize this is rules-lawyering, but e.g. Firouzja lost to Carlsen due to a possible helpmate, so I assume FIDE has at least some appetite for taking their own rules seriously.</p>
  <p>Note: Closely related questions have been asked on SE, e.g. <a href="https://chess.stackexchange.com/questions/21933/when-checkmate-is-impossible-in-a-position?rq=1">here</a>, linking to resources like: <a href="http://wismuth.com/chess/illegal-moves.html" rel="nofollow noreferrer">http://wismuth.com/chess/illegal-moves.html</a>. My question differs in that I'm asking about an incredibly common position. This sort of endgame occurs all the time, and is technically already dead, while these other questions are asking about &quot;obscure&quot; dead positions with bizarre locked up pawns and bishops and the like — I'm specifically asking about this incredibly common case of forced recaptures like the above, that I think most folks don't realize are already dead.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-23T12:57:21.620Z
Comments.Text: I was in a unrated non-FIDE scholastic tournament where a game got down to bare kings.  One player eventually won.  As recording moves was not required it is not clear what happened, but the players were in agreement so it stood.
Comments.UserDisplayName: Michael West
Tags: <rules><fide><dead-position>
Title: Has a position being a draw under FIDE 5.2.b before a forced recapture ever come up in a tournament?
ThreadText: # Has a position being a draw under FIDE 5.2.b before a forced recapture ever come up in a tournament?
  
  (Asked by: username_0 on 2022-08-22)
  
  Tom7 points out that FIDE article 5.2.b reads:
  
  The game is drawn when a position has arisen in which neither player can
  checkmate the opponent’s king with any series of legal moves. The game is said to
  end in a ‘dead position’. This immediately ends the game, provided that the move
  producing the position was legal.
  
  As Tom7 explains, examine the following position. After white plays Qxd7+ it is immediately the case that no legal sequence of moves can lead to a checkmate. This is true before black recaptures the queen — and therefore, black cannot recapture the queen, as the game is already a 'dead position' by FIDE rule 5.2.b, and the game is already over. Specifically, there is no legal continuation of the game in which either player is mated (helpmated or otherwise), and therefore the game is already over after Qxd7+ (1/2-1/2).
  [FEN "3k4/3q4/8/5Q2/8/2K5/8/8 w - - 0 1"]
  
  1. Qxd7+
  
  This seems to be the pretty clear conclusion of 5.2.b, and I don't see how to escape this. Sure, in practice, players would probably "play" Kxd7 as a convention, even though the game is already over before the invalid recapture.
  But what if this situation arose in tournament?
  
  White plays Qxd7+.
  White hits the clock — I don't believe this is even necessary, as rule 6.2.a explicitly cites 5.2.b as "completing" a move immediately, due to the game immediately being over, much as it isn't necessary to hit the clock after delivering checkmate.
  Black's flag falls.
  
  The lay misinterpretation of 5.2.b would be that black's flag fell while white still had a queen, and therefore black loses. But a close reading of 5.2.b and 6.2.a shows that the game was already over the moment the queen was placed next to the king, and black had no obligation to do anything further — just sign the score sheets and get lunch.
  Has this ever come up in a tournament? I realize this is rules-lawyering, but e.g. Firouzja lost to Carlsen due to a possible helpmate, so I assume FIDE has at least some appetite for taking their own rules seriously.
  Note: Closely related questions have been asked on SE, e.g. here, linking to resources like: http://wismuth.com/chess/illegal-moves.html. My question differs in that I'm asking about an incredibly common position. This sort of endgame occurs all the time, and is technically already dead, while these other questions are asking about "obscure" dead positions with bizarre locked up pawns and bishops and the like — I'm specifically asking about this incredibly common case of forced recaptures like the above, that I think most folks don't realize are already dead.
  
  **Tags:** rules, fide, dead-position
  
  > **Comments:**
  > **username_1**: I was in a unrated non-FIDE scholastic tournament where a game got down to bare kings.  One player eventually won.  As recording moves was not required it is not clear what happened, but the players were in agreement so it stood.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-08-23. Score: 2
  
  Software which can answer this question now exists, but has not yet been applied to FIDE-rated tournaments.
  Miguel Ambrona (see https://chasolver.org/FUN22-full.pdf, presented at a conference in Sicily, Aug-2022) an algorithm to determine position deadness, and has applied it to the corpus of all Lichess games:
  The Lichess Database of standard rated games includes 3,367,175,192 games to date (May 
  2022). We have applied our algorithm from Figure 9 to the final position of all games 
  that ended in a timeout and that were classified as 1-0 or 0-1. In total, 1,067,375,745 
  games (about 32% of all games) were analyzed in about 107 hours of CPU time (359 µs per 
  position  on average). All experiments were performed on a 3.5GHz Intel-Core 
  i9-9900X CPU with 32GB of RAM, running Ubuntu 20.04 LTS.
  
  Our analysis led to identifying a total of 90,546 games that were unfairly classified.
  Namely, games that were lost by the player who ran out of time, but their opponent could 
  not have checkmated them by any possible sequence of legal moves. We refer to Appendix B 
  for some remarkable positions of unfairly classified games; the remaining can be found 
  on the following link (where our tool can also be tried interactively without
  installation): https://chasolver.org.
  
  Our analysis identified all the unfairly classified games in the database. In all other
  games, the tool provided a checkmate sequence for the player who did not run out of time.
  
  Here is one naturally-occurring dead position that lichess mis-classified:
  
  [FEN "8/8/p7/PP6/K7/1R6/1R6/k7 w - - 0 1"]
  
  
  
  ... axb5+ 2. Ka3 (2.Kb4,Kxb5,Rxb5 stalemate) b4+ 3. Ka4,Kxb4,Rxb4 stalemate
  
  Miguel states:
  We believe that our algorithms are suitable for practical use and in particular chess 
  servers (and chess software) can leverage them to accurately classify games after a 
  timeout, following Article 6.9 of the FIDE Laws of Chess. Furthermore, given the 
  results of Figure 11, chess servers could also apply our tools after every single
  move during games, to terminate games as soon as a dead position is achieved, 
  correctly applying Article 5.2.2.
  
  It is evidently now computationally feasible for a similar exercise to be conducted for databases of FIDE-rated tournament games. One might identify positions which, like the example quoted above, would end just prior to a mandatory capture.
  Miguel separates "dead position" into 2 non-mutually-exclusive cases: "White can't mate" & "Black can't mate". Each is solved separately under his algorithm, and is useful in isolation because of Law 6.9 concerning time-out.
  His tool successfully solved all positions from the Lichess Database, (either finding a mate, or proving that none could exist). He notes that some artificial positions involving multiple floating bishops might take longer to terminate. Since the algorithm also works for every composition that I tried out with him, including some quite complicated ones, this is probably not a significant limitation.
  This is not entirely unexpected since we know from other work that determining deadness is PSPACE-complete when considered over nxn board, see: https://arxiv.org/abs/2010.09271.
  See also the se question linked to in the question, When checkmate is impossible in a position, where Miguel does mention his own work.
  
  > **Comments:**
  > **username_0**: Thanks for the citation, that's extremely interesting work. One question: How can determining deadness (in generalized nxn chess) be proven PSPACE-complete without proving hierarchy collapse? Assuredly it's contained in coNP? After all, a state is dead if there does not exist a short mating sequence for white, and also does not exist a short mating sequence for black. Because the players are cooperating to mate, the quantifiers don't alternate. It seems to me that deadness is in coNP, and therefore deadness being PSPACE-complete would prove hierarchy collapse. Am I missing something?  
  > **username_2**: Hi, you're very welcome @username_0. I've engaged with Miguel since I stumbled across his work in early 2022. For the complexity side, which is perhaps a separate issue, I've included an arxiv link to the relevant paper. Would be interested to get your thoughts.  
  > **username_0**: Thanks for the follow-up citation! I think I see the difference in assumption: They are assuming that in generalized nxn chess there is no analog to the 75-move rule, so helpmates may be exponentially long, which prevents the polysized witnesses I was alluding to, meaning that it's not in coNP. I assume the argument I made above holds if we give nxn chess the "poly(n)-move rule", setting a length limit on helpmates, but that's not their setting.  
  > **username_2**: Yes: if one applied 75M to nxn chess, one would surely need to scale the number 75 suitably! In practice, the rule is ignored for this kind of analysis, as it is in general endgame studies. There are interesting retro compositions which do rely on 50M, and a convention exists to switch on the rule.  
  
  ---
  
  