3

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.

4
  • 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.
    – fartgeek
    Mar 23, 2021 at 13:51
  • 1
    once stockfish reaches maximum depth it just stops the search
    – Sopel
    Mar 23, 2021 at 22:57
  • @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. Mar 25, 2021 at 3:16
  • Related: chess.stackexchange.com/q/21479/25131 Mar 26, 2021 at 1:27

1 Answer 1

4

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.

3
  • 1
    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. Mar 25, 2021 at 3:10
  • It gets worse! I tried manually playing Qh7# before running Stockfish, and it still hogged the CPU until I stopped it! Mar 25, 2021 at 3:14
  • 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.
    – Mike Jones
    Mar 25, 2021 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.