summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8173d92)
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>
return VALUE_DRAW;
// Step 3. Mate distance pruning
return VALUE_DRAW;
// Step 3. Mate distance pruning
- alpha = Max(value_mated_in(ss->ply), alpha);
- beta = Min(value_mate_in(ss->ply+1), beta);
- if (alpha >= beta)
- return alpha;
+ 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
// Step 4. Transposition table lookup
// We don't want the score of a partial search to overwrite a previous full search
}
// At Root and at first iteration do a PV search on all the moves to score root moves
}
// 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);
givesCheck = pos.move_gives_check(move, ci);
captureOrPromotion = pos.move_is_capture(move) || move_is_promotion(move);
// Step extra. pv search (only in PV nodes)
// The first move in list is the expected PV
if (isPvMove)
// 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);
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
else
{
// Step 15. Reduced depth search