smart_fen_skipping at gensfen_nonpv level

This commit is contained in:
Tomasz Sobczyk
2020-12-17 16:12:26 +01:00
committed by nodchip
parent 868b4e9421
commit 2061be4730
2 changed files with 17 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ namespace Learner
std::string book;
bool smart_fen_skipping = false;
void enforce_constraints()
{
// Limit the maximum to a one-stop score. (Otherwise you might not end the loop)
@@ -281,6 +283,12 @@ namespace Learner
{
pos.set_from_packed_sfen(ps.sfen, &si, &th);
pos.state()->rule50 = 0;
if (params.smart_fen_skipping && pos.checkers())
{
continue;
}
auto [search_value, search_pv] = Search::search(pos, params.search_depth, 1);
if (search_pv.empty())
@@ -293,6 +301,11 @@ namespace Learner
continue;
}
if (params.smart_fen_skipping && pos.capture_or_promotion(search_pv[0]))
{
continue;
}
auto& new_ps = psv.emplace_back();
pos.sfen_pack(new_ps.sfen);
new_ps.score = search_value;
@@ -418,6 +431,8 @@ namespace Learner
is >> sfen_format;
else if (token == "seed")
is >> params.seed;
else if (token == "smart_fen_skipping")
params.smart_fen_skipping = true;
else if (token == "set_recommended_uci_options")
{
UCI::setoption("Contempt", "0");