@@ -290,7 +290,7 @@ void Thread::search() {
290
290
291
291
std::memset (ss-4 , 0 , 7 * sizeof (Stack));
292
292
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
294
294
295
295
bestValue = delta = alpha = -VALUE_INFINITE;
296
296
beta = VALUE_INFINITE;
@@ -587,7 +587,7 @@ namespace {
587
587
588
588
(ss+1 )->ply = ss->ply + 1 ;
589
589
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 ();
591
591
(ss+2 )->killers [0 ] = (ss+2 )->killers [1 ] = MOVE_NONE;
592
592
Square prevSq = to_sq ((ss-1 )->currentMove );
593
593
@@ -751,7 +751,7 @@ namespace {
751
751
Depth R = ((823 + 67 * depth / ONE_PLY) / 256 + std::min ((eval - beta) / PawnValueMg, 3 )) * ONE_PLY;
752
752
753
753
ss->currentMove = MOVE_NULL;
754
- ss->contHistory = thisThread->contHistory [NO_PIECE][0 ].get ();
754
+ ss->continuationHistory = thisThread->continuationHistory [NO_PIECE][0 ].get ();
755
755
756
756
pos.do_null_move (st);
757
757
@@ -802,7 +802,7 @@ namespace {
802
802
probCutCount++;
803
803
804
804
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 ();
806
806
807
807
assert (depth >= 5 * ONE_PLY);
808
808
@@ -835,7 +835,7 @@ namespace {
835
835
836
836
moves_loop: // When in check, search starts from here
837
837
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 };
839
839
Move countermove = thisThread->counterMoves [pos.piece_on (prevSq)][prevSq];
840
840
841
841
MovePicker mp (pos, ttMove, depth, &thisThread->mainHistory ,
@@ -970,7 +970,7 @@ namespace {
970
970
971
971
// Update the current move (this must be done after singular extension search)
972
972
ss->currentMove = move;
973
- ss->contHistory = thisThread->contHistory [movedPiece][to_sq (move)].get ();
973
+ ss->continuationHistory = thisThread->continuationHistory [movedPiece][to_sq (move)].get ();
974
974
975
975
// Step 15. Make the move
976
976
pos.do_move (move, st, givesCheck);
@@ -1212,8 +1212,10 @@ namespace {
1212
1212
ss->pv [0 ] = MOVE_NONE;
1213
1213
}
1214
1214
1215
+ Thread* thisThread = pos.this_thread ();
1215
1216
(ss+1 )->ply = ss->ply + 1 ;
1216
1217
ss->currentMove = bestMove = MOVE_NONE;
1218
+ ss->continuationHistory = thisThread->continuationHistory [NO_PIECE][0 ].get ();
1217
1219
inCheck = pos.checkers ();
1218
1220
moveCount = 0 ;
1219
1221
@@ -1283,12 +1285,15 @@ namespace {
1283
1285
futilityBase = bestValue + 128 ;
1284
1286
}
1285
1287
1288
+ const PieceToHistory* contHist[] = { (ss-1 )->continuationHistory , (ss-2 )->continuationHistory , nullptr , (ss-4 )->continuationHistory };
1289
+
1286
1290
// Initialize a MovePicker object for the current position, and prepare
1287
1291
// to search the moves. Because the depth is <= 0 here, only captures,
1288
1292
// queen promotions and checks (only if depth >= DEPTH_QS_CHECKS) will
1289
1293
// 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,
1292
1297
to_sq ((ss-1 )->currentMove ));
1293
1298
1294
1299
// Loop through the moves until no moves remain or a beta cutoff occurs
@@ -1345,6 +1350,7 @@ namespace {
1345
1350
}
1346
1351
1347
1352
ss->currentMove = move;
1353
+ ss->continuationHistory = thisThread->continuationHistory [pos.moved_piece (move)][to_sq (move)].get ();
1348
1354
1349
1355
// Make and search the move
1350
1356
pos.do_move (move, st, givesCheck);
@@ -1436,7 +1442,7 @@ namespace {
1436
1442
1437
1443
for (int i : {1 , 2 , 4 })
1438
1444
if (is_ok ((ss-i)->currentMove ))
1439
- (*(ss-i)->contHistory )[pc][to] << bonus;
1445
+ (*(ss-i)->continuationHistory )[pc][to] << bonus;
1440
1446
}
1441
1447
1442
1448
0 commit comments