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

Remove another unnecessary Search::Stack field

No functional change

Resolves #535
This commit is contained in:
DU-jdto 2015-12-21 08:45:21 +11:00 committed by Joona Kiiski
parent da34023cfc
commit e3c85c314d
2 changed files with 8 additions and 10 deletions

View file

@ -642,7 +642,7 @@ namespace {
assert(0 <= ss->ply && ss->ply < MAX_PLY);
ss->currentMove = (ss+1)->excludedMove = bestMove = MOVE_NONE;
(ss+1)->skipEarlyPruning = false; (ss+1)->reduction = DEPTH_ZERO;
(ss+1)->skipEarlyPruning = false;
(ss+2)->killers[0] = (ss+2)->killers[1] = MOVE_NONE;
// Step 4. Transposition table lookup. We don't want the score of a partial
@ -984,32 +984,31 @@ moves_loop: // When in check search starts from here
&& moveCount > 1
&& !captureOrPromotion)
{
ss->reduction = reduction<PvNode>(improving, depth, moveCount);
Depth r = reduction<PvNode>(improving, depth, moveCount);
// Increase reduction for cut nodes and moves with a bad history
if ( (!PvNode && cutNode)
|| ( thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO
&& cmh[pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO))
ss->reduction += ONE_PLY;
r += ONE_PLY;
// Decrease reduction for moves with a good history
if ( thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO
&& cmh[pos.piece_on(to_sq(move))][to_sq(move)] > VALUE_ZERO)
ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
r = std::max(DEPTH_ZERO, r - ONE_PLY);
// Decrease reduction for moves that escape a capture
if ( ss->reduction
if ( r
&& type_of(move) == NORMAL
&& type_of(pos.piece_on(to_sq(move))) != PAWN
&& pos.see(make_move(to_sq(move), from_sq(move))) < VALUE_ZERO)
ss->reduction = std::max(DEPTH_ZERO, ss->reduction - ONE_PLY);
r = std::max(DEPTH_ZERO, r - ONE_PLY);
Depth d = std::max(newDepth - ss->reduction, ONE_PLY);
Depth d = std::max(newDepth - r, ONE_PLY);
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d, true);
doFullDepthSearch = (value > alpha && ss->reduction != DEPTH_ZERO);
ss->reduction = DEPTH_ZERO;
doFullDepthSearch = (value > alpha && r != DEPTH_ZERO);
}
else
doFullDepthSearch = !PvNode || moveCount > 1;

View file

@ -41,7 +41,6 @@ struct Stack {
Move currentMove;
Move excludedMove;
Move killers[2];
Depth reduction;
Value staticEval;
bool skipEarlyPruning;
int moveCount;