placed qs see above makemove | bench 1302405
This commit is contained in:
1 parent
b3c3182fec
commit
2e952b0f92
1 file changed
+9
-3
+9
-3
@@ -230,6 +230,10 @@ static bool IsDecisive(int score) {
|
|||||||
return std::abs(score) > WIN_SCORE;
|
return std::abs(score) > WIN_SCORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool IsLoss(int score) {
|
||||||
|
return score < -WIN_SCORE;
|
||||||
|
}
|
||||||
|
|
||||||
template <bool isPV, searchMode mode>
|
template <bool isPV, searchMode mode>
|
||||||
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
|
static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, SearchContext* ctx) {
|
||||||
if (ShouldStop<mode>(ctx)) return 0;
|
if (ShouldStop<mode>(ctx)) return 0;
|
||||||
@@ -295,6 +299,7 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
|
|||||||
|
|
||||||
Move currMove;
|
Move currMove;
|
||||||
while ((currMove = mp.Next())) {
|
while ((currMove = mp.Next())) {
|
||||||
|
if (!IsLoss(bestScore)) {
|
||||||
// QS FP
|
// QS FP
|
||||||
if (!board.InCheck() && currMove.IsCapture() &&
|
if (!board.InCheck() && currMove.IsCapture() &&
|
||||||
fpScore <= alpha && !SEE(board, currMove, 1)) {
|
fpScore <= alpha && !SEE(board, currMove, 1)) {
|
||||||
@@ -303,6 +308,10 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SEE(board, currMove, seeQsThreshold))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!board.IsLegal(currMove)) continue;
|
if (!board.IsLegal(currMove)) continue;
|
||||||
Board copy = board;
|
Board copy = board;
|
||||||
copy.MakeMove(currMove);
|
copy.MakeMove(currMove);
|
||||||
@@ -311,9 +320,6 @@ static SearchResults Quiescence(Board& board, int alpha, int beta, int ply, Sear
|
|||||||
ctx->ss[ply].moveTo = currMove.MoveTo();
|
ctx->ss[ply].moveTo = currMove.MoveTo();
|
||||||
ctx->ss[ply].side = board.sideToMove;
|
ctx->ss[ply].side = board.sideToMove;
|
||||||
|
|
||||||
if (!SEE(board, currMove, seeQsThreshold))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (copy.positionIndex >= ctx->positionHistory.size()) {
|
if (copy.positionIndex >= ctx->positionHistory.size()) {
|
||||||
ctx->positionHistory.resize(copy.positionIndex + 100);
|
ctx->positionHistory.resize(copy.positionIndex + 100);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user