Code, algorithms, languages, construction...
-
thevinenator
- Posts: 68
- Joined: Tue Jun 02, 2015 11:02 pm
- Real Name: Vince
Post
by thevinenator » Mon Dec 26, 2016 4:38 pm
Please explain what this code (from CPW) is doing.
Code: Select all
if (depth < 3
&& (!is_pv)
&& (!flagInCheck)
&& (abs(beta - 1) > -INF+100))
{
int static_eval = eval(alpha, beta, 1);
int eval_margin = 120 * depth;
if (static_eval - eval_margin >= beta)
return static_eval - eval_margin;
}
if not in PV and not in check...but what is
doing?
won't beta almost always be greater than the low mate limit?
"An Engine's strength flows from the Search. But beware, pruning, extensions, reductions; the dark side of the Search are they. Once you start down the dark path, it will dominate and consume you, as it has to so many developers before.” -- Yoda
-
H.G.Muller
- Posts: 190
- Joined: Sun Jul 14, 2013 10:00 am
- Real Name: H.G. Muller
Post
by H.G.Muller » Wed Dec 28, 2016 10:34 pm
Indeed,it will. So you will only refrain from doing this if you have mate scores. Which makes sense, because the margin is in centiPawn, and mate scores are not be measured in centiPawns.
This is just an inefficient implementation of futility pruning / razoring. Normally you do the test (in reverse, because of negamax) in the parent node, to not waste any time on MakeMove.