## How to Best Limit Checks in the Quiescence ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
smcracraft
Posts: 737
Joined: Wed Mar 08, 2006 7:08 pm
Location: Orange County California
Full name: Stuart Cracraft
Contact:

### How to Best Limit Checks in the Quiescence ?

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

"Sarcasm is acceptable but answers are better."
Anonymous

--Stuart

Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

### Re: How to Best Limit Checks in the Quiescence ?

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.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through

Gerd Isenberg
Posts: 2246
Joined: Wed Mar 08, 2006 7:47 pm
Location: Hattingen, Germany

### Re: How to Best Limit Checks in the Quiescence ?

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.

bob
Posts: 20930
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: How to Best Limit Checks in the Quiescence ?

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

Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

### Re: How to Best Limit Checks in the Quiescence ?

RomiChess does not gen checks or extend them in the qsearch. Though, it does not enter the qsearch if it is in check.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through

bob
Posts: 20930
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: How to Best Limit Checks in the Quiescence ?

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.

Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 1:00 am
Location: WY, USA
Full name: Michael Sherwin

### Re: How to Best Limit Checks in the Quiescence ?

Also what helped some, if in check, was extending two ply if the line has been shortened by LMR.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through

Marimar
Posts: 100
Joined: Fri Mar 10, 2006 10:23 pm

### Re: How to Best Limit Checks in the Quiescence ?

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é.

Roman Hartmann
Posts: 295
Joined: Wed Mar 08, 2006 7:29 pm
Contact:

### Re: How to Best Limit Checks in the Quiescence ?

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

smcracraft
Posts: 737
Joined: Wed Mar 08, 2006 7:08 pm
Location: Orange County California
Full name: Stuart Cracraft
Contact:

Thankyou Roman.