1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Omit mate distance pruning at root

Restore original behaviour, before root unification and
remove a now useless ugly hack for alpha in multi-pv case.

No functional change

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-06-18 17:10:29 +01:00
parent 8173d92dd2
commit 7ea38e980b

View file

@ -764,10 +764,13 @@ namespace {
return VALUE_DRAW;
// Step 3. Mate distance pruning
if (!RootNode)
{
alpha = Max(value_mated_in(ss->ply), alpha);
beta = Min(value_mate_in(ss->ply+1), beta);
if (alpha >= beta)
return alpha;
}
// Step 4. Transposition table lookup
// We don't want the score of a partial search to overwrite a previous full search
@ -1009,7 +1012,7 @@ split_point_start: // At split points actual search starts from here
}
// At Root and at first iteration do a PV search on all the moves to score root moves
isPvMove = (PvNode && moveCount <= (RootNode ? depth <= ONE_PLY ? 1000 : MultiPV : 1));
isPvMove = (PvNode && moveCount <= (RootNode ? depth <= ONE_PLY ? MAX_MOVES : MultiPV : 1));
givesCheck = pos.move_gives_check(move, ci);
captureOrPromotion = pos.move_is_capture(move) || move_is_promotion(move);
@ -1115,14 +1118,8 @@ split_point_start: // At split points actual search starts from here
// Step extra. pv search (only in PV nodes)
// The first move in list is the expected PV
if (isPvMove)
{
// Aspiration window is disabled in multi-pv case
if (RootNode && MultiPV > 1)
alpha = -VALUE_INFINITE;
value = newDepth < ONE_PLY ? -qsearch<PV>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
: - search<PV>(pos, ss+1, -beta, -alpha, newDepth);
}
else
{
// Step 15. Reduced depth search