std::memset(ss-7, 0, 10 * sizeof(Stack));
for (int i = 7; i > 0; i--)
- (ss-i)->continuationHistory = &this->continuationHistory[0][NO_PIECE][0]; // Use as a sentinel
+ (ss-i)->continuationHistory = &this->continuationHistory[0][0][NO_PIECE][0]; // Use as a sentinel
ss->pv = pv;
Depth R = (835 + 70 * depth) / 256 + std::min(int(eval - beta) / 185, 3);
ss->currentMove = MOVE_NULL;
- ss->continuationHistory = &thisThread->continuationHistory[0][NO_PIECE][0];
+ ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0];
pos.do_null_move(st);
probCutCount++;
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[priorCapture][pos.moved_piece(move)][to_sq(move)];
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)];
assert(depth >= 5);
// Update the current move (this must be done after singular extension search)
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[priorCapture][movedPiece][to_sq(move)];
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][movedPiece][to_sq(move)];
// Step 15. Make the move
pos.do_move(move, st, givesCheck);
}
ss->currentMove = move;
- ss->continuationHistory = &thisThread->continuationHistory[priorCapture][pos.moved_piece(move)][to_sq(move)];
+ ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)];
// Make and search the move
pos.do_move(move, st, givesCheck);
mainHistory.fill(0);
captureHistory.fill(0);
- for (StatsType c : { NoCaptures, Captures })
- for (auto& to : continuationHistory[c])
- for (auto& h : to)
- h->fill(0);
-
- for (StatsType c : { NoCaptures, Captures })
- continuationHistory[c][NO_PIECE][0]->fill(Search::CounterMovePruneThreshold - 1);
+ for (bool inCheck : { false, true })
+ for (StatsType c : { NoCaptures, Captures })
+ for (auto& to : continuationHistory[inCheck][c])
+ for (auto& h : to)
+ h->fill(0);
+
+ for (bool inCheck : { false, true })
+ for (StatsType c : { NoCaptures, Captures })
+ continuationHistory[inCheck][c][NO_PIECE][0]->fill(Search::CounterMovePruneThreshold - 1);
}
/// Thread::start_searching() wakes up the thread that will start the search
CounterMoveHistory counterMoves;
ButterflyHistory mainHistory;
CapturePieceToHistory captureHistory;
- ContinuationHistory continuationHistory[2];
+ ContinuationHistory continuationHistory[2][2];
Score contempt;
};