From: Fabian Fichter Date: Thu, 3 Sep 2020 22:15:48 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=af89f6a5a2a7b513dca24f6fe15b2b0e94cf10ac;p=fairystockfish.git Merge official-stockfish/master bench: 4839910 --- af89f6a5a2a7b513dca24f6fe15b2b0e94cf10ac diff --cc src/bitboard.cpp index 5e8844a,3bb3ff8..604f746 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@@ -156,15 -49,16 +156,16 @@@ namespace const std::string Bitboards::pretty(Bitboard b) { - std::string s = "+---+---+---+---+---+---+---+---+\n"; + std::string s = "+---+---+---+---+---+---+---+---+---+---+---+---+\n"; - for (Rank r = RANK_8; r >= RANK_1; --r) + for (Rank r = RANK_MAX; r >= RANK_1; --r) { - for (File f = FILE_A; f <= FILE_H; ++f) + for (File f = FILE_A; f <= FILE_MAX; ++f) s += b & make_square(f, r) ? "| X " : "| "; - s += "|\n+---+---+---+---+---+---+---+---+---+---+---+---+\n"; - s += "| " + std::to_string(1 + r) + "\n+---+---+---+---+---+---+---+---+\n"; ++ s += "| " + std::to_string(1 + r) + "\n+---+---+---+---+---+---+---+---+---+---+---+---+\n"; } - s += " a b c d e f g h\n"; ++ s += " a b c d e f g h i j k\n"; return s; } diff --cc src/evaluate.cpp index f4f3904,036b93a..ec4af34 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -1104,9 -743,7 +1104,8 @@@ namespace + 24 * infiltration + 51 * !pos.non_pawn_material() - 43 * almostUnwinnable - - 2 * pos.rule50_count() -110 ; + } Value mg = mg_value(score); Value eg = eg_value(score); @@@ -1226,8 -855,16 +1225,17 @@@ Trace::add(MOBILITY, mobility[WHITE], mobility[BLACK]); } + // Evaluation grain + v = (v / 16) * 16; + // Side to move point of view - return (pos.side_to_move() == WHITE ? v : -v) + Eval::tempo_value(pos); - v = (pos.side_to_move() == WHITE ? v : -v) + Tempo; ++ v = (pos.side_to_move() == WHITE ? v : -v) + Eval::tempo_value(pos); + + // Damp down the evaluation linearly when shuffling - v = v * (100 - pos.rule50_count()) / 100; ++ if (pos.n_move_rule()) ++ v = v * (2 * pos.n_move_rule() - pos.rule50_count()) / (2 * pos.n_move_rule()); + + return v; } } // namespace diff --cc src/position.cpp index aee6282,c9db622..895d79b --- a/src/position.cpp +++ b/src/position.cpp @@@ -51,42 -57,18 +51,45 @@@ namespace Zobrist std::ostream& operator<<(std::ostream& os, const Position& pos) { - os << "\n +---+---+---+---+---+---+---+---+\n"; + os << "\n "; + for (File f = FILE_A; f <= pos.max_file(); ++f) + os << "+---"; + os << "+\n"; - for (Rank r = RANK_8; r >= RANK_1; --r) + for (Rank r = pos.max_rank(); r >= RANK_1; --r) { - for (File f = FILE_A; f <= FILE_H; ++f) - os << " | " << PieceToChar[pos.piece_on(make_square(f, r))]; - - os << " | " << (1 + r) << "\n +---+---+---+---+---+---+---+---+\n"; + for (File f = FILE_A; f <= pos.max_file(); ++f) + if (pos.unpromoted_piece_on(make_square(f, r))) + os << " |+" << pos.piece_to_char()[pos.unpromoted_piece_on(make_square(f, r))]; + else + os << " | " << pos.piece_to_char()[pos.piece_on(make_square(f, r))]; + - os << " |"; ++ os << " |" << (1 + r); + if (r == pos.max_rank() || r == RANK_1) + { + Color c = r == RANK_1 ? WHITE : BLACK; + if (c == pos.side_to_move()) + os << " *"; + else + os << " "; + if (pos.piece_drops() || pos.seirawan_gating() || pos.arrow_gating()) + { + os << " ["; + for (PieceType pt = KING; pt >= PAWN; --pt) + os << std::string(pos.count_in_hand(c, pt), pos.piece_to_char()[make_piece(c, pt)]); + os << "]"; + } + } + os << "\n "; + for (File f = FILE_A; f <= pos.max_file(); ++f) + os << "+---"; + os << "+\n"; } - os << " a b c d e f g h\n" - << "\nFen: " << pos.fen() << "\nKey: " << std::hex << std::uppercase ++ for (File f = FILE_A; f <= pos.max_file(); ++f) ++ os << " " << char('a' + f); ++ os << "\n"; + os << "\nFen: " << pos.fen() << "\nSfen: " << pos.fen(true) << "\nKey: " << std::hex << std::uppercase << std::setfill('0') << std::setw(16) << pos.key() << std::setfill(' ') << std::dec << "\nCheckers: "; diff --cc src/search.cpp index a5a64a5,f5887f3..fbf44d4 --- a/src/search.cpp +++ b/src/search.cpp @@@ -1079,12 -1003,11 +1079,13 @@@ moves_loop: // When in check, search st // Futility pruning: parent node (~5 Elo) if ( lmrDepth < 6 && !ss->inCheck - && ss->staticEval + 235 + 172 * lmrDepth <= alpha - && (*contHist[0])[movedPiece][to_sq(move)] - + (*contHist[1])[movedPiece][to_sq(move)] - + (*contHist[3])[movedPiece][to_sq(move)] - + (*contHist[5])[movedPiece][to_sq(move)] / 2 < 31400) + && !( pos.extinction_value() == -VALUE_MATE + && pos.extinction_piece_types().find(ALL_PIECES) == pos.extinction_piece_types().end()) + && ss->staticEval + (235 + 172 * lmrDepth) * (1 + pos.check_counting()) <= alpha + && (*contHist[0])[history_slot(movedPiece)][to_sq(move)] + + (*contHist[1])[history_slot(movedPiece)][to_sq(move)] - + (*contHist[3])[history_slot(movedPiece)][to_sq(move)] < 27400) ++ + (*contHist[3])[history_slot(movedPiece)][to_sq(move)] ++ + (*contHist[5])[history_slot(movedPiece)][to_sq(move)] / 2 < 31400) continue; // Prune moves with negative SEE (~20 Elo) diff --cc src/tt.h index 0a682be,76db03d..2b43254 --- a/src/tt.h +++ b/src/tt.h @@@ -65,7 -65,8 +65,8 @@@ private class TranspositionTable { - static constexpr int ClusterSize = 3; + static constexpr int ClusterSize = 5; + static constexpr int ClustersPerSuperCluster = 256; struct Cluster { TTEntry entry[ClusterSize]; diff --cc src/ucioption.cpp index fa69dc3,90190b5..870abed --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@@ -136,13 -56,12 +136,13 @@@ bool CaseInsensitiveLess::operator() (c void init(OptionsMap& o) { - // at most 2^32 clusters. - constexpr int MaxHashMB = Is64Bit ? 131072 : 2048; + // At most 2^32 superclusters. Supercluster = 8 kB + constexpr int MaxHashMB = Is64Bit ? 33554432 : 2048; + o["Protocol"] << Option("uci", {"uci", "usi", "ucci", "xboard"}); o["Debug Log File"] << Option("", on_logger); o["Contempt"] << Option(24, -100, 100); - o["Analysis Contempt"] << Option("Both var Off var White var Black var Both", "Both"); + o["Analysis Contempt"] << Option("Both", {"Both", "Off", "White", "Black"}); o["Threads"] << Option(1, 1, 512, on_threads); o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size); o["Clear Hash"] << Option(on_clear_hash);