Static NULL Move

Code, algorithms, languages, construction...

Static NULL Move

Postby 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
Code: Select all
(abs(beta - 1) > -INF+100))
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
Posts: 65
Joined: Tue Jun 02, 2015 11:02 pm

Re: Static NULL Move

Postby 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.
Posts: 171
Joined: Sun Jul 14, 2013 10:00 am

Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 1 guest