Skip to content

Commit

Permalink
simp recapture tm reduction
Browse files Browse the repository at this point in the history
bench 934447
  • Loading branch information
Ergodice committed Dec 13, 2024
1 parent cf10644 commit 3be5065
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
8 changes: 0 additions & 8 deletions src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Engine::Engine(std::optional<std::string> path) :
NN::NetworkBig({EvalFileDefaultNameBig, "None", ""}, NN::EmbeddedNNUEType::BIG),
NN::NetworkSmall({EvalFileDefaultNameSmall, "None", ""}, NN::EmbeddedNNUEType::SMALL))) {
pos.set(StartFEN, false, &states->back());
capSq = SQ_NONE;

options["Debug Log File"] << Option("", [](const Option& o) {
start_logger(o);
Expand Down Expand Up @@ -125,7 +124,6 @@ std::uint64_t Engine::perft(const std::string& fen, Depth depth, bool isChess960
void Engine::go(Search::LimitsType& limits) {
assert(limits.perft == 0);
verify_networks();
limits.capSq = capSq;

threads.start_thinking(options, pos, states, limits);
}
Expand Down Expand Up @@ -168,7 +166,6 @@ void Engine::set_position(const std::string& fen, const std::vector<std::string>
states = StateListPtr(new std::deque<StateInfo>(1));
pos.set(fen, options["UCI_Chess960"], &states->back());

capSq = SQ_NONE;
for (const auto& move : moves)
{
auto m = UCIEngine::to_move(pos, move);
Expand All @@ -178,11 +175,6 @@ void Engine::set_position(const std::string& fen, const std::vector<std::string>

states->emplace_back();
pos.do_move(m, states->back());

capSq = SQ_NONE;
DirtyPiece& dp = states->back().dirtyPiece;
if (dp.dirty_num > 1 && dp.to[1] == SQ_NONE)
capSq = m.to_sq();
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,9 @@ void Search::Worker::iterative_deepening() {
timeReduction = lastBestMoveDepth + 8 < completedDepth ? 1.495 : 0.687;
double reduction = (1.48 + mainThread->previousTimeReduction) / (2.17 * timeReduction);
double bestMoveInstability = 1 + 1.88 * totBestMoveChanges / threads.size();
double recapture = limits.capSq == rootMoves[0].pv[0].to_sq() ? 0.955 : 1.005;

double totalTime =
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability * recapture;
mainThread->tm.optimum() * fallingEval * reduction * bestMoveInstability;

// Cap used time in case of a single legal move for a better viewer experience
if (rootMoves.size() == 1)
Expand Down
1 change: 0 additions & 1 deletion src/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ struct LimitsType {
int movestogo, depth, mate, perft, infinite;
uint64_t nodes;
bool ponderMode;
Square capSq;
};


Expand Down

0 comments on commit 3be5065

Please sign in to comment.