Changes

Jump to: navigation, search

Improving

1,913 bytes added, 5 July
Add improving article
Improving is an important modifier for many search heuristics. It is a boolean flag indication whether the static evaluation of a position has improved from the position two plys ago. Improving can be used to modify the frequency and aggressiveness of certain pruning heuristics.

=Improving as a Modifier to Search Heuristics=

{| class="wikitable"
|-
! Heuistics
! Modification
|-
| [[Reverse Futility Pruning]]
| style="text-align:left;" | Lower pruning margin when improving
|-
| [[Late Move Pruning]]
| style="text-align:left;" | Prune more late quiet moves when not improving
|-
| [[ProbCut]]
| style="text-align:left;" | Lower ProbCut beta threshold when improving
|-
| [[Null Move Pruning]]
| style="text-align:left;" | More NMP when improving. This can be done by allowing pruning <br> even when eval is under beta (and above a certain threshold) when improving.
|-
| [[Late Move Reductions]]
| style="text-align:left;" | Reduce more when not improving / less when improving
|}

=Code Example=

The following code is taken from [[Alexandria]]. Note that in case the position is in check both 2 and 4 plies ago, improving can be set to either true or false. SPRT testing should be done to determine which of the two options is optimal for a given engine.

<pre>
// Improving is a very important modifier to many heuristics. It checks if our static eval has improved since our last move.
// As we don't evaluate in check, we look for the first ply we weren't in check between 2 and 4 plies ago. If we find that
// static eval has improved, or that we were in check both 2 and 4 plies ago, we set improving to true.
if(inCheck)
improving = false;
else if ((ss - 2)->staticEval != SCORE_NONE) {
improving = ss->staticEval > (ss - 2)->staticEval;
}
else if ((ss - 4)->staticEval != SCORE_NONE) {
improving = ss->staticEval > (ss - 4)->staticEval;
}
else
improving = true;
</pre>
166
edits

Navigation menu