X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=74ee58f412e2e127497be66eb7341039b8e6c3d1;hp=48cbfc13b169118492886c0e6d1e41494c1396d0;hb=e5cc6f6b853c65d48d78d99b039d58750cebfc50;hpb=bb751d6c890f5c50c642366d601740366cfae8d0 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 48cbfc13..74ee58f4 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -259,7 +259,7 @@ namespace { Value apply_weight(Value v, int w); Value scale_by_game_phase(Value mv, Value ev, Phase ph, ScaleFactor sf[]); - int count_1s_8bit(int b); + int count_1s_8bit(Bitboard b); int compute_weight(int uciWeight, int internalWeight); void init_safety(); @@ -1156,16 +1156,21 @@ namespace { else ev = apply_scale_factor(ev, sf[BLACK]); - Value result = Value(int((mv * ph + ev * (128 - ph)) / 128)); + // Superlinear interpolator + int sli_ph = int(ph); + sli_ph -= (64 - sli_ph) / 4; + sli_ph = Min(PHASE_MIDGAME, Max(PHASE_ENDGAME, sli_ph)); // ceiling + + Value result = Value(int((mv * sli_ph + ev * (128 - sli_ph)) / 128)); return Value(int(result) & ~(GrainSize - 1)); } // count_1s_8bit() counts the number of nonzero bits in the 8 least - // significant bits of an integer. This function is used by the king + // significant bits of a Bitboard. This function is used by the king // shield evaluation. - int count_1s_8bit(int b) { + int count_1s_8bit(Bitboard b) { return int(BitCount8Bit[b & 0xFF]); }