mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Set the 'Problem' variable only at ply == 1
Bug fix merged from Glaurung 2.2 for search_pv() Added the same fix also to sp_search_pv() where was missing. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
23490bd825
commit
3fafc9768a
1 changed files with 8 additions and 4 deletions
|
@ -1073,7 +1073,9 @@ namespace {
|
||||||
// If we are at ply 1, and we are searching the first root move at
|
// If we are at ply 1, and we are searching the first root move at
|
||||||
// ply 0, set the 'Problem' variable if the score has dropped a lot
|
// ply 0, set the 'Problem' variable if the score has dropped a lot
|
||||||
// (from the computer's point of view) since the previous iteration:
|
// (from the computer's point of view) since the previous iteration:
|
||||||
if (Iteration >= 2 && -value <= ValueByIteration[Iteration-1] - ProblemMargin)
|
if ( ply == 1
|
||||||
|
&& Iteration >= 2
|
||||||
|
&& -value <= ValueByIteration[Iteration-1] - ProblemMargin)
|
||||||
Problem = true;
|
Problem = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1775,8 +1777,10 @@ namespace {
|
||||||
}
|
}
|
||||||
// If we are at ply 1, and we are searching the first root move at
|
// If we are at ply 1, and we are searching the first root move at
|
||||||
// ply 0, set the 'Problem' variable if the score has dropped a lot
|
// ply 0, set the 'Problem' variable if the score has dropped a lot
|
||||||
// (from the computer's point of view) since the previous iteration:
|
// (from the computer's point of view) since the previous iteration.
|
||||||
if (Iteration >= 2 && -value <= ValueByIteration[Iteration-1] - ProblemMargin)
|
if ( sp->ply == 1
|
||||||
|
&& Iteration >= 2
|
||||||
|
&& -value <= ValueByIteration[Iteration-1] - ProblemMargin)
|
||||||
Problem = true;
|
Problem = true;
|
||||||
}
|
}
|
||||||
lock_release(&(sp->lock));
|
lock_release(&(sp->lock));
|
||||||
|
@ -1785,7 +1789,7 @@ namespace {
|
||||||
lock_grab(&(sp->lock));
|
lock_grab(&(sp->lock));
|
||||||
|
|
||||||
// If this is the master thread and we have been asked to stop because of
|
// If this is the master thread and we have been asked to stop because of
|
||||||
// a beta cutoff higher up in the tree, stop all slave threads:
|
// a beta cutoff higher up in the tree, stop all slave threads.
|
||||||
if (sp->master == threadID && thread_should_stop(threadID))
|
if (sp->master == threadID && thread_should_stop(threadID))
|
||||||
for (int i = 0; i < ActiveThreads; i++)
|
for (int i = 0; i < ActiveThreads; i++)
|
||||||
if (sp->slaves[i])
|
if (sp->slaves[i])
|
||||||
|
|
Loading…
Add table
Reference in a new issue