From 9f3de8b40eda71b04e6b88f5deaf45a7d1efb402 Mon Sep 17 00:00:00 2001 From: Tomasz Sobczyk Date: Thu, 24 Sep 2020 21:10:10 +0200 Subject: [PATCH] Revert some unwanted changes from merge conflict resolution. --- src/evaluate.h | 2 +- src/learn/gensfen.cpp | 21 ++------------------- src/misc.cpp | 12 ++++++++++++ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/evaluate.h b/src/evaluate.h index 74a490f6..e6ac7e1c 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -42,7 +42,7 @@ namespace Eval { // The default net name MUST follow the format nn-[SHA256 first 12 digits].nnue // for the build process (profile-build and fishtest) to work. Do not change the // name of the macro, as it is used in the Makefile. - #define EvalFileDefaultName "nn.bin" + #define EvalFileDefaultName "nn-03744f8d56d8.nnue" namespace NNUE { diff --git a/src/learn/gensfen.cpp b/src/learn/gensfen.cpp index ba0c3be8..24d05c96 100644 --- a/src/learn/gensfen.cpp +++ b/src/learn/gensfen.cpp @@ -47,7 +47,6 @@ namespace Learner static bool detect_draw_by_consecutive_low_score = false; static bool detect_draw_by_insufficient_mating_material = false; - static std::vector bookStart; static SfenOutputType sfen_output_type = SfenOutputType::Bin; static bool ends_with(const std::string& lhs, const std::string& end) @@ -817,7 +816,7 @@ namespace Learner auto th = Threads[thread_id]; auto& pos = th->rootPos; - pos.set(bookStart[prng.rand(bookStart.size())], false, &si, th); + pos.set(StartFEN, false, &si, th); int resign_counter = 0; bool should_resign = prng.rand(10) > 1; @@ -1127,28 +1126,12 @@ namespace Learner output_file_name = output_file_name + "_" + to_hex(r.rand()) + to_hex(r.rand()); } - bookStart.clear(); - { - std::string line; - std::ifstream myfile ("3moves_v2.epd"); - if (myfile.is_open()) - { - while (getline(myfile,line)) - { - bookStart.push_back(line); - } - myfile.close(); - } else { - bookStart.push_back(StartFEN); - } - } std::cout << "gensfen : " << endl << " search_depth_min = " << search_depth_min << " to " << search_depth_max << endl << " nodes = " << nodes << endl << " loop_max = " << loop_max << endl << " eval_limit = " << eval_limit << endl - << " thread_num = " << thread_num << endl - << " bookStart = " << bookStart.size() << endl + << " thread_num (set by USI setoption) = " << thread_num << endl << " random_move_minply = " << random_move_minply << endl << " random_move_maxply = " << random_move_maxply << endl << " random_move_count = " << random_move_count << endl diff --git a/src/misc.cpp b/src/misc.cpp index a0e01820..d31538fa 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -408,11 +408,23 @@ static void* aligned_large_pages_alloc_win(size_t allocSize) { void* aligned_large_pages_alloc(size_t allocSize) { + static bool firstCall = true; void* mem; // Try to allocate large pages mem = aligned_large_pages_alloc_win(allocSize); + // Suppress info strings on the first call. The first call occurs before 'uci' + // is received and in that case this output confuses some GUIs. + if (!firstCall) + { + if (mem) + sync_cout << "info string Hash table allocation: Windows large pages used." << sync_endl; + else + sync_cout << "info string Hash table allocation: Windows large pages not used." << sync_endl; + } + firstCall = false; + // Fall back to regular, page aligned, allocation if necessary if (!mem) mem = VirtualAlloc(NULL, allocSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);