mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +00:00
Remove failedLow from the mainThread struct
failedLow is in fact a local variable in Thread::search(). Also clean some spaces and tabs in code. No functional change.
This commit is contained in:
parent
528507b303
commit
2af2c67650
3 changed files with 9 additions and 9 deletions
|
@ -34,7 +34,7 @@ namespace {
|
||||||
// Pawn penalties
|
// Pawn penalties
|
||||||
constexpr Score Isolated = S(13, 16);
|
constexpr Score Isolated = S(13, 16);
|
||||||
constexpr Score Backward = S(17, 11);
|
constexpr Score Backward = S(17, 11);
|
||||||
constexpr Score Doubled = S(13, 40);
|
constexpr Score Doubled = S(13, 40);
|
||||||
|
|
||||||
// Connected pawn bonus by opposed, phalanx, #support and rank
|
// Connected pawn bonus by opposed, phalanx, #support and rank
|
||||||
Score Connected[2][2][3][RANK_NB];
|
Score Connected[2][2][3][RANK_NB];
|
||||||
|
|
|
@ -296,6 +296,7 @@ void Thread::search() {
|
||||||
MainThread* mainThread = (this == Threads.main() ? Threads.main() : nullptr);
|
MainThread* mainThread = (this == Threads.main() ? Threads.main() : nullptr);
|
||||||
double timeReduction = 1.0;
|
double timeReduction = 1.0;
|
||||||
Color us = rootPos.side_to_move();
|
Color us = rootPos.side_to_move();
|
||||||
|
bool failedLow;
|
||||||
|
|
||||||
std::memset(ss-4, 0, 7 * sizeof(Stack));
|
std::memset(ss-4, 0, 7 * sizeof(Stack));
|
||||||
for (int i = 4; i > 0; i--)
|
for (int i = 4; i > 0; i--)
|
||||||
|
@ -305,7 +306,7 @@ void Thread::search() {
|
||||||
beta = VALUE_INFINITE;
|
beta = VALUE_INFINITE;
|
||||||
|
|
||||||
if (mainThread)
|
if (mainThread)
|
||||||
mainThread->bestMoveChanges = 0, mainThread->failedLow = false;
|
mainThread->bestMoveChanges = 0, failedLow = false;
|
||||||
|
|
||||||
size_t multiPV = Options["MultiPV"];
|
size_t multiPV = Options["MultiPV"];
|
||||||
Skill skill(Options["Skill Level"]);
|
Skill skill(Options["Skill Level"]);
|
||||||
|
@ -346,7 +347,7 @@ void Thread::search() {
|
||||||
|
|
||||||
// Age out PV variability metric
|
// Age out PV variability metric
|
||||||
if (mainThread)
|
if (mainThread)
|
||||||
mainThread->bestMoveChanges *= 0.517, mainThread->failedLow = false;
|
mainThread->bestMoveChanges *= 0.517, failedLow = false;
|
||||||
|
|
||||||
// Save the last iteration's scores before first PV line is searched and
|
// Save the last iteration's scores before first PV line is searched and
|
||||||
// all the move scores except the (new) PV are set to -VALUE_INFINITE.
|
// all the move scores except the (new) PV are set to -VALUE_INFINITE.
|
||||||
|
@ -423,7 +424,7 @@ void Thread::search() {
|
||||||
|
|
||||||
if (mainThread)
|
if (mainThread)
|
||||||
{
|
{
|
||||||
mainThread->failedLow = true;
|
failedLow = true;
|
||||||
Threads.stopOnPonderhit = false;
|
Threads.stopOnPonderhit = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,7 +472,7 @@ void Thread::search() {
|
||||||
&& !Threads.stop
|
&& !Threads.stop
|
||||||
&& !Threads.stopOnPonderhit)
|
&& !Threads.stopOnPonderhit)
|
||||||
{
|
{
|
||||||
const int F[] = { mainThread->failedLow,
|
const int F[] = { failedLow,
|
||||||
bestValue - mainThread->previousScore };
|
bestValue - mainThread->previousScore };
|
||||||
|
|
||||||
int improvingFactor = std::max(246, std::min(832, 306 + 119 * F[0] - 6 * F[1]));
|
int improvingFactor = std::max(246, std::min(832, 306 + 119 * F[0] - 6 * F[1]));
|
||||||
|
@ -1165,7 +1166,7 @@ moves_loop: // When in check, search starts from here
|
||||||
// Quiet best move: update move sorting heuristics
|
// Quiet best move: update move sorting heuristics
|
||||||
if (!pos.capture_or_promotion(bestMove))
|
if (!pos.capture_or_promotion(bestMove))
|
||||||
update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount,
|
update_quiet_stats(pos, ss, bestMove, quietsSearched, quietCount,
|
||||||
stat_bonus(depth + (bestValue > beta + PawnValueMg ? ONE_PLY : DEPTH_ZERO)));
|
stat_bonus(depth + (bestValue > beta + PawnValueMg ? ONE_PLY : DEPTH_ZERO)));
|
||||||
else
|
else
|
||||||
update_capture_stats(pos, bestMove, capturesSearched, captureCount, stat_bonus(depth + ONE_PLY));
|
update_capture_stats(pos, bestMove, capturesSearched, captureCount, stat_bonus(depth + ONE_PLY));
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,6 @@ struct MainThread : public Thread {
|
||||||
void search() override;
|
void search() override;
|
||||||
void check_time();
|
void check_time();
|
||||||
|
|
||||||
bool failedLow;
|
|
||||||
double bestMoveChanges, previousTimeReduction;
|
double bestMoveChanges, previousTimeReduction;
|
||||||
Value previousScore;
|
Value previousScore;
|
||||||
int callsCnt;
|
int callsCnt;
|
||||||
|
|
Loading…
Add table
Reference in a new issue