Page 1 of 1

qsearch question

Posted: Mon Aug 19, 2013 3:28 pm
by nak3c
quick questions about q-search. I have been studying the code of TSCP and winglet and there is part of the q-searching algorithm I cant get my head around. So qsearch is called when you reach a specified depth in alphabeta; the goal is of course to look for a quiet position because if you're in the middle of a capture sequence the evaluation function will greatly favor one side and get cut off, when in fact it could be a good variation. now qsearch usually just calls a capture generator which helps complete those capturing sequences that were left incomplete by alpha-beta. What I dont understand is that TSCP and winglet check the evaluation at EVERY node in quiescence and return if the eval is > beta. something like

x = eval()
if (x>= beta) return beta;
if (x> alpha) alpha = x;

is preformed at every node in TSCP, but wont this just beta cut in the middle of any capturing sequence that favors the side to move? that would be precisly what quiescent is intended to avoid. Thanks for help, Nick

Re: qsearch question

Posted: Mon Aug 19, 2013 7:38 pm
by hyatt
The purpose of q-search is to (a) establish alpha (lower bound, AKA standpat score), and then (b) see if any capture can improve on that value. Any capture that is worse than the stand-pat score is ignored.

It works exactly as you suggest, but it NEVER wants to find "worse" results than what would happen if it just simply "stands pat and does not make a move at all."

Re: qsearch question

Posted: Mon Aug 19, 2013 7:40 pm
by Lasse Hansen
The point with the beta cutoff using eval score is that a capture sequence may (normally) be abrupted, so if the side to move chooses a non-capture the (eval) score of the position will probably be above beta. I believe this is called stand-pat.

Regards, Lasse