mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 03:56:50 +08:00
Move public search/qsearch interface from namespace Learner to namespace Search
This commit is contained in:
@@ -673,7 +673,7 @@ namespace Learner
|
||||
}
|
||||
else
|
||||
{
|
||||
Learner::search(pos, random_multi_pv_depth, random_multi_pv);
|
||||
Search::search(pos, random_multi_pv_depth, random_multi_pv);
|
||||
|
||||
// Select one from the top N hands of root Moves
|
||||
auto& rm = pos.this_thread()->rootMoves;
|
||||
@@ -790,7 +790,7 @@ namespace Learner
|
||||
const int depth = search_depth_min + (int)prng.rand(search_depth_max - search_depth_min + 1);
|
||||
|
||||
// Starting search calls init_for_search
|
||||
auto [search_value, search_pv] = search(pos, depth, 1, nodes);
|
||||
auto [search_value, search_pv] = Search::search(pos, depth, 1, nodes);
|
||||
|
||||
// This has to be performed after search because it needs to know
|
||||
// rootMoves which are filled in init_for_search.
|
||||
|
||||
@@ -824,7 +824,7 @@ namespace Learner
|
||||
// The value of evaluate() may be used, but when calculating loss, learn_cross_entropy and
|
||||
// Use qsearch() because it is difficult to compare the values.
|
||||
// EvalHash has been disabled in advance. (If not, the same value will be returned every time)
|
||||
const auto [_, pv] = qsearch(task_pos);
|
||||
const auto [_, pv] = Search::qsearch(task_pos);
|
||||
|
||||
const auto rootColor = task_pos.side_to_move();
|
||||
|
||||
@@ -962,7 +962,7 @@ namespace Learner
|
||||
|
||||
// Determine if the teacher's move and the score of the shallow search match
|
||||
{
|
||||
const auto [value, pv] = search(task_pos, 1);
|
||||
const auto [value, pv] = Search::search(task_pos, 1);
|
||||
if ((uint16_t)pv[0] == ps.move)
|
||||
move_accord_count.fetch_add(1, std::memory_order_relaxed);
|
||||
}
|
||||
@@ -1186,7 +1186,7 @@ namespace Learner
|
||||
goto RETRY_READ;
|
||||
|
||||
// Evaluation value of shallow search (qsearch)
|
||||
const auto [_, pv] = qsearch(pos);
|
||||
const auto [_, pv] = Search::qsearch(pos);
|
||||
|
||||
// Evaluation value of deep search
|
||||
const auto deep_value = (Value)ps.score;
|
||||
|
||||
Reference in New Issue
Block a user