Answers.Body: <p>I am trying this with Houdini 1.5 (the free version). At first 15...Bf2 doesn't show up in the top 5 moves, then when it reaches depth 15, it does, as #1. Takes about 19 seconds on my four year old computer, not that long.</p>
  
  <p>So it doesn't fail to spot it, instead it only considers it the best move once depth 15 is reached. Apparently, as long as it only looks 14 ply deep, other moves are better (like the also winning 15...f5+).</p>
  
  <p>Apparently 15...Bf2 is a mate in 8, which is 15 ply (8 moves by black, 7 by white). But at first it just considers it +10 or so, then +20, then mate in 10, then mate in 8.</p>
  
  <p>The mate in 8 line is:</p>
  
  <pre><code>[FEN ""]
  
  1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Ng4 5. h3 h5 6. hxg4 hxg4 7. Bxc6 gxf3 8. Qxf3 Qh4 9. Qh3 Qxh3 10. gxh3 dxc6 11. Re1 Bxh3 12. f3 Bc5+ 13. Kh2 Bf1+ 14. Kg3 Rh3+
  15.Kg4 Bf2 16.Rxf1 Rh4+ 17.Kg5 Ke7 18.Rh1 Rxh1 19.Nc3 Rah8 20.Nd5+ cxd5 21.d3 R8h5+ 22.Kg4 R1h4#.
  </code></pre>
  
  <p>Clearly when Houdini 1.5 thinks 15 ply deep, it doesn't consider <em>all</em> possible lines that are 15 ply deep, or it would see the mate in 8 the moment it finished its 15-ply-depth search.</p>
  
  <p>I think that is because of <em>pruning</em>, it stops looking at some lines when it thinks they aren't promising enough. That way, it can spend more time on the promising lines, and the programmer thinks that the pros outweigh the cons. But I don't have an answer right now on what it decides to prune here (it probably makes millions of separate pruning decision at depth 15).</p>
  
  <p>It may have to do with the silent moves ...Ke7, and ...Rah8, two non-check non-captures in a line where black is a piece down. It's likely that it decides somewhere that it's not useful to keep looking in this line. Only later, when it does continue the line and finds the mate at the end do other lines that prolong the game (with 18.Rh1 Rxh1 and so on) then show up.</p>
  
  <p>Anyway, it's known that it doesn't work that well to let a computer think for a few seconds only if you want to get to the bottom of something, a few minutes is better.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-18T20:46:03.733Z
Answers.Text: Note that "15 ply" means it's looked at _some moves_ to depth 15, not _all moves_.  That would take _waay_ longer than 4 seconds, even on a super-computer.
Answers.UserDisplayName: BlueRaja - Danny Pflughoeft
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-02-07T01:41:16.403Z
Answers.Text: My guess as to why it prunes, is because 16. Rxf1 looks "heuristically" not that great- white's king is out in the open, but there's no immediate checkmate and black is down a knight for a pawn in material. It is not until deeper analysis happens (as you said) that the value of this "sacrifice" becomes clear.
Answers.UserDisplayName: Joe K
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-02-06T10:22:30.127Z
Answers.LastActivityDate: 2013-02-06T10:22:30.127Z
Answers.UserDisplayName: RemcoGerlich
Answers.Body: <p>after reading all answers and other sources, I now understand that they don't 'miss' or chose to miss these moves, the humans programmed them in such way that they follow a specific pattern on (where/how/when + to) search and more importantly when to pause search and look into more promising lines in order to save resources.</p>
  
  <p>But given enough time, a computer will fin every possible combination on a certain depth.</p>
  
  <p><strong>TL;DR</strong></p>
  
  <ul>
  <li>Q1: they never miss moves, they just haven't found them yet</li>
  <li>Q2: they take time because they are programmed to save resources and they will prioritize some lines over other ones (e.g the ones that don't have passive moves or don't recover material in the next few moves).</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-05-17T20:54:55.687Z
Answers.LastActivityDate: 2013-05-17T20:54:55.687Z
Answers.UserDisplayName: ajax333221
Answers.Body: <p>I think everyone is missing a much quicker mate.  When checking the position with Houdini 3, black actually has mate in 3 on move 13.  Instead of Bf1+, black should've played Bf2, and it contines with 14. d3  bf1+ 15. Bh6  Rxh6#.  So, in a unusual answer to your question, maybe certain engines didn't see your move right away, but, in the case of Houdini 3, it found a much quicker mate.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-19T05:41:35.157Z
Answers.Text: If you read the entire question you will see that he is aware of the mate in 3. All reasonably new engines will find the mate in 3 immediately, and it is not a part of what is asked here.
Answers.UserDisplayName: Halvard
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-07-19T02:24:58.747Z
Answers.LastActivityDate: 2013-07-19T02:24:58.747Z
Answers.UserDisplayName: Randy
Answers.Body: <blockquote>
    <p>Why do chess engines fail to spot good moves in some positions?</p>
  </blockquote>
  
  <p>The reason are called forward pruning techniques (see <a href="http://chessprogramming.wikispaces.com/Pruning">http://chessprogramming.wikispaces.com/Pruning</a>)
  with ProbCut in first line.</p>
  
  <p>The move 15...Bf2 is pruned on shallow deeps because it includes the sacrifice 16.Rxf1 without regaining something concrete with evidence immediately after.
  The matenet is also hard to see, because it includes some further 'silent' move
  as for example 17...Ke7, and yes also engines, not only humans have difficulties to see distant silent moves as they are often pruned.</p>
  
  <p>In this concrete case you even cannot say, that engines fail to spot good moves,
  because also the continuation 15...Rh3h1 is a very good move and leads to an absolutely won position.</p>
  
  <p>Last but not least you have to remember, that an engine's strength is always measured in terms of elo-strengh and not in the ability to find the absolute shortest way to win.
  It does not matter, if a engine wins in 8 moves or in 25 moves.
  Seeking to much for the shortest win, would mean a waste time, because most time there does not exist such a secret good move at all. And waste of time would hurt the engines ELO-Rating.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-01T20:01:11.900Z
Answers.Text: Nice answer overall. +1 for *"Last but not least you have to remember, that an engine's strength is always measured in terms of elo-strengh and not in the ability to find the absolute shortest way to win"*
Answers.UserDisplayName: ferit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-12T00:24:40.497Z
Answers.Text: Excellent answer.
Answers.UserDisplayName: Xonatron
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-05-13T13:45:15.823Z
Answers.Text: Nice answer, welcome to the site!
Answers.UserDisplayName: Andrew
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-05-17T07:06:26.417Z
Answers.Text: +1 for mentioning the trade-off between pruned and full search.  I'm not in the least surprised that a 13+ [PLY](http://en.wikipedia.org/wiki/Ply_(game_theory)) combination is not found quickly.  The engine has "better things to do" than to calculate every possibility to that depth.
Answers.UserDisplayName: Daniel B
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-05-13T12:29:16.277Z
Answers.LastActivityDate: 2013-05-13T12:34:35.577Z
Answers.LastEditDate: 2013-05-13T12:34:35.577Z
Answers.UserDisplayName: user1411977
Body: <p>It is not the first time that I found a greatly superior move than the chess engine did, it even takes them a while to understand these moves after you make them.</p>
  
  <p>For example, the move <code>15 ... Bf2</code> in the game below:</p>
  
  <pre><code>[fen ""]
  [StartFlipped "1"]
  
  1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Ng4 5. h3 h5 6. hxg4 hxg4 7. Bxc6
  gxf3 8. Qxf3 Qh4 9. Qh3 Qxh3 10. gxh3 dxc6 11. Re1 Bxh3 12. f3 Bc5+ 13. Kh2
  Bf1+ 14. Kg3 Rh3+ 15. Kg4 Bf2 16. Rxf1 Rg3+ 17. Kf5 Rxf3+ 18. Kg4 Rg3+ 19.
  Kf5 f6 20. d3 Kf7 0-1
  </code></pre>
  
  <p>The move remains unnoticed by the engine for a while, it is not until I move that it starts to see the rest of the iceberg.</p>
  
  <p>I know it all depends on how much time you give them to analyze though, but it is unacceptable that sometimes humans manage to find these moves in less time than computers.</p>
  
  <ul>
  <li>Why do chess engines fail to spot good moves in some positions? (I once read something about a 'horizon effect', maybe this is related?)</li>
  <li>Are there other notable examples? (e.g <a href="http://www.chessbase.com/puzzle/puzz16b.htm" rel="noreferrer">this famous puzzle</a>, it takes a while for computers to solve)</li>
  </ul>
  
  <p>These questions contain useful information to partially explain some factors that might be causing this anomaly: <a href="https://chess.stackexchange.com/questions/210/what-algorithms-and-heuristics-are-popular-in-computer-chess">What algorithms and heuristics are popular in computer chess?</a>, <a href="https://chess.stackexchange.com/questions/1416/when-playing-a-computer-opponent-what-situations-should-i-create-to-give-myself">When playing a Computer opponent what situations should I create to give myself a better chance of winning?</a>, <a href="https://chess.stackexchange.com/questions/1720/computer-evaluations-how-trustworthy-are-they">Computer evaluations: How trustworthy are they?</a></p>
  
  <p><strong>Notes:</strong> The trap is known as the <em>Fishing Pole</em>, I am aware I missed a mate in 3 (and a mate in 7) :(, the time limit per move was days (correspondence chess) but it took me like 5-10 minutes to finish calculating everything.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-02-06T12:47:28.323Z
Comments.Text: Very interesting.  Stockfish on my average strength PC didn't find `15... Bf2` at all after 5 minutes.
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-02-06T12:49:56.593Z
Comments.Text: ...and it took over 7 minutes to find a similar mate-in-7 on the next move.
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-17T15:35:20.810Z
Comments.Text: 20 d3 is an error. try 20 d4.
Comments.UserDisplayName: dcaswell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-12T00:22:13.413Z
Comments.Text: Why do you use the language "unacceptable" for a human to find a move in less time than a computer? Can you unpack your thoughts on this?
Comments.UserDisplayName: Xonatron
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-01-08T18:16:03.420Z
Comments.Text: It missed a lot of better moves.  Why single out that one specifically?
Comments.UserDisplayName: yobamamama
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-13T14:00:08.770Z
Comments.Text: the puzzle link is dead. what was it please?
Comments.UserDisplayName: BCLC
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-14T01:19:55.810Z
Comments.Text: @BCLC https://www.chess.com/forum/view/general/looking-for-a-game-with-knight-underpromotion#comment-11879370 I think this was (found the same broken URL in his comment)
Comments.UserDisplayName: ajax333221
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-11-14T20:24:32.057Z
Comments.Text: Interestingly, nearly a decade later, I let stockfish 14+ NNUE get to depth 30 on lichess and its suggestion is 15...Kd7 (after mostly suggesting Rh1 before that). It gets the mate in 7 after Bf2 pretty much instantly though.
Comments.UserDisplayName: llama
Tags: <analysis><engines><evaluation>
Title: Why do chess engines sometimes miss good moves (or take forever to spot)?
ThreadText: # Why do chess engines sometimes miss good moves (or take forever to spot)?
  
  (Asked by: username_0 on 2013-02-05)
  
  It is not the first time that I found a greatly superior move than the chess engine did, it even takes them a while to understand these moves after you make them.
  For example, the move 15 ... Bf2 in the game below:
  [fen ""]
  [StartFlipped "1"]
  
  1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Ng4 5. h3 h5 6. hxg4 hxg4 7. Bxc6
  gxf3 8. Qxf3 Qh4 9. Qh3 Qxh3 10. gxh3 dxc6 11. Re1 Bxh3 12. f3 Bc5+ 13. Kh2
  Bf1+ 14. Kg3 Rh3+ 15. Kg4 Bf2 16. Rxf1 Rg3+ 17. Kf5 Rxf3+ 18. Kg4 Rg3+ 19.
  Kf5 f6 20. d3 Kf7 0-1
  
  The move remains unnoticed by the engine for a while, it is not until I move that it starts to see the rest of the iceberg.
  I know it all depends on how much time you give them to analyze though, but it is unacceptable that sometimes humans manage to find these moves in less time than computers.
  
  Why do chess engines fail to spot good moves in some positions? (I once read something about a 'horizon effect', maybe this is related?)
  Are there other notable examples? (e.g this famous puzzle, it takes a while for computers to solve)
  
  These questions contain useful information to partially explain some factors that might be causing this anomaly: What algorithms and heuristics are popular in computer chess?, When playing a Computer opponent what situations should I create to give myself a better chance of winning?, Computer evaluations: How trustworthy are they?
  Notes: The trap is known as the Fishing Pole, I am aware I missed a mate in 3 (and a mate in 7) :(, the time limit per move was days (correspondence chess) but it took me like 5-10 minutes to finish calculating everything.
  
  **Tags:** analysis, engines, evaluation
  
  > **Comments:**
  > **username_1**: Very interesting.  Stockfish on my average strength PC didn't find `15... Bf2` at all after 5 minutes.  
  > **username_1**: ...and it took over 7 minutes to find a similar mate-in-7 on the next move.  
  > **username_2**: 20 d3 is an error. try 20 d4.  
  > **username_3**: Why do you use the language "unacceptable" for a human to find a move in less time than a computer? Can you unpack your thoughts on this?  
  > **username_4**: It missed a lot of better moves.  Why single out that one specifically?  
  > **username_5**: the puzzle link is dead. what was it please?  
  > **username_0**: @username_5 https://www.chess.com/forum/view/general/looking-for-a-game-with-knight-underpromotion#comment-11879370 I think this was (found the same broken URL in his comment)  
  > **username_6**: Interestingly, nearly a decade later, I let stockfish 14+ NNUE get to depth 30 on lichess and its suggestion is 15...Kd7 (after mostly suggesting Rh1 before that). It gets the mate in 7 after Bf2 pretty much instantly though.  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_12 on 2013-05-13. Score: 37 | Accepted answer
  
  > Why do chess engines fail to spot good moves in some positions?
  
  The reason are called forward pruning techniques (see <http://chessprogramming.wikispaces.com/Pruning>)
  with ProbCut in first line.
  
  The move 15...Bf2 is pruned on shallow deeps because it includes the sacrifice 16.Rxf1 without regaining something concrete with evidence immediately after.
  The matenet is also hard to see, because it includes some further 'silent' move
  as for example 17...Ke7, and yes also engines, not only humans have difficulties to see distant silent moves as they are often pruned.
  
  In this concrete case you even cannot say, that engines fail to spot good moves,
  because also the continuation 15...Rh3h1 is a very good move and leads to an absolutely won position.
  
  Last but not least you have to remember, that an engine's strength is always measured in terms of elo-strengh and not in the ability to find the absolute shortest way to win.
  It does not matter, if a engine wins in 8 moves or in 25 moves.
  Seeking to much for the shortest win, would mean a waste time, because most time there does not exist such a secret good move at all. And waste of time would hurt the engines ELO-Rating.
  
  > **Comments:**
  > **username_14**: Nice answer, welcome to the site!  
  > **username_15**: +1 for mentioning the trade-off between pruned and full search.  I'm not in the least surprised that a 13+ [PLY](http://en.wikipedia.org/wiki/Ply_(game_theory)) combination is not found quickly.  The engine has "better things to do" than to calculate every possibility to that depth.  
  > **username_13**: Nice answer overall. +1 for *"Last but not least you have to remember, that an engine's strength is always measured in terms of elo-strengh and not in the ability to find the absolute shortest way to win"*  
  > **username_3**: Excellent answer.  
  
  ---
  
  ### Answer by username_7 on 2013-02-06. Score: 13
  
  I am trying this with Houdini 1.5 (the free version). At first 15...Bf2 doesn't show up in the top 5 moves, then when it reaches depth 15, it does, as #1. Takes about 19 seconds on my four year old computer, not that long.
  So it doesn't fail to spot it, instead it only considers it the best move once depth 15 is reached. Apparently, as long as it only looks 14 ply deep, other moves are better (like the also winning 15...f5+).
  Apparently 15...Bf2 is a mate in 8, which is 15 ply (8 moves by black, 7 by white). But at first it just considers it +10 or so, then +20, then mate in 10, then mate in 8.
  The mate in 8 line is:
  [FEN ""]
  
  1. e4 e5 2. Nf3 Nc6 3. Bb5 Nf6 4. O-O Ng4 5. h3 h5 6. hxg4 hxg4 7. Bxc6 gxf3 8. Qxf3 Qh4 9. Qh3 Qxh3 10. gxh3 dxc6 11. Re1 Bxh3 12. f3 Bc5+ 13. Kh2 Bf1+ 14. Kg3 Rh3+
  15.Kg4 Bf2 16.Rxf1 Rh4+ 17.Kg5 Ke7 18.Rh1 Rxh1 19.Nc3 Rah8 20.Nd5+ cxd5 21.d3 R8h5+ 22.Kg4 R1h4#.
  
  Clearly when Houdini 1.5 thinks 15 ply deep, it doesn't consider all possible lines that are 15 ply deep, or it would see the mate in 8 the moment it finished its 15-ply-depth search.
  I think that is because of pruning, it stops looking at some lines when it thinks they aren't promising enough. That way, it can spend more time on the promising lines, and the programmer thinks that the pros outweigh the cons. But I don't have an answer right now on what it decides to prune here (it probably makes millions of separate pruning decision at depth 15).
  It may have to do with the silent moves ...Ke7, and ...Rah8, two non-check non-captures in a line where black is a piece down. It's likely that it decides somewhere that it's not useful to keep looking in this line. Only later, when it does continue the line and finds the mate at the end do other lines that prolong the game (with 18.Rh1 Rxh1 and so on) then show up.
  Anyway, it's known that it doesn't work that well to let a computer think for a few seconds only if you want to get to the bottom of something, a few minutes is better.
  
  > **Comments:**
  > **username_9**: My guess as to why it prunes, is because 16. Rxf1 looks "heuristically" not that great- white's king is out in the open, but there's no immediate checkmate and black is down a knight for a pawn in material. It is not until deeper analysis happens (as you said) that the value of this "sacrifice" becomes clear.  
  > **username_8**: Note that "15 ply" means it's looked at _some moves_ to depth 15, not _all moves_.  That would take _waay_ longer than 4 seconds, even on a super-computer.  
  
  ---
  
  ### Answer by username_0 on 2013-05-17. Score: 2
  
  after reading all answers and other sources, I now understand that they don't 'miss' or chose to miss these moves, the humans programmed them in such way that they follow a specific pattern on (where/how/when + to) search and more importantly when to pause search and look into more promising lines in order to save resources.
  
  But given enough time, a computer will fin every possible combination on a certain depth.
  
  **TL;DR**
  
  * Q1: they never miss moves, they just haven't found them yet
  * Q2: they take time because they are programmed to save resources and they will prioritize some lines over other ones (e.g the ones that don't have passive moves or don't recover material in the next few moves).
  
  
  ---
  
  ### Answer by username_10 on 2013-07-19. Score: -1
  
  I think everyone is missing a much quicker mate. When checking the position with Houdini 3, black actually has mate in 3 on move 13. Instead of Bf1+, black should've played Bf2, and it contines with 14. d3 bf1+ 15. Bh6 Rxh6#. So, in a unusual answer to your question, maybe certain engines didn't see your move right away, but, in the case of Houdini 3, it found a much quicker mate.
  
  > **Comments:**
  > **username_11**: If you read the entire question you will see that he is aware of the mate in 3. All reasonably new engines will find the mate in 3 immediately, and it is not a part of what is asked here.  
  
  ---
  
  