mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Remove unused failHighPly1 flag
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
8d65fcc0f3
commit
c5d546e18e
2 changed files with 0 additions and 39 deletions
|
@ -276,7 +276,6 @@ namespace {
|
||||||
void update_killers(Move m, SearchStack& ss);
|
void update_killers(Move m, SearchStack& ss);
|
||||||
void update_gains(const Position& pos, Move move, Value before, Value after);
|
void update_gains(const Position& pos, Move move, Value before, Value after);
|
||||||
|
|
||||||
bool fail_high_ply_1();
|
|
||||||
int current_search_time();
|
int current_search_time();
|
||||||
int nps();
|
int nps();
|
||||||
void poll();
|
void poll();
|
||||||
|
@ -380,7 +379,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
|
||||||
for (int i = 0; i < THREAD_MAX; i++)
|
for (int i = 0; i < THREAD_MAX; i++)
|
||||||
{
|
{
|
||||||
Threads[i].nodes = 0ULL;
|
Threads[i].nodes = 0ULL;
|
||||||
Threads[i].failHighPly1 = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button_was_pressed("New Game"))
|
if (button_was_pressed("New Game"))
|
||||||
|
@ -1276,19 +1274,7 @@ namespace {
|
||||||
ss[ply].reduction = Depth(0);
|
ss[ply].reduction = Depth(0);
|
||||||
value = -search(pos, ss, -alpha, newDepth, ply+1, true, threadID);
|
value = -search(pos, ss, -alpha, newDepth, ply+1, true, threadID);
|
||||||
if (value > alpha && value < beta)
|
if (value > alpha && value < beta)
|
||||||
{
|
|
||||||
// When the search fails high at ply 1 while searching the first
|
|
||||||
// move at the root, set the flag failHighPly1. This is used for
|
|
||||||
// time managment: We don't want to stop the search early in
|
|
||||||
// such cases, because resolving the fail high at ply 1 could
|
|
||||||
// result in a big drop in score at the root.
|
|
||||||
if (ply == 1 && RootMoveNumber == 1)
|
|
||||||
Threads[threadID].failHighPly1 = true;
|
|
||||||
|
|
||||||
// A fail high occurred. Re-search at full window (pv search)
|
|
||||||
value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1, threadID);
|
value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1, threadID);
|
||||||
Threads[threadID].failHighPly1 = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos.undo_move(move);
|
pos.undo_move(move);
|
||||||
|
@ -2098,14 +2084,6 @@ namespace {
|
||||||
|
|
||||||
if (value > localAlpha && value < sp->beta)
|
if (value > localAlpha && value < sp->beta)
|
||||||
{
|
{
|
||||||
// When the search fails high at ply 1 while searching the first
|
|
||||||
// move at the root, set the flag failHighPly1. This is used for
|
|
||||||
// time managment: We don't want to stop the search early in
|
|
||||||
// such cases, because resolving the fail high at ply 1 could
|
|
||||||
// result in a big drop in score at the root.
|
|
||||||
if (sp->ply == 1 && RootMoveNumber == 1)
|
|
||||||
Threads[threadID].failHighPly1 = true;
|
|
||||||
|
|
||||||
// If another thread has failed high then sp->alpha has been increased
|
// If another thread has failed high then sp->alpha has been increased
|
||||||
// to be higher or equal then beta, if so, avoid to start a PV search.
|
// to be higher or equal then beta, if so, avoid to start a PV search.
|
||||||
localAlpha = sp->alpha;
|
localAlpha = sp->alpha;
|
||||||
|
@ -2113,8 +2091,6 @@ namespace {
|
||||||
value = -search_pv(pos, ss, -sp->beta, -localAlpha, newDepth, sp->ply+1, threadID);
|
value = -search_pv(pos, ss, -sp->beta, -localAlpha, newDepth, sp->ply+1, threadID);
|
||||||
else
|
else
|
||||||
assert(thread_should_stop(threadID));
|
assert(thread_should_stop(threadID));
|
||||||
|
|
||||||
Threads[threadID].failHighPly1 = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos.undo_move(move);
|
pos.undo_move(move);
|
||||||
|
@ -2660,20 +2636,6 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// fail_high_ply_1() checks if some thread is currently resolving a fail
|
|
||||||
// high at ply 1 at the node below the first root node. This information
|
|
||||||
// is used for time management.
|
|
||||||
|
|
||||||
bool fail_high_ply_1() {
|
|
||||||
|
|
||||||
for (int i = 0; i < ActiveThreads; i++)
|
|
||||||
if (Threads[i].failHighPly1)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// current_search_time() returns the number of milliseconds which have passed
|
// current_search_time() returns the number of milliseconds which have passed
|
||||||
// since the beginning of the current search.
|
// since the beginning of the current search.
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ struct Thread {
|
||||||
volatile int activeSplitPoints;
|
volatile int activeSplitPoints;
|
||||||
uint64_t nodes;
|
uint64_t nodes;
|
||||||
uint64_t betaCutOffs[2];
|
uint64_t betaCutOffs[2];
|
||||||
bool failHighPly1;
|
|
||||||
volatile bool stop;
|
volatile bool stop;
|
||||||
volatile bool running;
|
volatile bool running;
|
||||||
volatile bool idle;
|
volatile bool idle;
|
||||||
|
|
Loading…
Add table
Reference in a new issue