From: Fabian Fichter Date: Mon, 1 Jun 2020 08:27:53 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d9642f936022dd35d44967762eb1bb9be0ffe112;p=fairystockfish.git Merge official-stockfish/master bench: 4456640 --- d9642f936022dd35d44967762eb1bb9be0ffe112 diff --cc src/evaluate.cpp index d123f0c,bf1eee9..450e182 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -179,9 -167,8 +179,9 @@@ namespace template Score threats() const; template Score passed() const; template Score space() const; + template Score variant() const; ScaleFactor scale_factor(Value eg) const; - Score initiative(Score score, Score materialScore) const; + Score initiative(Score score) const; const Position& pos; Material::Entry* me; @@@ -1000,18 -696,13 +1000,18 @@@ // known attacking/defending status of the players. template - Score Evaluation::initiative(Score score, Score materialScore) const { + Score Evaluation::initiative(Score score) const { - int outflanking = distance(pos.square(WHITE), pos.square(BLACK)) - - distance(pos.square(WHITE), pos.square(BLACK)); + // No initiative bonus for extinction variants + if (pos.extinction_value() != VALUE_NONE || pos.captures_to_hand() || pos.connect_n()) + return SCORE_ZERO; - bool infiltration = rank_of(pos.square(WHITE)) > RANK_4 - || rank_of(pos.square(BLACK)) < RANK_5; + int outflanking = !pos.count(WHITE) || !pos.count(BLACK) ? 0 + : distance(pos.square(WHITE), pos.square(BLACK)) + - distance(pos.square(WHITE), pos.square(BLACK)); + + bool infiltration = (pos.count(WHITE) && rank_of(pos.square(WHITE)) > RANK_4) + || (pos.count(BLACK) && rank_of(pos.square(BLACK)) < RANK_5); bool pawnsOnBothFlanks = (pos.pieces(PAWN) & QueenSide) && (pos.pieces(PAWN) & KingSide); @@@ -1106,12 -790,9 +1105,9 @@@ // Early exit if score is high Value v = (mg_value(score) + eg_value(score)) / 2; - if (abs(v) > LazyThreshold + pos.non_pawn_material() / 64) + if (abs(v) > LazyThreshold + pos.non_pawn_material() / 64 && Options["UCI_Variant"] == "chess") return pos.side_to_move() == WHITE ? v : -v; - // Remember this score - Score materialScore = score; - // Main evaluation begins here initialize(); @@@ -1133,10 -809,9 +1129,10 @@@ score += king< WHITE>() - king< BLACK>() + threats() - threats() + passed< WHITE>() - passed< BLACK>() - + space< WHITE>() - space< BLACK>(); + + space< WHITE>() - space< BLACK>() + + variant() - variant(); - score += initiative(score, materialScore); + score += initiative(score); // Interpolate between a middlegame and a (scaled by 'sf') endgame score ScaleFactor sf = scale_factor(eg_value(score)); diff --cc src/search.cpp index 14e53d6,9562bf8..a4f4bc2 --- a/src/search.cpp +++ b/src/search.cpp @@@ -909,11 -841,9 +909,11 @@@ namespace && (ss-1)->statScore < 23397 && eval >= beta && eval >= ss->staticEval - && ss->staticEval >= beta - 32 * depth + 292 - improving * 30 + && ss->staticEval >= beta - 32 * depth - 30 * improving + 120 * ttPv + 292 && !excludedMove && pos.non_pawn_material(us) + && (pos.pieces(~us) ^ pos.pieces(~us, PAWN)) + && (pos.pieces() ^ pos.pieces(BREAKTHROUGH_PIECE) ^ pos.pieces(CLOBBER_PIECE)) && (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor)) { assert(eval - beta >= 0); @@@ -1102,12 -1027,8 +1102,8 @@@ moves_loop: // When in check, search st if (!pos.see_ge(move, Value(-(32 - std::min(lmrDepth, 18)) * lmrDepth * lmrDepth))) continue; } - else if (!pos.see_ge(move, Value(-194) * depth)) // (~25 Elo) + else if (!pos.see_ge(move, Value(-194 - 120 * pos.captures_to_hand()) * depth)) // (~25 Elo) - { - if (captureOrPromotion && captureCount < 32) - capturesSearched[captureCount++] = move; continue; - } } // Step 14. Extensions (~75 Elo)