mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Introduce MovePicker::isBadCapture() and use in probcut
Small functional change due to the fact that now we skip probcut on evasions. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
13d8af1852
commit
3ef4fdeaa0
3 changed files with 10 additions and 12 deletions
|
@ -46,6 +46,7 @@ namespace {
|
|||
const uint8_t QsearchWithoutChecksTable[] = { PH_TT_MOVES, PH_QCAPTURES, PH_STOP };
|
||||
}
|
||||
|
||||
bool MovePicker::isBadCapture() const { return phase == PH_BAD_CAPTURES; }
|
||||
|
||||
/// Constructor for the MovePicker class. Apart from the position for which
|
||||
/// it is asked to pick legal moves, MovePicker also wants some information
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
MovePicker(const Position&, Move, Depth, const History&, SearchStack*, Value);
|
||||
MovePicker(const Position&, Move, Depth, const History&);
|
||||
Move get_next_move();
|
||||
bool isBadCapture() const;
|
||||
|
||||
private:
|
||||
void score_captures();
|
||||
|
|
|
@ -681,7 +681,7 @@ namespace {
|
|||
ValueType vt;
|
||||
Value bestValue, value, oldAlpha;
|
||||
Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
|
||||
bool isPvMove, inCheck, singularExtensionNode, givesCheck, captureOrPromotion, dangerous, isBadCap;
|
||||
bool isPvMove, inCheck, singularExtensionNode, givesCheck, captureOrPromotion, dangerous;
|
||||
int moveCount = 0, playedMoveCount = 0;
|
||||
int threadID = pos.thread();
|
||||
SplitPoint* sp = NULL;
|
||||
|
@ -1023,16 +1023,6 @@ split_point_start: // At split points actual search starts from here
|
|||
}
|
||||
}
|
||||
|
||||
// Bad capture detection. Will be used by prob-cut search
|
||||
isBadCap = depth >= 3 * ONE_PLY
|
||||
&& depth < 8 * ONE_PLY
|
||||
&& captureOrPromotion
|
||||
&& move != ttMove
|
||||
&& !dangerous
|
||||
&& !move_is_promotion(move)
|
||||
&& abs(alpha) < VALUE_MATE_IN_PLY_MAX
|
||||
&& pos.see_sign(move) < 0;
|
||||
|
||||
// Step 13. Make the move
|
||||
pos.do_move(move, st, ci, givesCheck);
|
||||
|
||||
|
@ -1076,7 +1066,13 @@ split_point_start: // At split points actual search starts from here
|
|||
|
||||
// Probcut search for bad captures. If a reduced search returns a value
|
||||
// very below beta then we can (almost) safely prune the bad capture.
|
||||
if (isBadCap)
|
||||
if ( depth >= 3 * ONE_PLY
|
||||
&& depth < 8 * ONE_PLY
|
||||
&& mp.isBadCapture()
|
||||
&& move != ttMove
|
||||
&& !dangerous
|
||||
&& !move_is_promotion(move)
|
||||
&& abs(alpha) < VALUE_MATE_IN_PLY_MAX)
|
||||
{
|
||||
ss->reduction = 3 * ONE_PLY;
|
||||
Value rAlpha = alpha - 300;
|
||||
|
|
Loading…
Add table
Reference in a new issue