This helps resolving consecutive FH's during aspiration more efficiently
STC:
http://tests.stockfishchess.org/tests/view/
5bc857920ebc592439f85765
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 4992 W: 1134 L: 980 D: 2878 Elo +10.72
LTC:
http://tests.stockfishchess.org/tests/view/
5bc868050ebc592439f857ef
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 8123 W: 1363 L: 1210 D: 5550 Elo +6.54
No-Regression test with 8 threads, tc=15+0.15:
http://tests.stockfishchess.org/tests/view/
5bc874ca0ebc592439f85938
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 24740 W: 3977 L: 3863 D: 16900 Elo +1.60
This was a cooperation between me and Michael Stembera:
-me recognizing SF having problems with resolving FH's efficiently at
high depths, thus starting some tests based on consecutive FH's.
-mstembera picking up the idea with first success at STC & LTC (so full
credits to him!)
-me suggesting how to resolve the issues pinpointed by S.G on PR #1768
and finally restricting the logic to the main thread so that it don't
regresses at multi-thread.
bench:
3314347
size_t pvFirst = 0;
pvLast = 0;
size_t pvFirst = 0;
pvLast = 0;
+ Depth adjustedDepth = rootDepth;
// MultiPV loop. We perform a full root search for each PV line
for (pvIdx = 0; pvIdx < multiPV && !Threads.stop; ++pvIdx)
// MultiPV loop. We perform a full root search for each PV line
for (pvIdx = 0; pvIdx < multiPV && !Threads.stop; ++pvIdx)
// Start with a small aspiration window and, in the case of a fail
// high/low, re-search with a bigger window until we don't fail
// high/low anymore.
// Start with a small aspiration window and, in the case of a fail
// high/low, re-search with a bigger window until we don't fail
// high/low anymore.
- bestValue = ::search<PV>(rootPos, ss, alpha, beta, rootDepth, false);
+ adjustedDepth = std::max(ONE_PLY, rootDepth - failedHighCnt * ONE_PLY);
+ bestValue = ::search<PV>(rootPos, ss, alpha, beta, adjustedDepth, false);
// Bring the best move to the front. It is critical that sorting
// is done with a stable algorithm because all the values but the
// Bring the best move to the front. It is critical that sorting
// is done with a stable algorithm because all the values but the
&& multiPV == 1
&& (bestValue <= alpha || bestValue >= beta)
&& Time.elapsed() > 3000)
&& multiPV == 1
&& (bestValue <= alpha || bestValue >= beta)
&& Time.elapsed() > 3000)
- sync_cout << UCI::pv(rootPos, rootDepth, alpha, beta) << sync_endl;
+ sync_cout << UCI::pv(rootPos, adjustedDepth, alpha, beta) << sync_endl;
// In case of failing low/high increase aspiration window and
// re-search, otherwise exit the loop.
// In case of failing low/high increase aspiration window and
// re-search, otherwise exit the loop.
failedLow = true;
Threads.stopOnPonderhit = false;
}
}
else if (bestValue >= beta)
failedLow = true;
Threads.stopOnPonderhit = false;
}
}
else if (bestValue >= beta)
beta = std::min(bestValue + delta, VALUE_INFINITE);
beta = std::min(bestValue + delta, VALUE_INFINITE);
+ if (mainThread)
+ ++failedHighCnt;
+ }
if ( mainThread
&& (Threads.stop || pvIdx + 1 == multiPV || Time.elapsed() > 3000))
if ( mainThread
&& (Threads.stop || pvIdx + 1 == multiPV || Time.elapsed() > 3000))
- sync_cout << UCI::pv(rootPos, rootDepth, alpha, beta) << sync_endl;
+ sync_cout << UCI::pv(rootPos, adjustedDepth, alpha, beta) << sync_endl;
- completedDepth = rootDepth;
+ completedDepth = adjustedDepth;
if (rootMoves[0].pv[0] != lastBestMove) {
lastBestMove = rootMoves[0].pv[0];
if (rootMoves[0].pv[0] != lastBestMove) {
lastBestMove = rootMoves[0].pv[0];
- lastBestMoveDepth = rootDepth;
+ lastBestMoveDepth = adjustedDepth;
}
// Have we found a "mate in x"?
}
// Have we found a "mate in x"?