mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 06:17:49 +00:00
Use stable sort to make sure bench with TB yields same results everywhere.
std::sort() is not stable so different implementations can produce different results: use the stable version instead. Observed for '8/6k1/5r2/8/8/8/1K6/Q7 w - - 0 1' yielding different bench results for gcc and MSVC and 3-4-5 syzygy TB prior to this patch. closes https://github.com/official-stockfish/Stockfish/pull/3083 No functional change.
This commit is contained in:
committed by
Joost VandeVondele
parent
e0bafa1911
commit
a0afe32d16
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user