temporarily removed 2ply conthist | bench 24146828
This commit is contained in:
1 parent
b74f6f4cbb
commit
092ca2a2d1
2 files changed
+35
-2
No files matched your search
+34
-2
@@ -32,6 +32,16 @@ int16_t ContHistory::GetOnePly(Board& board, Move& move, SearchContext* ctx, int
|
|||||||
return ctx->conthist[otherColor][prevType][prevTo][board.sideToMove][pieceType][to];
|
return ctx->conthist[otherColor][prevType][prevTo][board.sideToMove][pieceType][to];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int16_t ContHistory::GetTwoPly(Board& board, Move& move, SearchContext* ctx, int ply) {
|
||||||
|
int prevType = ctx->ss[ply-2].pieceType;
|
||||||
|
int prevTo = ctx->ss[ply-2].moveTo;
|
||||||
|
int pieceType = board.GetPieceType(move.MoveFrom());
|
||||||
|
int to = move.MoveTo();
|
||||||
|
bool otherColor = ctx->ss[ply-2].side;
|
||||||
|
|
||||||
|
return ctx->conthist[otherColor][prevType][prevTo][board.sideToMove][pieceType][to];
|
||||||
|
}
|
||||||
|
|
||||||
static int ScoreMove(Board &board, Move &move, int ply, SearchContext* ctx) {
|
static int ScoreMove(Board &board, Move &move, int ply, SearchContext* ctx) {
|
||||||
TTEntry *current = ctx->TT.GetRawEntry(board.hashKey);
|
TTEntry *current = ctx->TT.GetRawEntry(board.hashKey);
|
||||||
if (current->hashKey == board.hashKey && current->bestMove == move) {
|
if (current->hashKey == board.hashKey && current->bestMove == move) {
|
||||||
@@ -58,6 +68,11 @@ static int ScoreMove(Board &board, Move &move, int ply, SearchContext* ctx) {
|
|||||||
|
|
||||||
if (ply > 0) {
|
if (ply > 0) {
|
||||||
conthistScore = ctx->conthist.GetOnePly(board, move, ctx, ply);
|
conthistScore = ctx->conthist.GetOnePly(board, move, ctx, ply);
|
||||||
|
/*
|
||||||
|
if (ply > 1) {
|
||||||
|
conthistScore += ctx->conthist.GetTwoPly(board, move, ctx, ply);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return 20000 + historyScore + conthistScore;
|
return 20000 + historyScore + conthistScore;
|
||||||
@@ -542,11 +557,28 @@ SearchResults PVS(Board& board, int depth, int alpha, int beta, int ply, SearchC
|
|||||||
|
|
||||||
// Malus
|
// Malus
|
||||||
for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) {
|
for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) {
|
||||||
pieceType = board.GetPieceType(seenQuiets[moveIndex].MoveFrom());
|
int pieceType = board.GetPieceType(seenQuiets[moveIndex].MoveFrom());
|
||||||
to = seenQuiets[moveIndex].MoveTo();
|
int to = seenQuiets[moveIndex].MoveTo();
|
||||||
|
|
||||||
ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -bonus);
|
ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -bonus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ply > 1) {
|
||||||
|
prevType = ctx->ss[ply-2].pieceType;
|
||||||
|
prevTo = ctx->ss[ply-2].moveTo;
|
||||||
|
otherColor = ctx->ss[ply-2].side;
|
||||||
|
|
||||||
|
ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, bonus);
|
||||||
|
|
||||||
|
// Malus
|
||||||
|
for (int moveIndex = 0; moveIndex < seenQuietsCount - 1; moveIndex++) {
|
||||||
|
int pieceType = board.GetPieceType(seenQuiets[moveIndex].MoveFrom());
|
||||||
|
int to = seenQuiets[moveIndex].MoveTo();
|
||||||
|
|
||||||
|
ctx->conthist.Update(board.sideToMove, otherColor, prevType, prevTo, pieceType, to, -bonus);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int16_t GetOnePly(Board& board, Move& move, SearchContext* ctx, int ply);
|
int16_t GetOnePly(Board& board, Move& move, SearchContext* ctx, int ply);
|
||||||
|
int16_t GetTwoPly(Board& board, Move& move, SearchContext* ctx, int ply);
|
||||||
|
|
||||||
auto& operator[](int index) {
|
auto& operator[](int index) {
|
||||||
return contHistMoves[index];
|
return contHistMoves[index];
|
||||||
|
|||||||
Reference in new issue
Block a user