mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 08:37:44 +00:00
Move the terminal position check to after qsearch, otherwise qsearch may end up in a terminal position.
This commit is contained in:
+4
-4
@@ -685,10 +685,6 @@ namespace Learner
|
|||||||
int ply = 0;
|
int ply = 0;
|
||||||
pos.do_move((Move)ps.move, state[ply++]);
|
pos.do_move((Move)ps.move, state[ply++]);
|
||||||
|
|
||||||
// We want to position being trained on not to be terminal
|
|
||||||
if (MoveList<LEGAL>(pos).size() == 0)
|
|
||||||
goto RETRY_READ;
|
|
||||||
|
|
||||||
// Evaluation value of shallow search (qsearch)
|
// Evaluation value of shallow search (qsearch)
|
||||||
const auto [_, pv] = Search::qsearch(pos);
|
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<LEGAL>(pos).size() == 0)
|
||||||
|
goto RETRY_READ;
|
||||||
|
|
||||||
// Since we have reached the end phase of PV, add the slope here.
|
// Since we have reached the end phase of PV, add the slope here.
|
||||||
pos_add_grad();
|
pos_add_grad();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user