Page 3 of 3

Re: QSearch perft

Posted: Sat May 25, 2019 5:31 am
by jwes
Robert Pope wrote: Fri May 24, 2019 11:08 pm
Joost Buijs wrote: Fri May 24, 2019 2:43 pm
I think the difference is due to the fact that you don't generate check-evasions, because check-evasions will contain non captures too. So you have to generate evasions when the king is in check. You have to do this in quiescence too, otherwise your quiescence will make very big errors.
Do you have to do something to avoid a search explosion? It seems once you add non-capturing evasions, you open yourself up to perpetual checks.
You can do either checks or check evasions in qsearch, but not both.

Re: QSearch perft

Posted: Sat May 25, 2019 7:51 am
by Joost Buijs
Robert Pope wrote: Fri May 24, 2019 11:08 pm
Joost Buijs wrote: Fri May 24, 2019 2:43 pm
I think the difference is due to the fact that you don't generate check-evasions, because check-evasions will contain non captures too. So you have to generate evasions when the king is in check. You have to do this in quiescence too, otherwise your quiescence will make very big errors.
Do you have to do something to avoid a search explosion? It seems once you add non-capturing evasions, you open yourself up to perpetual checks.
Indeed, there could be a problem with it if the evasion checks the other king and vice versa, this is very unlikely however and (hopefully) will be detected by repetition detection, at least I never found any problem with it.

When the king is in check and you don't generate non-capturing evasions the question is what to return from your q-search() because you don't know whether it is check-mate or not, returning some negative score will probably work but this is not very accurate.

Re: QSearch perft

Posted: Sat May 25, 2019 10:40 am
by Henk
Maybe I only do check evasions above some depth. Say -6. I don't have repetition detection in QSearch. If most are captures then I think not many repetitions will occur or not?

By the way with check evasions I get same problem with futility pruning in QSearch as in normal Search on depth = 1.
For instance a pawn fork between king and another piece. Without check evasions opponent would just stand pat when in check. But with check evasions it may loose a piece.

Re: QSearch perft

Posted: Sat May 25, 2019 6:20 pm
by Joost Buijs
Henk wrote: Sat May 25, 2019 10:40 am Maybe I only do check evasions above some depth. Say -6. I don't have repetition detection in QSearch. If most are captures then I think not many repetitions will occur or not?

By the way with check evasions I get same problem with futility pruning in QSearch as in normal Search on depth = 1.
For instance a pawn fork between king and another piece. Without check evasions opponent would just stand pat when in check. But with check evasions it may loose a piece.
I never tried without rep. detection, maybe it is not necessary, I guess you just have to try. You really need check evasions or some other means to resolve checks. When the king is in check you can try to call main search from quiescence (with depth 1), this is far from optimal, but it probably works better than doing nothing at all.

Re: QSearch perft

Posted: Sun May 26, 2019 5:40 am
by Robert Pope
jwes wrote: Sat May 25, 2019 5:31 am
Robert Pope wrote: Fri May 24, 2019 11:08 pm
Joost Buijs wrote: Fri May 24, 2019 2:43 pm
I think the difference is due to the fact that you don't generate check-evasions, because check-evasions will contain non captures too. So you have to generate evasions when the king is in check. You have to do this in quiescence too, otherwise your quiescence will make very big errors.
Do you have to do something to avoid a search explosion? It seems once you add non-capturing evasions, you open yourself up to perpetual checks.
You can do either checks or check evasions in qsearch, but not both.
Ah. Right, thanks.