mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
Make ONE_PLY value independent again
And a Trevis CI test to catch future issues. No functional change.
This commit is contained in:
committed by
Marco Costalba
parent
fdd799bc16
commit
49a1fdd3fe
@@ -86,8 +86,8 @@ namespace {
|
||||
|
||||
// Add a small random component to draw evaluations to avoid 3fold-blindness
|
||||
Value value_draw(Depth depth, Thread* thisThread) {
|
||||
return depth < 4 ? VALUE_DRAW
|
||||
: VALUE_DRAW + Value(2 * (thisThread->nodes & 1) - 1);
|
||||
return depth < 4 * ONE_PLY ? VALUE_DRAW
|
||||
: VALUE_DRAW + Value(2 * (thisThread->nodes & 1) - 1);
|
||||
}
|
||||
|
||||
// Skill structure is used to implement strength limit
|
||||
@@ -785,7 +785,7 @@ namespace {
|
||||
|
||||
// Do verification search at high depths, with null move pruning disabled
|
||||
// for us, until ply exceeds nmpMinPly.
|
||||
thisThread->nmpMinPly = ss->ply + 3 * (depth-R) / 4;
|
||||
thisThread->nmpMinPly = ss->ply + 3 * (depth-R) / (4 * ONE_PLY);
|
||||
thisThread->nmpColor = us;
|
||||
|
||||
Value v = search<NonPV>(pos, ss, beta-1, beta, depth-R, false);
|
||||
@@ -912,8 +912,9 @@ moves_loop: // When in check, search starts from here
|
||||
&& pos.legal(move))
|
||||
{
|
||||
Value singularBeta = ttValue - 2 * depth / ONE_PLY;
|
||||
Depth halfDepth = depth / (2 * ONE_PLY) * ONE_PLY; // ONE_PLY invariant
|
||||
ss->excludedMove = move;
|
||||
value = search<NonPV>(pos, ss, singularBeta - 1, singularBeta, depth / 2, cutNode);
|
||||
value = search<NonPV>(pos, ss, singularBeta - 1, singularBeta, halfDepth, cutNode);
|
||||
ss->excludedMove = MOVE_NONE;
|
||||
|
||||
if (value < singularBeta)
|
||||
@@ -961,7 +962,8 @@ moves_loop: // When in check, search starts from here
|
||||
continue;
|
||||
|
||||
// Reduced depth of the next LMR search
|
||||
int lmrDepth = std::max(newDepth - reduction<PvNode>(improving, depth, moveCount), DEPTH_ZERO) / ONE_PLY;
|
||||
int lmrDepth = std::max(newDepth - reduction<PvNode>(improving, depth, moveCount), DEPTH_ZERO);
|
||||
lmrDepth /= ONE_PLY;
|
||||
|
||||
// Countermoves based pruning (~20 Elo)
|
||||
if ( lmrDepth < 3 + ((ss-1)->statScore > 0 || (ss-1)->moveCount == 1)
|
||||
|
||||
Reference in New Issue
Block a user