summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8402b40)
The idea is to try a shallow search with reduced beta
on bad captures so to quickly prune them out in case
are really bad.
After 5529 games 966 - 868 - 3695 ELO +6 (+- 5.4) LOS 91%
Tested also version without upper limitation to 8 plies:
After 8780 games 1537 - 1398 - 5850 ELO +5 (+- 4.3) LOS 93%
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
ValueType vt;
Value bestValue, value, oldAlpha;
Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
ValueType vt;
Value bestValue, value, oldAlpha;
Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
- bool isPvMove, isCheck, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
+ bool isPvMove, isCheck, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous, isBadCap;
bool mateThreat = false;
int moveCount = 0, playedMoveCount = 0;
int threadID = pos.thread();
bool mateThreat = false;
int moveCount = 0, playedMoveCount = 0;
int threadID = pos.thread();
+ // 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, moveIsCheck);
// Step 13. Make the move
pos.do_move(move, st, ci, moveIsCheck);
// Step 14. Reduced depth search
// If the move fails high will be re-searched at full depth.
bool doFullDepthSearch = true;
// Step 14. Reduced depth search
// If the move fails high will be re-searched at full depth.
bool doFullDepthSearch = true;
+ alpha = SpNode ? sp->alpha : alpha;
if ( depth >= 3 * ONE_PLY
&& !captureOrPromotion
if ( depth >= 3 * ONE_PLY
&& !captureOrPromotion
ss->reduction = DEPTH_ZERO; // Restore original reduction
}
ss->reduction = DEPTH_ZERO; // Restore original reduction
}
+ // 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)
+ {
+ ss->reduction = 3 * ONE_PLY;
+ Value redAlpha = alpha - 300;
+ Depth d = newDepth - ss->reduction;
+ value = -search<NonPV>(pos, ss+1, -(redAlpha+1), -redAlpha, d, ply+1);
+ doFullDepthSearch = (value > redAlpha);
+ ss->reduction = DEPTH_ZERO; // Restore original reduction
+ }
+
// Step 15. Full depth search
if (doFullDepthSearch)
{
// Step 15. Full depth search
if (doFullDepthSearch)
{