Detail evaluation within quiescence search

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Detail evaluation within quiescence search

Post by SMIRF »

This moment I am preparing for to write a quiescene search for my growing new chessprogram. Is it recommended to subtract and sum up only the values of all captured material or also to follow the changes of deeper detail evaluations?
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Detail evaluation within quiescence search

Post by jdart »

Values from the quiescence search are propagated upward, possibly to the root of the search, so you have to have an accurate eval there.

However, you can try to compute material first and cut off if that is outside the window by some margin (aka "lazy eval"). Cut off nodes are not propagated so this is safe.

--Jon
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Detail evaluation within quiescence search

Post by SMIRF »

Maybe I have not been sufficiently precise in my question. There is the chance at every node to add a detail evaluation to the material balance to gain a more positional evaluation.

But despite of the fact, that I would have such a detail evaluation relative cheaply at hands I doubt, that using it would make sense, because of its fluctuation between pre and post to any move.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Detail evaluation within quiescence search

Post by jdart »

Like I said, when you return a score that is in bounds, including from the quiescence search, it should include all your evaluation. If you have adjustments to material for example a "trade down" bonus, include it.

For cutoff you can be sloppier - for example futility cutoff can be done on material only.

--Jon
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Detail evaluation within quiescence search

Post by SMIRF »

The deatail evaluation will fluctuate because of the positional changings through every move. Thus e.g. after exchanging knights the material balance has been stable, but the detail evaluation probably would have changed. Using the detail evaluation might have caused a cutoff in between, whereas ignoring it would have not.

Thus would it not be better to preserve the optimal quiescence path found without the detail information, then redoing that path and making a detail evalution at the leaf node?

Or would it be sufficient and simpler to combine the initial detail evaluation with the reachable material balance by negating the constant original detail evaluation and propagating it that way through the quiescence search? Because the goal seems to be to evaluate the original node.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Detail evaluation within quiescence search

Post by Evert »

I'm afraid I don't understand the question.

The point of the quiescence search is to resolve any tension by trying if any sequence of capture moves can improve on a null-move (which is the ultimate quiet move). So you do the full eval and use that to raise alpha. Then you do a capture search. If at any point you end up with alpha>=beta, you take the cut-off.

Where you can be cheap is by doing futility pruning of (SEE) losing captures. You can also do futility pruning if you are so far behind that no capture you can make will equalise. There you do not take into account the full eval change of the move.

So any score you return is always based on the full evaluations, but pruning decisions are based on much cruder material considerations. In the end, quiescence search isn't going to be perfectly accurate, it's an approximation. Nothing you can do will change that.
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Detail evaluation within quiescence search

Post by SMIRF »

During quiescence search (mostly) only capture moves will be inspected. But the fluctuation of merely detail evaluation which would occur when also following non capture moves is completely ignored.

Thus, why during the recursive evaluation of capture moves then the fluctuation of the detail evaluation should be used?

It could not be avoided, that possibly a not investigated non capture would lead to a better detail evaluation than the best quiescence path. Thus using detail evaluation within the quiescence search cannot lead to more precision.

Where am I wrong within my thoughts?
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Detail evaluation within quiescence search

Post by cdani »

The final evaluation that go back to the node previous to quiescence, and that can reach the root node, is the evaluation after all the quiescence moves, so it must be accurate, aka complete. So is for this that is used. Is this you question?
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Detail evaluation within quiescence search

Post by SMIRF »

cdani wrote:... So is for this that is used. Is this you question?
No, I seem to have very big difficulties to explain my point.

The moment when the decision is made to call quiescence(), then only (in major cases) material exchanges should be investigated and not quiet moves. For me it does not seem to make sense, to ignore possible fluctuations whithin possible quiet moves, but to take those from captures into the evaluation.

My idea is, to use the detail evaluation from the root of quiescence and use it approriately through the whole quiescence search +/- , because any more precision would be an illusion. Moreover it could change the possible outcome, when the alpha-beta window later would be modified and the same node would be evaluated a second time, and fluctuating sub node detail evaluations would lead to different cuts.
Stan Arts
Posts: 179
Joined: Fri Feb 14, 2014 10:53 pm
Location: the Netherlands

Re: Detail evaluation within quiescence search

Post by Stan Arts »

Essentially you'd detail evaluate where positions are still non-quiet, at the leaves.

Because captures often have huge effect on positional scoring and you wouldn't have an accurate score to propagate back to the root if a capture sequence from Qsearch does make it or refutes something towards the PV, Which seems to happen very often. So that when the sequence comes into scope of the leafnode or the last node you do detail evaluation at, the score would suddenly swing a lot.

Capture a big knight or move/trade a big knight for a pointless pawn somewhere you'd still give +1.00 , trade queens when a king is exposed to give a huge swing in king safety, capture a passed pawn, etc. To refute the leaf node score. You'd have no idea of them.

Ofcourse it's true that any quiet move could also improve the score a lot but those are much harder to predict, while capture/trade sequences are simply extremely common and forcing in chess.

Another point is that few Qsearch lines make it past the first node, so would likely not give you much of a speed up in the first place.
But in any case, try it!