mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 20:57:10 +00:00
Merge commit '432995ad82119070afa0bf720eb65d800bcbf817' into cluster
This is the last commit before there are more conflicts.
This commit is contained in:
@@ -744,7 +744,6 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
|
||||
// Update board and piece lists
|
||||
remove_piece(capsq);
|
||||
|
||||
// Update material hash key and prefetch access to materialTable
|
||||
k ^= Zobrist::psq[captured][capsq];
|
||||
st->materialKey ^= Zobrist::psq[captured][pieceCount[captured]];
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ Score::Score(Value v, const Position& pos) {
|
||||
else if (std::abs(v) <= VALUE_TB)
|
||||
{
|
||||
auto distance = VALUE_TB - std::abs(v);
|
||||
score = (v > 0) ? TBWin{distance} : TBWin{-distance};
|
||||
score = (v > 0) ? Tablebase{distance, true} : Tablebase{-distance, false};
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+4
-3
@@ -34,8 +34,9 @@ class Score {
|
||||
int plies;
|
||||
};
|
||||
|
||||
struct TBWin {
|
||||
int plies;
|
||||
struct Tablebase {
|
||||
int plies;
|
||||
bool win;
|
||||
};
|
||||
|
||||
struct InternalUnits {
|
||||
@@ -61,7 +62,7 @@ class Score {
|
||||
}
|
||||
|
||||
private:
|
||||
std::variant<Mate, TBWin, InternalUnits> score;
|
||||
std::variant<Mate, Tablebase, InternalUnits> score;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -1135,7 +1135,7 @@ moves_loop: // When in check, search starts here
|
||||
extension = -1;
|
||||
}
|
||||
|
||||
// Recapture extensions (~0 Elo on STC, ~1 Elo on LTC)
|
||||
// Extension for capturing the previous moved piece (~0 Elo on STC, ~1 Elo on LTC)
|
||||
else if (PvNode && move == ttMove && move.to_sq() == prevSq
|
||||
&& thisThread->captureHistory[movedPiece][move.to_sq()]
|
||||
[type_of(pos.piece_on(move.to_sq()))]
|
||||
@@ -1199,7 +1199,7 @@ moves_loop: // When in check, search starts here
|
||||
{
|
||||
// In general we want to cap the LMR depth search at newDepth, but when
|
||||
// reduction is negative, we allow this move a limited search extension
|
||||
// beyond the first move depth. This may lead to hidden multiple extensions.
|
||||
// beyond the first move depth.
|
||||
// To prevent problems when the max value is less than the min value,
|
||||
// std::clamp has been replaced by a more robust implementation.
|
||||
Depth d = std::max(1, std::min(newDepth - r, newDepth + 1));
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ uint8_t TTEntry::relative_age(const uint8_t generation8) const {
|
||||
|
||||
|
||||
// Sets the size of the transposition table,
|
||||
// measured in megabytes. Transposition table consists of a power of 2 number
|
||||
// measured in megabytes. Transposition table consists
|
||||
// of clusters and each cluster consists of ClusterSize number of TTEntry.
|
||||
void TranspositionTable::resize(size_t mbSize, int threadCount) {
|
||||
aligned_large_pages_free(table);
|
||||
|
||||
+3
-3
@@ -363,9 +363,9 @@ std::string UCIEngine::format_score(const Score& s) {
|
||||
auto m = (mate.plies > 0 ? (mate.plies + 1) : mate.plies) / 2;
|
||||
return std::string("mate ") + std::to_string(m);
|
||||
},
|
||||
[](Score::TBWin tb) -> std::string {
|
||||
[](Score::Tablebase tb) -> std::string {
|
||||
return std::string("cp ")
|
||||
+ std::to_string((tb.plies > 0 ? TB_CP - tb.plies : -TB_CP - tb.plies));
|
||||
+ std::to_string((tb.win ? TB_CP - tb.plies : -TB_CP - tb.plies));
|
||||
},
|
||||
[](Score::InternalUnits units) -> std::string {
|
||||
return std::string("cp ") + std::to_string(units.value);
|
||||
@@ -441,7 +441,7 @@ Move UCIEngine::to_move(const Position& pos, std::string str) {
|
||||
}
|
||||
|
||||
void UCIEngine::on_update_no_moves(const Engine::InfoShort& info) {
|
||||
sync_cout << "info depth" << info.depth << " score " << format_score(info.score) << sync_endl;
|
||||
sync_cout << "info depth " << info.depth << " score " << format_score(info.score) << sync_endl;
|
||||
}
|
||||
|
||||
void UCIEngine::on_update_full(const Engine::InfoFull& info, bool showWDL) {
|
||||
|
||||
Reference in New Issue
Block a user