Page 1 of 2

Checks in qsearch - must-have or optional?

Posted: Tue Mar 15, 2016 9:43 pm
by fierz
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!

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

Posted: Tue Mar 15, 2016 10:27 pm
by mar
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.

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

Posted: Tue Mar 15, 2016 10:33 pm
by jdart
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

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

Posted: Tue Mar 15, 2016 10:50 pm
by Steve Maughan
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

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

Posted: Tue Mar 15, 2016 11:09 pm
by sje
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.

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

Posted: Wed Mar 16, 2016 8:34 am
by fierz
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

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

Posted: Wed Mar 16, 2016 9:07 am
by jdart
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

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

Posted: Wed Mar 16, 2016 10:13 am
by Joost Buijs
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.

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

Posted: Wed Mar 16, 2016 1:13 pm
by Bloodbane
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.

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

Posted: Sun Mar 20, 2016 9:35 am
by lucasart
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...