From: Fabian Fichter Date: Mon, 10 Aug 2020 20:54:39 +0000 (+0200) Subject: Merge official-stockfish/master X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=dd6c8d95f7dd0923e55f49f5fb6848ccba99519d;p=fairystockfish.git Merge official-stockfish/master bench: 4822192 --- dd6c8d95f7dd0923e55f49f5fb6848ccba99519d diff --cc src/evaluate.cpp index f9bd82f,e80e944..27580c0 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@@ -93,9 -90,9 +93,9 @@@ namespace // MobilityBonus[PieceType-2][attacked] contains bonuses for middle and end game, // indexed by piece type and number of attacked squares in the mobility area. - constexpr Score MobilityBonus[][32] = { + constexpr Score MobilityBonus[][4 * RANK_NB] = { - { S(-62,-81), S(-53,-56), S(-12,-30), S( -4,-14), S( 3, 8), S( 13, 15), // Knight - S( 22, 23), S( 28, 27), S( 33, 33) }, + { S(-62,-81), S(-53,-56), S(-12,-31), S( -4,-16), S( 3, 5), S( 13, 11), // Knight + S( 22, 17), S( 28, 20), S( 33, 25) }, { S(-48,-59), S(-20,-23), S( 16, -3), S( 26, 13), S( 38, 24), S( 51, 42), // Bishop S( 55, 54), S( 63, 57), S( 63, 65), S( 68, 73), S( 81, 78), S( 81, 86), S( 91, 88), S( 98, 97) }, @@@ -763,10 -588,10 +763,10 @@@ constexpr Direction Down = -Up; auto king_proximity = [&](Color c, Square s) { - return std::min(distance(pos.square(c), s), 5); + return pos.extinction_value() == VALUE_MATE ? 0 : pos.count(c) ? std::min(distance(pos.square(c), s), 5) : 5; }; - Bitboard b, bb, squaresToQueen, unsafeSquares, candidatePassers, leverable; + Bitboard b, bb, squaresToQueen, unsafeSquares, blockedPassers, helpers; Score score = SCORE_ZERO; b = pe->passed_pawns(Us); @@@ -1092,8 -730,7 +1089,8 @@@ // Compute the initiative bonus for the attacking side int complexity = 9 * pe->passed_count() - + 11 * pos.count() + + 12 * pos.count() + + 15 * pos.count() + 9 * outflanking + 21 * pawnsOnBothFlanks + 24 * infiltration diff --cc src/movepick.cpp index b36c58d,e26f42e..60b906d --- a/src/movepick.cpp +++ b/src/movepick.cpp @@@ -174,7 -169,7 +174,7 @@@ top case GOOD_CAPTURE: if (select([&](){ - return pos.see_ge(*cur, Value(-55 * cur->value / 1024 - 500 * (pos.captures_to_hand() && pos.gives_check(*cur)))) || pos.must_capture() ? - return pos.see_ge(*cur, Value(-69 * cur->value / 1024)) ? ++ return pos.see_ge(*cur, Value(-69 * cur->value / 1024 - 500 * (pos.captures_to_hand() && pos.gives_check(*cur)))) || pos.must_capture() ? // Move losing capture to endBadCaptures to be tried later true : (*endBadCaptures++ = *cur, false); })) return *(cur - 1); diff --cc src/pawns.cpp index 697c8c7,c20cb52..3690916 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@@ -147,9 -145,16 +148,16 @@@ namespace } else if (!neighbours) + { - score -= Isolated + score -= Isolated * (1 + 2 * pos.must_capture()) + WeakUnopposed * !opposed; + if ( (ourPawns & forward_file_bb(Them, s)) + && popcount(opposed) == 1 + && !(theirPawns & adjacent_files_bb(s))) - score -= DoubledIsolated; ++ score -= DoubledIsolated * (1 + 2 * pos.must_capture()); + } + else if (backward) score -= Backward + WeakUnopposed * !opposed; diff --cc src/thread.cpp index 4892268,2e0c216..9423a70 --- a/src/thread.cpp +++ b/src/thread.cpp @@@ -211,8 -211,7 +211,7 @@@ void ThreadPool::start_thinking(Positio th->nodes = th->tbHits = th->nmpMinPly = 0; th->rootDepth = th->completedDepth = 0; th->rootMoves = rootMoves; - th->rootPos.set(pos.fen(), pos.is_chess960(), &setupStates->back(), th); + th->rootPos.set(pos.variant(), pos.fen(), pos.is_chess960(), &setupStates->back(), th); - th->lowPlyHistory.fill(0); } setupStates->back() = tmp;