Checks in qsearch - must-have or optional?

Discussion of chess software programming and technical issues.

Moderators: Harvey Williamson, Dann Corbit, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
fierz
Posts: 65
Joined: Mon Mar 07, 2016 3:41 pm
Location: Zürich, Switzerland
Contact:

Checks in qsearch - must-have or optional?

Post by fierz » Tue Mar 15, 2016 8:43 pm

I've recently dusted off my old chess engine, and cleaned up a lot of code, and I was wondering about checks in qsearch. I never bothered writing a check generator for the qsearch, so my qsearch only does captures and nothing else. Some experiments with checks in qsearch were rather inconclusive. My questions for those generating checks in qsearch are:

* how much stronger would you guess that it makes your engine?
* do you generate checks in the entire qsearch, just on the first call, on N calls, what difference does it make?
* where do you order the checks in the qsearch?

interested in your feedback!

mar
Posts: 2225
Joined: Fri Nov 26, 2010 1:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Checks in qsearch - must-have or optional?

Post by mar » Tue Mar 15, 2016 9:27 pm

Hmm, I usually include expected elo gains in commits but unfortunately I have no such info for checks in qs.
I personally sort qs checks after good captures but I haven't really tried anything else so feel free to experiment.
I only generate qchecks at qs depth 0 (only when not in check as I generate all evasions in qs, no matter how deep)
I don't claim that what I do is best so consider it just one possibility. Hope it helps.

jdart
Posts: 4036
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Checks in qsearch - must-have or optional?

Post by jdart » Tue Mar 15, 2016 9:33 pm

I think the consensus is that it is necessary if you are doing deep enough reductions that you can hit the q-search during a LMR search.

I do checks after captures/promotions and only in the first ply of the qsearch. Of course if a check is also a capture it gets searched before non-check captures.

--Jon

User avatar
Steve Maughan
Posts: 1077
Joined: Wed Mar 08, 2006 7:28 pm
Location: Florida, USA
Contact:

Re: Checks in qsearch - must-have or optional?

Post by Steve Maughan » Tue Mar 15, 2016 9:50 pm

Hi Martin,

I'd echo Jon's comments. Checks in the QSearch have little impact on strength if analyzed on their own. However, they enable you to do more aggressive null move and LMR than would otherwise be possible.

In Maverick I do checks on the first ply (after captures) and then checks on future ply if there was only one move to get out of check.

Steve
http://www.chessprogramming.net - Maverick Chess Engine

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Checks in qsearch - must-have or optional?

Post by sje » Tue Mar 15, 2016 10:09 pm

One superstition which has shown some promise is one I stole from the Chess 4.x write-up: addition of check inclusion for a ply or two between the full width search and the standard quiescence search.

To make this work more efficiently, my program Symbolic has a legal-only, check-only move generator. That's fairly easy to do with a bitboard program.

fierz
Posts: 65
Joined: Mon Mar 07, 2016 3:41 pm
Location: Zürich, Switzerland
Contact:

Re: Checks in qsearch - must-have or optional?

Post by fierz » Wed Mar 16, 2016 7:34 am

Dear all,

thanks for the replies. I already added LMR (one of the reasons I was asking about computer chess progress over the last 20 years...), and I can drop right into qsearch there. I'll give it another go, my first implementation was probably crappy.

On a related note: do you also look for and generate discovered checks, or is this so infrequent that it's irrelevant?

cheers
Martin

jdart
Posts: 4036
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Checks in qsearch - must-have or optional?

Post by jdart » Wed Mar 16, 2016 8:07 am

I do generate discovered checks, in fact I generate them first. It is not too difficult to do.

And also: in the q-search I do not prune moves that cause discovered check. Most engines do this too.

--Jon

Joost Buijs
Posts: 1200
Joined: Thu Jul 16, 2009 8:47 am
Location: Almere, The Netherlands

Re: Checks in qsearch - must-have or optional?

Post by Joost Buijs » Wed Mar 16, 2016 9:13 am

I generate direct checks only, no discovered checks, I use them at the first 2 ply in quiescence, this gave me the best results.
First I try the captures and after that the checks, after the checks I try promotions to queen, but only on the first ply of quiescence.
I don't remember how big the gain exactly gain was, I have to remeasure it some day.

It might be an improvement to generate queen checks only, but I never tried.

User avatar
Bloodbane
Posts: 154
Joined: Thu Oct 03, 2013 2:17 pm

Re: Checks in qsearch - must-have or optional?

Post by Bloodbane » Wed Mar 16, 2016 12:13 pm

Steve Maughan wrote:I'd echo Jon's comments. Checks in the QSearch have little impact on strength if analyzed on their own. However, they enable you to do more aggressive null move and LMR than would otherwise be possible.
This is my experience as well. According to my notes checks in quiescence search lost maybe 5 elo, but they enabled more reductions etc. which gained 20+ elo. I generate discovered checks since due to the way my program works it is very cheap.
Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.
https://github.com/mAarnos

User avatar
lucasart
Posts: 3168
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Checks in qsearch - must-have or optional?

Post by lucasart » Sun Mar 20, 2016 8:35 am

jdart wrote:I think the consensus is that it is necessary if you are doing deep enough reductions that you can hit the q-search during a LMR search.

I do checks after captures/promotions and only in the first ply of the qsearch. Of course if a check is also a capture it gets searched before non-check captures.

--Jon
I disagree with the LMR part. In my experience, what is valuable is to let null move search dive directly into qsearch. Indeed the null move refutation is most often a straightforward capture of a hanging piece, and finding such moves is the job of the qsearch, so it works well. LMR that dive directly into the qsearch have never worked so well in my experience. In Stockfish you will also see that we do not LMR into the qsearch. And since everything in SF has been tried and retried, and tuned to death, that kind of tells you that LMR into QS is not so good...
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

Post Reply