From: Fabian Fichter Date: Sun, 20 Sep 2020 12:10:42 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=72c8a58ba3c03716ff6e2cc0c02399f5728bce87;p=fairystockfish.git Merge official-stockfish/master bench: 4262221 --- 72c8a58ba3c03716ff6e2cc0c02399f5728bce87 diff --cc src/evaluate.cpp index 2058a95,b34d82f..68f0b0f --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -1157,7 -793,7 +1171,8 @@@ namespace && pos.non_pawn_material(BLACK) == RookValueMg && pos.count(strongSide) - pos.count(~strongSide) <= 1 && bool(KingSide & pos.pieces(strongSide, PAWN)) != bool(QueenSide & pos.pieces(strongSide, PAWN)) - && (attackedBy[~strongSide][KING] & pos.pieces(~strongSide, PAWN))) ++ && pos.count(~strongSide) + && (attacks_bb(pos.square(~strongSide)) & pos.pieces(~strongSide, PAWN))) sf = 36; else if (pos.count() == 1) sf = 37 + 3 * (pos.count(WHITE) == 1 ? pos.count(BLACK) + pos.count(BLACK) @@@ -1212,9 -844,12 +1227,12 @@@ score += pe->pawn_score(WHITE) - pe->pawn_score(BLACK); // Early exit if score is high - Value v = (mg_value(score) + eg_value(score)) / 2; - if (abs(v) > LazyThreshold + pos.non_pawn_material() / 64 && Options["UCI_Variant"] == "chess") - return pos.side_to_move() == WHITE ? v : -v; + auto lazy_skip = [&](Value lazyThreshold) { + return abs(mg_value(score) + eg_value(score)) / 2 > lazyThreshold + pos.non_pawn_material() / 64; + }; + - if (lazy_skip(LazyThreshold1)) ++ if (lazy_skip(LazyThreshold1) && Options["UCI_Variant"] == "chess") + goto make_v; // Main evaluation begins here initialize(); @@@ -1235,13 -866,17 +1253,18 @@@ // More complex interactions that require fully populated attack bitboards score += king< WHITE>() - king< BLACK>() - + threats() - threats() - + passed< WHITE>() - passed< BLACK>(); + + passed< WHITE>() - passed< BLACK>() - + space< WHITE>() - space< BLACK>() + + variant() - variant(); - if (lazy_skip(LazyThreshold2)) ++ if (lazy_skip(LazyThreshold2) && Options["UCI_Variant"] == "chess") + goto make_v; + + score += threats() - threats() + + space< WHITE>() - space< BLACK>(); + + make_v: // Derive single value from mg and eg parts of score - v = winnable(score); + Value v = winnable(score); // In case of tracing add all remaining individual evaluation terms if (T) diff --cc src/search.cpp index 71ef344,91ac60a..b12995f --- a/src/search.cpp +++ b/src/search.cpp @@@ -945,6 -871,8 +945,8 @@@ namespace } } - probcutBeta = beta + 176 - 49 * improving; ++ probcutBeta = beta + (176 + 20 * !!pos.capture_the_flag_piece()) * (1 + pos.check_counting() + (pos.extinction_value() != VALUE_NONE)) - 49 * improving; + // Step 10. ProbCut (~10 Elo) // If we have a good enough capture and a reduced search returns a value // much above beta, we can (almost) safely prune the previous move. @@@ -1191,18 -1131,6 +1209,12 @@@ moves_loop: // When in check, search st 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; - + // Losing chess capture extension + else if ( pos.must_capture() + && pos.capture(move) + && MoveList(pos).size() == 1) + extension = 1; + // Add extension to new depth newDepth += extension;