mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Ensure that rootDepth < DEPTH_MAX
Indeed, if we use a depth >= DEPTH_MAX, we start having negative depth in the TT (due to int8_t cast). No functional change in single thread mode Resolves #490
This commit is contained in:
parent
9c9205860c
commit
e6eeb17aa6
1 changed files with 2 additions and 2 deletions
|
@ -386,7 +386,7 @@ void Thread::search(bool isMainThread) {
|
|||
{
|
||||
// Set up the new depth for the helper threads
|
||||
if (!isMainThread)
|
||||
rootDepth = Threads.main()->rootDepth + Depth(int(2.2 * log(1 + this->idx)));
|
||||
rootDepth = std::min(DEPTH_MAX - ONE_PLY, Threads.main()->rootDepth + Depth(int(2.2 * log(1 + this->idx))));
|
||||
|
||||
// Age out PV variability metric
|
||||
if (isMainThread)
|
||||
|
@ -562,7 +562,7 @@ namespace {
|
|||
|
||||
assert(-VALUE_INFINITE <= alpha && alpha < beta && beta <= VALUE_INFINITE);
|
||||
assert(PvNode || (alpha == beta - 1));
|
||||
assert(depth > DEPTH_ZERO);
|
||||
assert(DEPTH_ZERO < depth && depth < DEPTH_MAX);
|
||||
|
||||
Move pv[MAX_PLY+1], quietsSearched[64];
|
||||
StateInfo st;
|
||||
|
|
Loading…
Add table
Reference in a new issue