diff --git a/src/learn/learn.cpp b/src/learn/learn.cpp index 3942b606..cab5a9b5 100644 --- a/src/learn/learn.cpp +++ b/src/learn/learn.cpp @@ -685,10 +685,6 @@ namespace Learner int ply = 0; pos.do_move((Move)ps.move, state[ply++]); - // We want to position being trained on not to be terminal - if (MoveList(pos).size() == 0) - goto RETRY_READ; - // Evaluation value of shallow search (qsearch) const auto [_, pv] = Search::qsearch(pos); @@ -698,6 +694,10 @@ namespace Learner } } + // We want to position being trained on not to be terminal + if (MoveList(pos).size() == 0) + goto RETRY_READ; + // Since we have reached the end phase of PV, add the slope here. pos_add_grad(); }