Answers.Body: <p>It does what it was programmed to do.  During any Alpha-Beta pruning, the computer would stop searching and just do nothing.</p>
  <p>In another game, like an RTS, the computer would constantly go through a todo list.
  What should/can I build?
  What should/can I produce?
  How do I defend/attack?
  ...</p>
  <p>Since a chess AI has only one objective, find the best move, there's no point in searching once it's objective if found.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-25T03:10:21.737Z
Answers.Text: This answer seems reasonable, but is easily shown to be nonsense. I copied the position into Scid, equipped with Stockfish, and started the engine. It immediately outputted 127 lines from `1 M1 1.Qh7#  (0.00)` to `127 M1 1.Qh7#  (0.00)`, but then continued to grab as many CPU cycles as it could get (sometimes its CPU usage was literally 100%, as shown in my task manager) until I stopped it. I would also like to know what Stockfish is actually doing here.
Answers.UserDisplayName: Brian Drake
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-25T03:14:05.427Z
Answers.Text: It gets worse! I tried manually playing Qh7# before running Stockfish, and it *still* hogged the CPU until I stopped it!
Answers.UserDisplayName: Brian Drake
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-25T08:05:35.507Z
Answers.Text: With M1 the score shouldn't be 0.  [jk]  Maybe the computer became sentient and is planning how to most efficiently destroy the inferior creatures of its creators.
Answers.UserDisplayName: Mike Jones
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-23T16:34:53.623Z
Answers.LastActivityDate: 2021-03-23T16:34:53.623Z
Answers.UserDisplayName: Mike Jones
Body: <p>For example, take this famous position from Kramnik vs. Deep Fritz, 2005:</p>
  <pre><code>[FEN &quot;5N1k/6p1/7p/4P3/pp2Q3/4q3/1P4PP/2b4K w - - 0 1&quot;]
  </code></pre>
  <p>Obviously White wins with Qh7#, and equally obviously, there are no possible better moves (since it's impossible to have a mate in 0).</p>
  <p>If I let an engine run on this position, what does it do after finding the mate in 1? There's presumably nothing else to do since it has already found <em>the</em> best move. Does it just exit, then?</p>
  <p>I tried running Stockfish 13 on this position, and it reaches depth 99/99 instantly, but I can't tell what it's doing afterwards.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-23T13:51:48.650Z
Comments.Text: I once designed an engine for connect four, and I programmed it that if it found the best possible move, it didn’t keep checking but it immediately stopped.
Comments.UserDisplayName: fartgeek
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-23T22:57:46.020Z
Comments.Text: once stockfish reaches maximum depth it just stops the search
Comments.UserDisplayName: Sopel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-25T03:16:25.037Z
Comments.Text: @Sopel This is an answer, and should be posted as such. It is also incorrect, if 100% CPU usage by Stockfish is any guide. See my comments on the existing answer.
Comments.UserDisplayName: Brian Drake
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-26T01:27:16.900Z
Comments.Text: Related: https://chess.stackexchange.com/q/21479/25131
Comments.UserDisplayName: Brian Drake
Tags: <engines><checkmate>
Title: What does an engine do if it has found the shortest mate?
ThreadText: # What does an engine do if it has found the shortest mate?
  
  (Asked by: username_0 on 2021-03-23)
  
  For example, take this famous position from Kramnik vs. Deep Fritz, 2005:
  
  ```
  [FEN "5N1k/6p1/7p/4P3/pp2Q3/4q3/1P4PP/2b4K w - - 0 1"]
  
  ```
  
  Obviously White wins with Qh7#, and equally obviously, there are no possible better moves (since it's impossible to have a mate in 0).
  
  If I let an engine run on this position, what does it do after finding the mate in 1? There's presumably nothing else to do since it has already found *the* best move. Does it just exit, then?
  
  I tried running Stockfish 13 on this position, and it reaches depth 99/99 instantly, but I can't tell what it's doing afterwards.
  
  **Tags:** engines, checkmate
  
  > **Comments:**
  > **username_1**: I once designed an engine for connect four, and I programmed it that if it found the best possible move, it didn’t keep checking but it immediately stopped.  
  > **username_2**: once stockfish reaches maximum depth it just stops the search  
  > **username_3**: @username_2 This is an answer, and should be posted as such. It is also incorrect, if 100% CPU usage by Stockfish is any guide. See my comments on the existing answer.  
  > **username_3**: Related: https://chess.stackexchange.com/q/21479/25131  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2021-03-23. Score: 4 | Accepted answer
  
  It does what it was programmed to do. During any Alpha-Beta pruning, the computer would stop searching and just do nothing.
  
  In another game, like an RTS, the computer would constantly go through a todo list.
  What should/can I build?
  What should/can I produce?
  How do I defend/attack?
  ...
  
  Since a chess AI has only one objective, find the best move, there's no point in searching once it's objective if found.
  
  > **Comments:**
  > **username_3**: This answer seems reasonable, but is easily shown to be nonsense. I copied the position into Scid, equipped with Stockfish, and started the engine. It immediately outputted 127 lines from `1 M1 1.Qh7#  (0.00)` to `127 M1 1.Qh7#  (0.00)`, but then continued to grab as many CPU cycles as it could get (sometimes its CPU usage was literally 100%, as shown in my task manager) until I stopped it. I would also like to know what Stockfish is actually doing here.  
  > **username_3**: It gets worse! I tried manually playing Qh7# before running Stockfish, and it *still* hogged the CPU until I stopped it!  
  > **username_4**: With M1 the score shouldn't be 0.  [jk]  Maybe the computer became sentient and is planning how to most efficiently destroy the inferior creatures of its creators.  
  
  ---
  
  