diff --git a/src/history.h b/src/history.h index 15095cd0bbc..4543fc55ed2 100644 --- a/src/history.h +++ b/src/history.h @@ -138,7 +138,7 @@ enum CorrHistType { Pawn, // By color and pawn structure Major, // By color and positions of major pieces (Queen, Rook) and King Minor, // By color and positions of minor pieces (Knight, Bishop) and King - NonPawn, // By color and non-pawn material positions + NonPawn, // By Non-pawn material positions and color PieceTo, // By [piece][to] move Continuation, // Combined history of move pairs }; @@ -150,6 +150,11 @@ struct CorrHistTypedef { using type = Stats; }; +template<> +struct CorrHistTypedef { + using type = Stats; +}; + template<> struct CorrHistTypedef { using type = Stats; diff --git a/src/search.cpp b/src/search.cpp index e99d5d3fc9f..4fda3e6aa0a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -83,8 +83,8 @@ int correction_value(const Worker& w, const Position& pos, const Stack* ss) { const auto pcv = w.pawnCorrectionHistory[us][pawn_structure_index(pos)]; const auto macv = w.majorPieceCorrectionHistory[us][major_piece_index(pos)]; const auto micv = w.minorPieceCorrectionHistory[us][minor_piece_index(pos)]; - const auto wnpcv = w.nonPawnCorrectionHistory[WHITE][us][non_pawn_index(pos)]; - const auto bnpcv = w.nonPawnCorrectionHistory[BLACK][us][non_pawn_index(pos)]; + const auto wnpcv = w.nonPawnCorrectionHistory[WHITE][non_pawn_index(pos)][us]; + const auto bnpcv = w.nonPawnCorrectionHistory[BLACK][non_pawn_index(pos)][us]; const auto cntcv = m.is_ok() ? (*(ss - 2)->continuationCorrectionHistory)[pos.piece_on(m.to_sq())][m.to_sq()] : 0; @@ -1446,9 +1446,9 @@ Value Search::Worker::search( << bonus * 114 / 128; thisThread->majorPieceCorrectionHistory[us][major_piece_index(pos)] << bonus * 163 / 128; thisThread->minorPieceCorrectionHistory[us][minor_piece_index(pos)] << bonus * 146 / 128; - thisThread->nonPawnCorrectionHistory[WHITE][us][non_pawn_index(pos)] + thisThread->nonPawnCorrectionHistory[WHITE][non_pawn_index(pos)][us] << bonus * nonPawnWeight / 128; - thisThread->nonPawnCorrectionHistory[BLACK][us][non_pawn_index(pos)] + thisThread->nonPawnCorrectionHistory[BLACK][non_pawn_index(pos)][us] << bonus * nonPawnWeight / 128; if (m.is_ok())