diff --git a/src/movepick.cpp b/src/movepick.cpp index 7d759f12..61e5527f 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -110,13 +110,13 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h) go_next_phase(); } -MovePicker::MovePicker(const Position& p, Move ttm, const History& h, int threshold) +MovePicker::MovePicker(const Position& p, Move ttm, const History& h, int parentCapture) : pos(p), H(h) { assert (!pos.in_check()); // In ProbCut we consider only captures better than parent's move - captureThreshold = threshold; + captureThreshold = parentCapture; phasePtr = ProbCutTable; if ( ttm != MOVE_NONE diff --git a/src/movepick.h b/src/movepick.h index 5e4cf779..d0ced047 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -42,7 +42,7 @@ class MovePicker { public: MovePicker(const Position&, Move, Depth, const History&, SearchStack*, Value); MovePicker(const Position&, Move, Depth, const History&); - MovePicker(const Position&, Move, const History&, int threshold); + MovePicker(const Position&, Move, const History&, int parentCapture); Move get_next_move(); private: diff --git a/src/position.h b/src/position.h index 1a714907..6c48b54c 100644 --- a/src/position.h +++ b/src/position.h @@ -213,6 +213,7 @@ public: // Static exchange evaluation int see(Move m) const; int see_sign(Move m) const; + static int see_value(PieceType pt); // Accessing hash keys Key get_key() const; @@ -466,6 +467,10 @@ inline bool Position::square_is_weak(Square s, Color c) const { return !(pieces(PAWN, opposite_color(c)) & attack_span_mask(c, s)); } +inline int Position::see_value(PieceType pt) { + return seeValues[pt]; +} + inline Key Position::get_key() const { return st->key; } diff --git a/src/search.cpp b/src/search.cpp index 6e440702..ec2b1c9c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -903,8 +903,9 @@ namespace { } // Step 9. ProbCut (is omitted in PV nodes) - // If we have a good capture that raises the score well above beta and a reduced - // search confirms the score then we can (almost) safely prune the previous move. + // If we have a very good capture (i.e. SEE > seeValues[captured_piece_type]) + // and a reduced search returns a value much above beta, we can (almost) safely + // prune the previous move. if ( !PvNode && depth >= RazorDepth + ONE_PLY && !inCheck @@ -917,7 +918,7 @@ namespace { assert(rdepth >= ONE_PLY); - MovePicker mp(pos, ttMove, H, Max(rbeta - refinedValue, VALUE_ZERO)); + MovePicker mp(pos, ttMove, H, Position::see_value(pos.captured_piece_type())); pinned = pos.pinned_pieces(pos.side_to_move()); while ((move = mp.get_next_move()) != MOVE_NONE)