QSearch perft

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: QSearch perft

Post 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.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: QSearch perft

Post 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.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: QSearch perft

Post 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.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: QSearch perft

Post 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.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: QSearch perft

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