projects
/
stockfish
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Optimisation of Position::see and Position::see_sign
[stockfish]
/
src
/
search.cpp
diff --git
a/src/search.cpp
b/src/search.cpp
index
64cdb32
..
eae3468
100644
(file)
--- a/
src/search.cpp
+++ b/
src/search.cpp
@@
-889,7
+889,7
@@
moves_loop: // When in check search starts from here
// Step 12. Extend checks
if ( givesCheck
&& !moveCountPruning
// Step 12. Extend checks
if ( givesCheck
&& !moveCountPruning
- && pos.see_
sign(move) >= VALUE_ZERO
)
+ && pos.see_
ge(move, VALUE_ZERO)
)
extension = ONE_PLY;
// Singular extension search. If all moves but one fail low on a search of
extension = ONE_PLY;
// Singular extension search. If all moves but one fail low on a search of
@@
-946,11
+946,11
@@
moves_loop: // When in check search starts from here
// Prune moves with negative SEE
if ( lmrDepth < 8
// Prune moves with negative SEE
if ( lmrDepth < 8
- &&
pos.see_sign(move) < Value(-35 * lmrDepth * lmrDepth
))
+ &&
!pos.see_ge(move, Value(-35 * lmrDepth * lmrDepth)
))
continue;
}
else if ( depth < 7 * ONE_PLY
continue;
}
else if ( depth < 7 * ONE_PLY
- &&
pos.see_sign(move) < Value(-35 * depth / ONE_PLY * depth / ONE_PLY
))
+ &&
!pos.see_ge(move, Value(-35 * depth / ONE_PLY * depth / ONE_PLY)
))
continue;
}
continue;
}
@@
-992,7
+992,7
@@
moves_loop: // When in check search starts from here
// because the destination square is empty.
else if ( type_of(move) == NORMAL
&& type_of(pos.piece_on(to_sq(move))) != PAWN
// because the destination square is empty.
else if ( type_of(move) == NORMAL
&& type_of(pos.piece_on(to_sq(move))) != PAWN
- &&
pos.see(make_move(to_sq(move), from_sq(move))) < VALUE_ZERO
)
+ &&
!pos.see_ge(make_move(to_sq(move), from_sq(move)), VALUE_ZERO)
)
r -= 2 * ONE_PLY;
// Decrease/increase reduction for moves with a good/bad history
r -= 2 * ONE_PLY;
// Decrease/increase reduction for moves with a good/bad history
@@
-1302,7
+1302,7
@@
moves_loop: // When in check search starts from here
continue;
}
continue;
}
- if (futilityBase <= alpha &&
pos.see(move) <= VALUE_ZERO
)
+ if (futilityBase <= alpha &&
!pos.see_ge(move, VALUE_ZERO + 1)
)
{
bestValue = std::max(bestValue, futilityBase);
continue;
{
bestValue = std::max(bestValue, futilityBase);
continue;
@@
-1317,7
+1317,7
@@
moves_loop: // When in check search starts from here
// Don't search moves with negative SEE values
if ( (!InCheck || evasionPrunable)
&& type_of(move) != PROMOTION
// Don't search moves with negative SEE values
if ( (!InCheck || evasionPrunable)
&& type_of(move) != PROMOTION
- &&
pos.see_sign(move) < VALUE_ZERO
)
+ &&
!pos.see_ge(move, VALUE_ZERO)
)
continue;
// Speculative prefetch as early as possible
continue;
// Speculative prefetch as early as possible