mirror of
https://github.com/sockspls/badfish
synced 2025-07-12 03:59:15 +00:00
Clean up step 11
No functional change Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
01b228b5e1
commit
fc23466236
1 changed files with 22 additions and 14 deletions
|
@ -181,6 +181,22 @@ namespace {
|
||||||
// search when the static evaluation is at most IIDMargin below beta.
|
// search when the static evaluation is at most IIDMargin below beta.
|
||||||
const Value IIDMargin = Value(0x100);
|
const Value IIDMargin = Value(0x100);
|
||||||
|
|
||||||
|
// Step 11. Decide the new search depth
|
||||||
|
|
||||||
|
// Extensions. Configurable UCI options.
|
||||||
|
// Array index 0 is used at non-PV nodes, index 1 at PV nodes.
|
||||||
|
Depth CheckExtension[2], SingleEvasionExtension[2], PawnPushTo7thExtension[2];
|
||||||
|
Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2];
|
||||||
|
|
||||||
|
const Depth SingularExtensionDepthAtPVNodes = 6 * OnePly;
|
||||||
|
const Depth SingularExtensionDepthAtNonPVNodes = 8 * OnePly;
|
||||||
|
|
||||||
|
// If the TT move is at least SingularExtensionMargin better then the
|
||||||
|
// remaining ones we will extend it.
|
||||||
|
const Value SingularExtensionMargin = Value(0x20);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Search depth at iteration 1
|
// Search depth at iteration 1
|
||||||
const Depth InitialDepth = OnePly;
|
const Depth InitialDepth = OnePly;
|
||||||
|
|
||||||
|
@ -188,10 +204,6 @@ namespace {
|
||||||
// better than the second best move.
|
// better than the second best move.
|
||||||
const Value EasyMoveMargin = Value(0x200);
|
const Value EasyMoveMargin = Value(0x200);
|
||||||
|
|
||||||
// If the TT move is at least SingleReplyMargin better then the
|
|
||||||
// remaining ones we will extend it.
|
|
||||||
const Value SingleReplyMargin = Value(0x20);
|
|
||||||
|
|
||||||
/// Lookup tables initialized at startup
|
/// Lookup tables initialized at startup
|
||||||
|
|
||||||
// Reduction lookup tables and their getter functions
|
// Reduction lookup tables and their getter functions
|
||||||
|
@ -220,10 +232,6 @@ namespace {
|
||||||
const Value LSNValue = value_from_centipawns(200);
|
const Value LSNValue = value_from_centipawns(200);
|
||||||
bool loseOnTime = false;
|
bool loseOnTime = false;
|
||||||
|
|
||||||
// Extensions. Array index 0 is used at non-PV nodes, index 1 at PV nodes.
|
|
||||||
Depth CheckExtension[2], SingleEvasionExtension[2], PawnPushTo7thExtension[2];
|
|
||||||
Depth PassedPawnExtension[2], PawnEndgameExtension[2], MateThreatExtension[2];
|
|
||||||
|
|
||||||
// Iteration counters
|
// Iteration counters
|
||||||
int Iteration;
|
int Iteration;
|
||||||
|
|
||||||
|
@ -1133,7 +1141,7 @@ namespace {
|
||||||
// Singular extension search. We extend the TT move if its value is much better than
|
// Singular extension search. We extend the TT move if its value is much better than
|
||||||
// its siblings. To verify this we do a reduced search on all the other moves but the
|
// its siblings. To verify this we do a reduced search on all the other moves but the
|
||||||
// ttMove, if result is lower then ttValue minus a margin then we extend ttMove.
|
// ttMove, if result is lower then ttValue minus a margin then we extend ttMove.
|
||||||
if ( depth >= 6 * OnePly
|
if ( depth >= SingularExtensionDepthAtPVNodes
|
||||||
&& tte
|
&& tte
|
||||||
&& move == tte->move()
|
&& move == tte->move()
|
||||||
&& ext < OnePly
|
&& ext < OnePly
|
||||||
|
@ -1144,9 +1152,9 @@ namespace {
|
||||||
|
|
||||||
if (abs(ttValue) < VALUE_KNOWN_WIN)
|
if (abs(ttValue) < VALUE_KNOWN_WIN)
|
||||||
{
|
{
|
||||||
Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, move);
|
Value excValue = search(pos, ss, ttValue - SingularExtensionMargin, depth / 2, ply, false, threadID, move);
|
||||||
|
|
||||||
if (excValue < ttValue - SingleReplyMargin)
|
if (excValue < ttValue - SingularExtensionMargin)
|
||||||
ext = OnePly;
|
ext = OnePly;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1446,7 +1454,7 @@ namespace {
|
||||||
// Singular extension search. We extend the TT move if its value is much better than
|
// Singular extension search. We extend the TT move if its value is much better than
|
||||||
// its siblings. To verify this we do a reduced search on all the other moves but the
|
// its siblings. To verify this we do a reduced search on all the other moves but the
|
||||||
// ttMove, if result is lower then ttValue minus a margin then we extend ttMove.
|
// ttMove, if result is lower then ttValue minus a margin then we extend ttMove.
|
||||||
if ( depth >= 8 * OnePly
|
if ( depth >= SingularExtensionDepthAtNonPVNodes
|
||||||
&& tte
|
&& tte
|
||||||
&& move == tte->move()
|
&& move == tte->move()
|
||||||
&& !excludedMove // Do not allow recursive single-reply search
|
&& !excludedMove // Do not allow recursive single-reply search
|
||||||
|
@ -1458,9 +1466,9 @@ namespace {
|
||||||
|
|
||||||
if (abs(ttValue) < VALUE_KNOWN_WIN)
|
if (abs(ttValue) < VALUE_KNOWN_WIN)
|
||||||
{
|
{
|
||||||
Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, move);
|
Value excValue = search(pos, ss, ttValue - SingularExtensionMargin, depth / 2, ply, false, threadID, move);
|
||||||
|
|
||||||
if (excValue < ttValue - SingleReplyMargin)
|
if (excValue < ttValue - SingularExtensionMargin)
|
||||||
ext = OnePly;
|
ext = OnePly;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue