Page 1 of 1

How to Best Limit Checks in the Quiescence ?

Posted: Mon Aug 20, 2007 9:37 pm
by smcracraft
If you don't limit your in-check investigations in the
quiescence search, for a position like this:

[D] 6Bk/PPPPPp1P/8/7R/7K/8/ppppppQ1/6B1 w - - bm Bxf7; ce 32764; dm 2; pv Bxf7 f1=Q e8=Q#;

you may never return from your search...

So, in the opinions of the experts on this board,
what do you think are the optimal ways to limit
checks in your quiescence search?

"Sarcasm is acceptable but answers are better."
Anonymous

--Stuart

Re: How to Best Limit Checks in the Quiescence ?

Posted: Mon Aug 20, 2007 10:20 pm
by Michael Sherwin
First you should start with a real world example. Then you can devise real world solutions. I suppose that the best solution will not be best on your example.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Mon Aug 20, 2007 10:30 pm
by Gerd Isenberg
A few conditions on the fly to combine and try:

Restricting by number of checks per path, e.g. quite checks only at horizon-nodes (depth == 0) but not below, or - only one (or N ) check(s) at depth 0 or below.

Restrict checks to pv-nodes (open window), or weak "expected" cut-nodes with evalscore + MARGIN <= alpha.

Enable checks in qsearch by some triggers from main-search, e.g. checks, extensions etc., likely path dependent. Only consecutive checks.

Pruning of checking "repetition" moves aka unmaking last move,
if alpha>DRAWSCORE and "weaker" side is about to repeat the position.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Mon Aug 20, 2007 10:50 pm
by bob
another suggestion...

If you reach any q-search node, and you do not search a check there, there is no point in searching checks at nodes below that point for that side, since any mate you find will be pruned by the "stand pat" score where a check was not played.

I used to do checks in the q-search, and I limited the number of plies where I could check to something pretty small. If you aren't careful, you can spend all your time out there.

I don't do any checks at all in my qsearch, and I believe that Junior does the same. If you remember Ferret, it was another example of a very simple captures-only qsearch but was still very strong...

Re: How to Best Limit Checks in the Quiescence ?

Posted: Mon Aug 20, 2007 11:42 pm
by Michael Sherwin
RomiChess does not gen checks or extend them in the qsearch. Though, it does not enter the qsearch if it is in check.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Tue Aug 21, 2007 12:03 am
by bob
I do the same since I extend a check when I give it, rather than when I escape it. I can't get to the q-search in check, although once in the q-search it can certainly happen when a capture gives check.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Tue Aug 21, 2007 1:05 am
by Michael Sherwin
Also what helped some, if in check, was extending two ply if the line has been shortened by LMR.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Tue Aug 21, 2007 1:14 am
by Marimar
Hi,
I am not an expert. But the best way to limit checks in quiescence search is simply not include them (unless they are captures).
My suggestion: include in the q-search only captures (probably only some of them) and check evasions. Let your regular search plus check extensions (or other extensions) take care of long forcing checking sequences.
José.

Re: How to Best Limit Checks in the Quiescence ?

Posted: Tue Aug 21, 2007 9:14 am
by Roman Hartmann
This is an old problem and there are several ways to deal with it. The most common one seems to completely ignore it as position like that don't happen too often in actual play. As you already wrote many chess engines just seem to stay in QS forever.

As I had problems with my QS in even simpler positions (was due a bug though) I removed the check extension stuff from my QS. I don't enter the QS when in check but if a capture in QS leads to a check I start to generate all moves in QS. This is limited by a node count though. Check extensions are done in the main search and limited by number of iterations. But there is still a lot of room for improvement.

Roman

with QS enabled (an UCI-switch)
Analysis by Roce 0.0370:
1.Dg2-g7+ Kh8xg7 2.Th5-g5+ Kg7-h6
+- (#3) Tiefe: 2/2 00:00:01
1.Dg2-g7+ Kh8xg7 2.h7-h8L+ Kg7xg8 3.e7-e8T#
+- (#3) Tiefe: 3/2 00:00:04
1.Lg8xf7 f2xg1S 2.Dg2-g8#
+- (#2) Tiefe: 4/3 00:00:27

with QS disabled
Analysis by Roce 0.0370:
1.Dg2-g7+ Kh8xg7 2.h7-h8D+ Kg7-g6 3.Th5-g5#
+- (#3) Tiefe: 2/1 00:00:00
1.Dg2-g7+ Kh8xg7 2.h7-h8L+ Kg7xg8 3.e7-e8T#
+- (#3) Tiefe: 3/2 00:00:00
1.Lg8xf7 f2xg1S 2.Dg2-g8#
+- (#2) Tiefe: 4/3 00:00:00
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 5/4 00:00:00
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 6/5 00:00:00 45kN
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 7/6 00:00:00 271kN
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 8/7 00:00:02 930kN
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 9/8 00:00:08 3692kN
1.Lg8xf7 f2xg1S 2.a7-a8D#
+- (#2) Tiefe: 10/9 00:00:33 12667kN

Re: How to Best Limit Checks in the Quiescence ?

Posted: Tue Aug 21, 2007 8:19 pm
by smcracraft
Thankyou Roman.