mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
most-merge fixes
This commit is contained in:
+2
-2
@@ -1189,7 +1189,7 @@ std::string Eval::trace(Position& pos) {
|
|||||||
<< "| Total | " << Term(TOTAL)
|
<< "| Total | " << Term(TOTAL)
|
||||||
<< "+------------+-------------+-------------+-------------+\n";
|
<< "+------------+-------------+-------------+-------------+\n";
|
||||||
|
|
||||||
if (Eval::useNNUE)
|
if (NNUE::useNNUE != NNUE::UseNNUEMode::False)
|
||||||
ss << '\n' << NNUE::trace(pos) << '\n';
|
ss << '\n' << NNUE::trace(pos) << '\n';
|
||||||
|
|
||||||
ss << std::showpoint << std::showpos << std::fixed << std::setprecision(2) << std::setw(15);
|
ss << std::showpoint << std::showpos << std::fixed << std::setprecision(2) << std::setw(15);
|
||||||
@@ -1206,7 +1206,7 @@ std::string Eval::trace(Position& pos) {
|
|||||||
v = evaluate(pos);
|
v = evaluate(pos);
|
||||||
v = pos.side_to_move() == WHITE ? v : -v;
|
v = pos.side_to_move() == WHITE ? v : -v;
|
||||||
ss << "Final evaluation " << to_cp(v) << " (white side)";
|
ss << "Final evaluation " << to_cp(v) << " (white side)";
|
||||||
if (Eval::useNNUE)
|
if (NNUE::useNNUE != NNUE::UseNNUEMode::False)
|
||||||
ss << " [with scaled NNUE, hybrid, ...]";
|
ss << " [with scaled NNUE, hybrid, ...]";
|
||||||
ss << "\n";
|
ss << "\n";
|
||||||
|
|
||||||
|
|||||||
+2
-14
@@ -1968,20 +1968,8 @@ namespace Search
|
|||||||
// Clear all history types. This initialization takes a little time, and the accuracy of the search is rather low, so the good and bad are not well understood.
|
// Clear all history types. This initialization takes a little time, and the accuracy of the search is rather low, so the good and bad are not well understood.
|
||||||
// th->clear();
|
// th->clear();
|
||||||
|
|
||||||
int ct = int(Options["Contempt"]) * PawnValueEg / 100; // From centipawns
|
|
||||||
Color us = pos.side_to_move();
|
|
||||||
|
|
||||||
// In analysis mode, adjust contempt in accordance with user preference
|
|
||||||
if (Limits.infinite || Options["UCI_AnalyseMode"])
|
|
||||||
ct = Options["Analysis Contempt"] == "Off" ? 0
|
|
||||||
: Options["Analysis Contempt"] == "Both" ? ct
|
|
||||||
: Options["Analysis Contempt"] == "White" && us == BLACK ? -ct
|
|
||||||
: Options["Analysis Contempt"] == "Black" && us == WHITE ? -ct
|
|
||||||
: ct;
|
|
||||||
|
|
||||||
// Evaluation score is from the white point of view
|
// Evaluation score is from the white point of view
|
||||||
th->contempt = (us == WHITE ? make_score(ct, ct / 2)
|
th->trend = make_score(0, 0);
|
||||||
: -make_score(ct, ct / 2));
|
|
||||||
|
|
||||||
for (int i = 7; i > 0; i--)
|
for (int i = 7; i > 0; i--)
|
||||||
(ss - i)->continuationHistory = &th->continuationHistory[0][0][NO_PIECE][0]; // Use as a sentinel
|
(ss - i)->continuationHistory = &th->continuationHistory[0][0][NO_PIECE][0]; // Use as a sentinel
|
||||||
@@ -2144,7 +2132,7 @@ namespace Search
|
|||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Depth adjustedDepth = std::max(1, rootDepth);
|
Depth adjustedDepth = std::max(1, rootDepth);
|
||||||
bestValue = Stockfish::search<PV>(pos, ss, alpha, beta, adjustedDepth, false);
|
bestValue = Stockfish::search<Root>(pos, ss, alpha, beta, adjustedDepth, false);
|
||||||
|
|
||||||
stable_sort(rootMoves.begin() + pvIdx, rootMoves.end());
|
stable_sort(rootMoves.begin() + pvIdx, rootMoves.end());
|
||||||
//my_stable_sort(pos.this_thread()->thread_id(),&rootMoves[0] + pvIdx, rootMoves.size() - pvIdx);
|
//my_stable_sort(pos.this_thread()->thread_id(),&rootMoves[0] + pvIdx, rootMoves.size() - pvIdx);
|
||||||
|
|||||||
@@ -260,8 +260,8 @@ namespace Stockfish::Tools {
|
|||||||
|
|
||||||
pos.clear();
|
pos.clear();
|
||||||
std::memset(si, 0, sizeof(StateInfo));
|
std::memset(si, 0, sizeof(StateInfo));
|
||||||
si->accumulator.state[WHITE] = Eval::NNUE::INIT;
|
si->accumulator.computed[WHITE] = false;
|
||||||
si->accumulator.state[BLACK] = Eval::NNUE::INIT;
|
si->accumulator.computed[BLACK] = false;
|
||||||
pos.st = si;
|
pos.st = si;
|
||||||
|
|
||||||
// Active color
|
// Active color
|
||||||
|
|||||||
@@ -812,10 +812,8 @@ namespace Stockfish::Tools
|
|||||||
is >> params.seed;
|
is >> params.seed;
|
||||||
else if (token == "set_recommended_uci_options")
|
else if (token == "set_recommended_uci_options")
|
||||||
{
|
{
|
||||||
UCI::setoption("Contempt", "0");
|
|
||||||
UCI::setoption("Skill Level", "20");
|
UCI::setoption("Skill Level", "20");
|
||||||
UCI::setoption("UCI_Chess960", "false");
|
UCI::setoption("UCI_Chess960", "false");
|
||||||
UCI::setoption("UCI_AnalyseMode", "false");
|
|
||||||
UCI::setoption("UCI_LimitStrength", "false");
|
UCI::setoption("UCI_LimitStrength", "false");
|
||||||
UCI::setoption("PruneAtShallowDepth", "false");
|
UCI::setoption("PruneAtShallowDepth", "false");
|
||||||
UCI::setoption("EnableTranspositionTable", "true");
|
UCI::setoption("EnableTranspositionTable", "true");
|
||||||
|
|||||||
@@ -434,10 +434,8 @@ namespace Stockfish::Tools
|
|||||||
params.smart_fen_skipping = true;
|
params.smart_fen_skipping = true;
|
||||||
else if (token == "set_recommended_uci_options")
|
else if (token == "set_recommended_uci_options")
|
||||||
{
|
{
|
||||||
UCI::setoption("Contempt", "0");
|
|
||||||
UCI::setoption("Skill Level", "20");
|
UCI::setoption("Skill Level", "20");
|
||||||
UCI::setoption("UCI_Chess960", "false");
|
UCI::setoption("UCI_Chess960", "false");
|
||||||
UCI::setoption("UCI_AnalyseMode", "false");
|
|
||||||
UCI::setoption("UCI_LimitStrength", "false");
|
UCI::setoption("UCI_LimitStrength", "false");
|
||||||
UCI::setoption("PruneAtShallowDepth", "false");
|
UCI::setoption("PruneAtShallowDepth", "false");
|
||||||
UCI::setoption("EnableTranspositionTable", "true");
|
UCI::setoption("EnableTranspositionTable", "true");
|
||||||
|
|||||||
+5
-4
@@ -198,6 +198,10 @@ namespace {
|
|||||||
<< "\nNodes/second : " << 1000 * nodes / elapsed << endl;
|
<< "\nNodes/second : " << 1000 * nodes / elapsed << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
namespace UCI {
|
||||||
|
|
||||||
void setoption(const std::string& name, const std::string& value)
|
void setoption(const std::string& name, const std::string& value)
|
||||||
{
|
{
|
||||||
if (Options.count(name))
|
if (Options.count(name))
|
||||||
@@ -221,9 +225,6 @@ namespace {
|
|||||||
double a = (((as[0] * m + as[1]) * m + as[2]) * m) + as[3];
|
double a = (((as[0] * m + as[1]) * m + as[2]) * m) + as[3];
|
||||||
double b = (((bs[0] * m + bs[1]) * m + bs[2]) * m) + bs[3];
|
double b = (((bs[0] * m + bs[1]) * m + bs[2]) * m) + bs[3];
|
||||||
|
|
||||||
// Transform eval to centipawns with limited range
|
|
||||||
double x = std::clamp(double(100 * v) / PawnValueEg, -2000.0, 2000.0);
|
|
||||||
|
|
||||||
// Transform eval to centipawns with limited range
|
// Transform eval to centipawns with limited range
|
||||||
double x = std::clamp(double(100 * v) / PawnValueEg, -1000.0, 1000.0);
|
double x = std::clamp(double(100 * v) / PawnValueEg, -1000.0, 1000.0);
|
||||||
|
|
||||||
@@ -332,7 +333,7 @@ void UCI::loop(int argc, char* argv[]) {
|
|||||||
Eval::NNUE::save_eval(filename);
|
Eval::NNUE::save_eval(filename);
|
||||||
}
|
}
|
||||||
else if (token == "generate_training_data") Tools::generate_training_data(is);
|
else if (token == "generate_training_data") Tools::generate_training_data(is);
|
||||||
else if (token == "generate_training_data") Tools::generate_training_data_nonpv(is);
|
else if (token == "generate_training_data_nonpv") Tools::generate_training_data_nonpv(is);
|
||||||
else if (token == "convert") Tools::convert(is);
|
else if (token == "convert") Tools::convert(is);
|
||||||
else if (token == "validate_training_data") Tools::validate_training_data(is);
|
else if (token == "validate_training_data") Tools::validate_training_data(is);
|
||||||
else if (token == "convert_bin") Tools::convert_bin(is);
|
else if (token == "convert_bin") Tools::convert_bin(is);
|
||||||
|
|||||||
Reference in New Issue
Block a user