X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=18e0cb95af9abaa1cb15a03d7ae173fdeb3f87fc;hp=9f42bab77f56c0f350c8f96ba6dea19c0030c119;hb=578b21bbeedc41b6e0d1b2df46887b1636a78e2b;hpb=20e92895af45ec9599110506eea231fc689c05ba diff --git a/src/search.cpp b/src/search.cpp index 9f42bab7..18e0cb95 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -66,14 +66,14 @@ namespace { enum NodeType { Root, PV, NonPV }; // Razoring and futility margin based on depth - inline Value razor_margin(Depth d) { return Value(512 + 32 * d); } - inline Value futility_margin(Depth d) { return Value(200 * d); } + Value razor_margin(Depth d) { return Value(512 + 32 * d); } + Value futility_margin(Depth d) { return Value(200 * d); } // Futility and reductions lookup tables, initialized at startup int FutilityMoveCounts[2][16]; // [improving][depth] Depth Reductions[2][2][64][64]; // [pv][improving][depth][moveNumber] - template inline Depth reduction(bool i, Depth d, int mn) { + template Depth reduction(bool i, Depth d, int mn) { return Reductions[PvNode][i][std::min(d, 63 * ONE_PLY)][std::min(mn, 63)]; } @@ -960,9 +960,9 @@ moves_loop: // When in check and at SpNode search starts from here ss->reduction = reduction(improving, depth, moveCount); if ( (!PvNode && cutNode) - || ( History[pos.piece_on(to_sq(move))][to_sq(move)] - + CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq] - [pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO)) + || ( History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO + && CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq] + [pos.piece_on(to_sq(move))][to_sq(move)] <= VALUE_ZERO)) ss->reduction += ONE_PLY; if (move == countermove)