@@ -290,7 +290,7 @@ void Thread::search() {
290290
291291 std::memset (ss-4 , 0 , 7 * sizeof (Stack));
292292 for (int i = 4 ; i > 0 ; i--)
293- (ss-i)->contHistory = this ->contHistory [NO_PIECE][0 ].get (); // Use as sentinel
293+ (ss-i)->continuationHistory = this ->continuationHistory [NO_PIECE][0 ].get (); // Use as sentinel
294294
295295 bestValue = delta = alpha = -VALUE_INFINITE;
296296 beta = VALUE_INFINITE;
@@ -587,7 +587,7 @@ namespace {
587587
588588 (ss+1 )->ply = ss->ply + 1 ;
589589 ss->currentMove = (ss+1 )->excludedMove = bestMove = MOVE_NONE;
590- ss->contHistory = thisThread->contHistory [NO_PIECE][0 ].get ();
590+ ss->continuationHistory = thisThread->continuationHistory [NO_PIECE][0 ].get ();
591591 (ss+2 )->killers [0 ] = (ss+2 )->killers [1 ] = MOVE_NONE;
592592 Square prevSq = to_sq ((ss-1 )->currentMove );
593593
@@ -751,7 +751,7 @@ namespace {
751751 Depth R = ((823 + 67 * depth / ONE_PLY) / 256 + std::min ((eval - beta) / PawnValueMg, 3 )) * ONE_PLY;
752752
753753 ss->currentMove = MOVE_NULL;
754- ss->contHistory = thisThread->contHistory [NO_PIECE][0 ].get ();
754+ ss->continuationHistory = thisThread->continuationHistory [NO_PIECE][0 ].get ();
755755
756756 pos.do_null_move (st);
757757
@@ -802,7 +802,7 @@ namespace {
802802 probCutCount++;
803803
804804 ss->currentMove = move;
805- ss->contHistory = thisThread->contHistory [pos.moved_piece (move)][to_sq (move)].get ();
805+ ss->continuationHistory = thisThread->continuationHistory [pos.moved_piece (move)][to_sq (move)].get ();
806806
807807 assert (depth >= 5 * ONE_PLY);
808808
@@ -835,7 +835,7 @@ namespace {
835835
836836moves_loop: // When in check, search starts from here
837837
838- const PieceToHistory* contHist[] = { (ss-1 )->contHistory , (ss-2 )->contHistory , nullptr , (ss-4 )->contHistory };
838+ const PieceToHistory* contHist[] = { (ss-1 )->continuationHistory , (ss-2 )->continuationHistory , nullptr , (ss-4 )->continuationHistory };
839839 Move countermove = thisThread->counterMoves [pos.piece_on (prevSq)][prevSq];
840840
841841 MovePicker mp (pos, ttMove, depth, &thisThread->mainHistory ,
@@ -970,7 +970,7 @@ namespace {
970970
971971 // Update the current move (this must be done after singular extension search)
972972 ss->currentMove = move;
973- ss->contHistory = thisThread->contHistory [movedPiece][to_sq (move)].get ();
973+ ss->continuationHistory = thisThread->continuationHistory [movedPiece][to_sq (move)].get ();
974974
975975 // Step 15. Make the move
976976 pos.do_move (move, st, givesCheck);
@@ -1212,8 +1212,10 @@ namespace {
12121212 ss->pv [0 ] = MOVE_NONE;
12131213 }
12141214
1215+ Thread* thisThread = pos.this_thread ();
12151216 (ss+1 )->ply = ss->ply + 1 ;
12161217 ss->currentMove = bestMove = MOVE_NONE;
1218+ ss->continuationHistory = thisThread->continuationHistory [NO_PIECE][0 ].get ();
12171219 inCheck = pos.checkers ();
12181220 moveCount = 0 ;
12191221
@@ -1283,12 +1285,15 @@ namespace {
12831285 futilityBase = bestValue + 128 ;
12841286 }
12851287
1288+ const PieceToHistory* contHist[] = { (ss-1 )->continuationHistory , (ss-2 )->continuationHistory , nullptr , (ss-4 )->continuationHistory };
1289+
12861290 // Initialize a MovePicker object for the current position, and prepare
12871291 // to search the moves. Because the depth is <= 0 here, only captures,
12881292 // queen promotions and checks (only if depth >= DEPTH_QS_CHECKS) will
12891293 // be generated.
1290- MovePicker mp (pos, ttMove, depth, &pos.this_thread ()->mainHistory ,
1291- &pos.this_thread ()->captureHistory ,
1294+ MovePicker mp (pos, ttMove, depth, &thisThread->mainHistory ,
1295+ &thisThread->captureHistory ,
1296+ contHist,
12921297 to_sq ((ss-1 )->currentMove ));
12931298
12941299 // Loop through the moves until no moves remain or a beta cutoff occurs
@@ -1345,6 +1350,7 @@ namespace {
13451350 }
13461351
13471352 ss->currentMove = move;
1353+ ss->continuationHistory = thisThread->continuationHistory [pos.moved_piece (move)][to_sq (move)].get ();
13481354
13491355 // Make and search the move
13501356 pos.do_move (move, st, givesCheck);
@@ -1436,7 +1442,7 @@ namespace {
14361442
14371443 for (int i : {1 , 2 , 4 })
14381444 if (is_ok ((ss-i)->currentMove ))
1439- (*(ss-i)->contHistory )[pc][to] << bonus;
1445+ (*(ss-i)->continuationHistory )[pc][to] << bonus;
14401446 }
14411447
14421448
0 commit comments