Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more continuation histories. #4827

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/movepick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void MovePicker::score() {
m.value = 2 * (*mainHistory)[pos.side_to_move()][from_to(m)];
m.value += 2 * (*continuationHistory[0])[pc][to];
m.value += (*continuationHistory[1])[pc][to];
m.value += (*continuationHistory[2])[pc][to] / 4;
m.value += (*continuationHistory[3])[pc][to];
m.value += (*continuationHistory[5])[pc][to];

Expand Down
8 changes: 4 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ namespace {
return probCutBeta;

const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
nullptr , (ss-4)->continuationHistory,
(ss-3)->continuationHistory, (ss-4)->continuationHistory,
nullptr , (ss-6)->continuationHistory };

Move countermove = prevSq != SQ_NONE ? thisThread->counterMoves[pos.piece_on(prevSq)][prevSq] : MOVE_NONE;
Expand Down Expand Up @@ -1511,7 +1511,7 @@ namespace {
}

const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
nullptr , (ss-4)->continuationHistory,
(ss-3)->continuationHistory, (ss-4)->continuationHistory,
nullptr , (ss-6)->continuationHistory };

// Initialize a MovePicker object for the current position, and prepare
Expand Down Expand Up @@ -1768,13 +1768,13 @@ namespace {

void update_continuation_histories(Stack* ss, Piece pc, Square to, int bonus) {

for (int i : {1, 2, 4, 6})
for (int i : {1, 2, 3, 4, 6})
{
// Only update the first 2 continuation histories if we are in check
if (ss->inCheck && i > 2)
break;
if (is_ok((ss-i)->currentMove))
(*(ss-i)->continuationHistory)[pc][to] << bonus;
(*(ss-i)->continuationHistory)[pc][to] << bonus / (1 + 3 * (i == 3));
}
}

Expand Down