]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use stable sort to make sure bench with TB yields same results everywhere.
[stockfish] / src / search.cpp
index e6e53e7c59d147d16aaa588670dd989f7ad66f76..c676bd6d62ca05d46f5851ca5211f661f6a50f7b 100644 (file)
@@ -1964,7 +1964,7 @@ void Tablebases::rank_root_moves(Position& pos, Search::RootMoves& rootMoves) {
     if (RootInTB)
     {
         // Sort moves according to TB rank
-        std::sort(rootMoves.begin(), rootMoves.end(),
+        std::stable_sort(rootMoves.begin(), rootMoves.end(),
                   [](const RootMove &a, const RootMove &b) { return a.tbRank > b.tbRank; } );
 
         // Probe during search only if DTZ is not available and we are winning