user23554: 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"]


user12873: 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.

user23985: 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

23554: <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>
 12873: <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>
 23985: <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>
