From 5bb6cdf7ba732f2f108451214a3eed243fc14024 Mon Sep 17 00:00:00 2001 From: fsmosca Date: Mon, 5 Apr 2021 13:29:49 +0800 Subject: [PATCH] Update gensfen.cpp * Terminate game by 3-fold repetition. * Fix segmentation fault by properly initializing the random_multi_pv_depth. --- src/learn/gensfen.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/learn/gensfen.cpp b/src/learn/gensfen.cpp index 06e6295b..b28afa13 100644 --- a/src/learn/gensfen.cpp +++ b/src/learn/gensfen.cpp @@ -110,6 +110,8 @@ namespace Learner save_every = std::max(save_every, REPORT_STATS_EVERY); num_threads = Options["Threads"]; + + random_multi_pv_depth = std::max(search_depth_max, random_multi_pv_depth); } }; @@ -489,8 +491,11 @@ namespace Learner // draw at the maximum number of steps to write. const int ply = move_hist_scores.size(); - // has it reached the max length or is a draw - if (ply >= params.write_maxply || pos.is_draw(ply)) + // has it reached the max length or is a draw by fifty-move rule + // or by 3-fold repetition + if (ply >= params.write_maxply + || pos.is_fifty_move_draw() + || pos.is_three_fold_repetition()) { return 0; }