mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
Merge branch 'master' of github.com:official-stockfish/Stockfish into nnue-player-merge
# Conflicts: # README.md # Readme.md # src/Makefile # src/evaluate.cpp # src/evaluate.h # src/misc.cpp # src/nnue/architectures/halfkp_256x2-32-32.h # src/nnue/evaluate_nnue.cpp # src/nnue/evaluate_nnue.h # src/nnue/features/feature_set.h # src/nnue/features/features_common.h # src/nnue/features/half_kp.cpp # src/nnue/features/half_kp.h # src/nnue/features/index_list.h # src/nnue/layers/affine_transform.h # src/nnue/layers/clipped_relu.h # src/nnue/layers/input_slice.h # src/nnue/nnue_accumulator.h # src/nnue/nnue_architecture.h # src/nnue/nnue_common.h # src/nnue/nnue_feature_transformer.h # src/position.cpp # src/position.h # src/types.h # src/ucioption.cpp # stockfish.md
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
/*
|
||||
Stockfish, a UCI chess playing engine derived from Glaurung 2.1
|
||||
Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
|
||||
Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad
|
||||
Copyright (C) 2015-2020 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
|
||||
Copyright (C) 2004-2020 The Stockfish developers (see AUTHORS file)
|
||||
|
||||
Stockfish is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -227,6 +225,8 @@ void MainThread::search() {
|
||||
Time.init(Limits, us, rootPos.game_ply());
|
||||
TT.new_search();
|
||||
|
||||
Eval::verify_NNUE();
|
||||
|
||||
if (rootMoves.empty())
|
||||
{
|
||||
rootMoves.emplace_back(MOVE_NONE);
|
||||
@@ -925,9 +925,12 @@ namespace {
|
||||
|
||||
if (value >= probcutBeta)
|
||||
{
|
||||
tte->save(posKey, value_to_tt(value, ss->ply), ttPv,
|
||||
BOUND_LOWER,
|
||||
depth - 3, move, ss->staticEval);
|
||||
if ( !(ttHit
|
||||
&& tte->depth() >= depth - 3
|
||||
&& ttValue != VALUE_NONE))
|
||||
tte->save(posKey, value_to_tt(value, ss->ply), ttPv,
|
||||
BOUND_LOWER,
|
||||
depth - 3, move, ss->staticEval);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -983,6 +986,10 @@ moves_loop: // When in check, search starts from here
|
||||
thisThread->rootMoves.begin() + thisThread->pvLast, move))
|
||||
continue;
|
||||
|
||||
// Check for legality
|
||||
if (!rootNode && !pos.legal(move))
|
||||
continue;
|
||||
|
||||
ss->moveCount = ++moveCount;
|
||||
|
||||
if (rootNode && thisThread == Threads.main() && Time.elapsed() > 3000 && !Limits.silent)
|
||||
@@ -1064,7 +1071,7 @@ moves_loop: // When in check, search starts from here
|
||||
// search of (alpha-s, beta-s), and just one fails high on (alpha, beta),
|
||||
// then that move is singular and should be extended. To verify this we do
|
||||
// a reduced search on all the other moves but the ttMove and if the
|
||||
// result is lower than ttValue minus a margin then we will extend the ttMove.
|
||||
// result is lower than ttValue minus a margin, then we will extend the ttMove.
|
||||
if ( depth >= 6
|
||||
&& move == ttMove
|
||||
&& !rootNode
|
||||
@@ -1128,25 +1135,12 @@ moves_loop: // When in check, search starts from here
|
||||
if (type_of(move) == CASTLING)
|
||||
extension = 1;
|
||||
|
||||
// Late irreversible move extension
|
||||
if ( move == ttMove
|
||||
&& pos.rule50_count() > 80
|
||||
&& (captureOrPromotion || type_of(movedPiece) == PAWN))
|
||||
extension = 2;
|
||||
|
||||
// Add extension to new depth
|
||||
newDepth += extension;
|
||||
|
||||
// Speculative prefetch as early as possible
|
||||
prefetch(TT.first_entry(pos.key_after(move)));
|
||||
|
||||
// Check for legality just before making the move
|
||||
if (!rootNode && !pos.legal(move))
|
||||
{
|
||||
ss->moveCount = --moveCount;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update the current move (this must be done after singular extension search)
|
||||
ss->currentMove = move;
|
||||
ss->continuationHistory = &thisThread->continuationHistory[ss->inCheck]
|
||||
@@ -1170,6 +1164,13 @@ moves_loop: // When in check, search starts from here
|
||||
{
|
||||
Depth r = reduction(improving, depth, moveCount);
|
||||
|
||||
// Decrease reduction at non-check cut nodes for second move at low depths
|
||||
if ( cutNode
|
||||
&& depth <= 10
|
||||
&& moveCount <= 2
|
||||
&& !ss->inCheck)
|
||||
r--;
|
||||
|
||||
// Decrease reduction if the ttHit running average is large
|
||||
if (thisThread->ttHitAverage > 473 * TtHitAverageResolution * TtHitAverageWindow / 1024)
|
||||
r--;
|
||||
|
||||
Reference in New Issue
Block a user