Merge pull request #40 from rektdie/history_malus
added history malus | bench 3309645
This commit was merged in pull request #40.
This commit is contained in:
1 file changed
+13
-1
+13
-1
@@ -244,6 +244,8 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
SearchResults results(-inf);
|
SearchResults results(-inf);
|
||||||
|
|
||||||
int moveSeen = 0;
|
int moveSeen = 0;
|
||||||
|
std::array<Move, MAX_MOVES> seenQuiets;
|
||||||
|
int seenQuietsCount = 0;
|
||||||
|
|
||||||
// For all moves
|
// For all moves
|
||||||
for (int i = 0; i < board.currentMoveIndex; i++) {
|
for (int i = 0; i < board.currentMoveIndex; i++) {
|
||||||
@@ -289,6 +291,11 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
|
|
||||||
if (searchStopped) return 0;
|
if (searchStopped) return 0;
|
||||||
|
|
||||||
|
if (currMove.IsQuiet()) {
|
||||||
|
seenQuiets[seenQuietsCount] = currMove;
|
||||||
|
seenQuietsCount++;
|
||||||
|
}
|
||||||
|
|
||||||
moveSeen++;
|
moveSeen++;
|
||||||
positionIndex--;
|
positionIndex--;
|
||||||
|
|
||||||
@@ -298,8 +305,13 @@ SearchResults PVS(Board board, int depth, int alpha, int beta, int ply) {
|
|||||||
killerMoves[1][ply] = killerMoves[0][ply];
|
killerMoves[1][ply] = killerMoves[0][ply];
|
||||||
killerMoves[0][ply] = currMove;
|
killerMoves[0][ply] = currMove;
|
||||||
|
|
||||||
|
int bonus = depth * depth;
|
||||||
|
|
||||||
history.Update(board.sideToMove, currMove, depth * depth);
|
history.Update(board.sideToMove, currMove, bonus);
|
||||||
|
|
||||||
|
for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) {
|
||||||
|
history.Update(board.sideToMove, seenQuiets[moveIndex], -bonus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TT.WriteEntry(board.hashKey, depth, score, CutNode, Move());
|
TT.WriteEntry(board.hashKey, depth, score, CutNode, Move());
|
||||||
|
|||||||
Reference in new issue
Block a user