Skip to content

Commit

Permalink
filter positive SEE
Browse files Browse the repository at this point in the history
  • Loading branch information
MJZ1977 committed Mar 3, 2019
1 parent 4390040 commit cad64ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/search.cpp
Expand Up @@ -568,7 +568,7 @@ namespace {
Move ttMove, move, excludedMove, bestMove;
Depth extension, newDepth;
Value bestValue, value, ttValue, eval, maxValue, pureStaticEval;
bool ttHit, ttPv, inCheck, givesCheck, moveSac, improving;
bool ttHit, ttPv, inCheck, givesCheck, positiveSEE, improving;
bool captureOrPromotion, doFullDepthSearch, moveCountPruning, ttCapture;
Piece movedPiece;
int moveCount, captureCount, quietCount;
Expand Down Expand Up @@ -912,7 +912,7 @@ namespace {
captureOrPromotion = pos.capture_or_promotion(move);
movedPiece = pos.moved_piece(move);
givesCheck = gives_check(pos, move);
moveSac = !pos.see_ge(move, -PawnValueEg);
positiveSEE = pos.see_ge(move);

// Step 13. Extensions (~70 Elo)

Expand Down Expand Up @@ -1027,7 +1027,7 @@ namespace {

// Decrease reduction if position is or has been on the PV
// or if the moved piece is same than ttmove
if (ttPv || (from_sq(move) == from_sq(ttMove) && ttMove && !moveSac))
if (ttPv || (from_sq(move) == from_sq(ttMove) && ttMove && positiveSEE))
r -= ONE_PLY;

// Decrease reduction if opponent's move count is high (~10 Elo)
Expand Down

2 comments on commit cad64ed

@AndyGrant
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there was elo in this idea, its probably killed via pos.see_ge(move); SEE is generally pretty expensive.

@MJZ1977
Copy link
Owner Author

@MJZ1977 MJZ1977 commented on cad64ed Mar 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor problem. SEE is used just after. I can even change check extension to previous boolean calculated to avoid recalculation.
I think there is a bigger problem with recaptures and SEE condition. I will correct this next time.

Please sign in to comment.