// History and stats update bonus, based on depth
int stat_bonus(Depth depth) {
int d = depth / ONE_PLY;
- return d > 17 ? 0 : d * d + 2 * d - 2;
+ return d > 17 ? 0 : 32 * d * d + 64 * d - 64;
}
// Skill structure is used to implement strength limit
multiPV = std::min(multiPV, rootMoves.size());
- int ct = Options["Contempt"] * PawnValueEg / 100; // From centipawns
+ int ct = int(Options["Contempt"]) * PawnValueEg / 100; // From centipawns
// In analysis mode, adjust contempt in accordance with user preference
if (Limits.infinite || Options["UCI_AnalyseMode"])
beta = std::min(previousScore + delta, VALUE_INFINITE);
// Adjust contempt based on root move's previousScore (dynamic contempt)
- int dct = ct + int(std::round(48 * atan(float(previousScore) / 128)));
+ int dct = ct + 88 * previousScore / (abs(previousScore) + 200);
contempt = (us == WHITE ? make_score(dct, dct / 2)
: -make_score(dct, dct / 2));
}
// Step 11. Internal iterative deepening (skipped when in check, ~2 Elo)
- if ( depth >= 6 * ONE_PLY
- && !ttMove
- && (PvNode || ss->staticEval + 128 >= beta))
+ if ( depth >= 8 * ONE_PLY
+ && !ttMove)
{
Depth d = 3 * depth / 4 - 2 * ONE_PLY;
search<NT>(pos, ss, alpha, beta, d, cutNode, true);
const PieceToHistory* contHist[] = { (ss-1)->contHistory, (ss-2)->contHistory, nullptr, (ss-4)->contHistory };
Move countermove = thisThread->counterMoves[pos.piece_on(prevSq)][prevSq];
- MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory, &thisThread->captureHistory, contHist, countermove, ss->killers);
+ MovePicker mp(pos, ttMove, depth, &thisThread->mainHistory,
+ &thisThread->captureHistory,
+ contHist,
+ countermove,
+ ss->killers);
value = bestValue; // Workaround a bogus 'uninitialized' warning under gcc
skipQuiets = false;
// to search the moves. Because the depth is <= 0 here, only captures,
// queen promotions and checks (only if depth >= DEPTH_QS_CHECKS) will
// be generated.
- MovePicker mp(pos, ttMove, depth, &pos.this_thread()->mainHistory, &pos.this_thread()->captureHistory, to_sq((ss-1)->currentMove));
+ MovePicker mp(pos, ttMove, depth, &pos.this_thread()->mainHistory,
+ &pos.this_thread()->captureHistory,
+ to_sq((ss-1)->currentMove));
// Loop through the moves until no moves remain or a beta cutoff occurs
while ((move = mp.next_move()) != MOVE_NONE)
void Tablebases::rank_root_moves(Position& pos, Search::RootMoves& rootMoves) {
RootInTB = false;
- UseRule50 = Options["Syzygy50MoveRule"];
- ProbeDepth = Options["SyzygyProbeDepth"] * ONE_PLY;
- Cardinality = Options["SyzygyProbeLimit"];
+ UseRule50 = bool(Options["Syzygy50MoveRule"]);
+ ProbeDepth = int(Options["SyzygyProbeDepth"]) * ONE_PLY;
+ Cardinality = int(Options["SyzygyProbeLimit"]);
bool dtz_available = true;
// Tables with fewer pieces than SyzygyProbeLimit are searched with