Answers.Body: <p>Quiesence search isn't able to handle situations like that - including checks would explode the search tree.  Two iterations later (assuming you're doing iterative deepening), Qxd5 and Bg3+ will take place in the main search, and then quiesence search would be able to find the continuation you described.</p>
  <p>Some engines include quiet checks in the first ply of quiesence search - in that case you situation would be resolved in one additional iteration instead of two</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-25T19:32:51.570Z
Answers.LastActivityDate: 2020-06-25T19:32:51.570Z
Answers.UserDisplayName: Jeff Wilson
Answers.Body: <p>I suppose one possible solution would be checking if any double attacks can be played. This would include checking for forks and discovered attacks/checks. If this is too broad a condition for quiescence search, you could narrow it down by checking if one of your pieces involved in the double attack is worth a sufficient amount (say, at least a knight or rook). </p>
  
  <p>In this case, ...Bg3+ would do a double attack on your king and queen, which would clearly indicate that a quiescent state hasn't been reached.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-18T06:50:05.940Z
Answers.LastActivityDate: 2020-05-18T06:50:05.940Z
Answers.UserDisplayName: Inertial Ignorance
Body: <p>I'm implementing quiescent search in my chess engine, although just capturing moves have been generated. In the below position, at 1 ply, the white queen captures the pawn, but the quiescent search can't see that after 1... Bg3+ 2. Kf1 Rxd5, and the white queen is captured. This is a case of a discovered attack. How can quiescent search handle that, or is it just for capturing moves?</p>
  <pre><code>[FEN &quot;2b1k3/3r4/3b4/3p4/8/8/3Q4/R3K3 w - - 0 1&quot;]
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-05-18T13:16:50.567Z
Comments.Text: You have to stop searching somewhere! You can't hope to cover all the tactical possibilities in a quiescence search.
Comments.UserDisplayName: TonyK
Tags: <engines><programming><evaluation><captures>
Title: Discovered attack in quiescent search
ThreadText: # Discovered attack in quiescent search
  
  (Asked by: username_0 on 2020-05-17)
  
  I'm implementing quiescent search in my chess engine, although just capturing moves have been generated. In the below position, at 1 ply, the white queen captures the pawn, but the quiescent search can't see that after 1... Bg3+ 2. Kf1 Rxd5, and the white queen is captured. This is a case of a discovered attack. How can quiescent search handle that, or is it just for capturing moves?
  [FEN "2b1k3/3r4/3b4/3p4/8/8/3Q4/R3K3 w - - 0 1"]
  
  **Tags:** engines, programming, evaluation, captures
  
  > **Comments:**
  > **username_1**: You have to stop searching somewhere! You can't hope to cover all the tactical possibilities in a quiescence search.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2020-06-25. Score: 2
  
  Quiesence search isn't able to handle situations like that - including checks would explode the search tree. Two iterations later (assuming you're doing iterative deepening), Qxd5 and Bg3+ will take place in the main search, and then quiesence search would be able to find the continuation you described.
  
  Some engines include quiet checks in the first ply of quiesence search - in that case you situation would be resolved in one additional iteration instead of two
  
  
  ---
  
  ### Answer by username_3 on 2020-05-18. Score: 1
  
  I suppose one possible solution would be checking if any double attacks can be played. This would include checking for forks and discovered attacks/checks. If this is too broad a condition for quiescence search, you could narrow it down by checking if one of your pieces involved in the double attack is worth a sufficient amount (say, at least a knight or rook).
  
  In this case, ...Bg3+ would do a double attack on your king and queen, which would clearly indicate that a quiescent state hasn't been reached.
  
  
  ---
  
  