mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 11:06:58 +08:00
Move the terminal position check to after qsearch, otherwise qsearch may end up in a terminal position.
This commit is contained in:
@@ -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<LEGAL>(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<LEGAL>(pos).size() == 0)
|
||||
goto RETRY_READ;
|
||||
|
||||
// Since we have reached the end phase of PV, add the slope here.
|
||||
pos_add_grad();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user