From 1cb9a4c52e78da9a730a6f6b6e4ff7e70a902a79 Mon Sep 17 00:00:00 2001 From: Krasimir Topchiyski Date: Sat, 25 Mar 2023 09:50:22 +0200 Subject: [PATCH] Release 3.7b --- .../bitboard/impl1/internal/MoveGenerator.java | 11 +++++++++-- .../doc/engine/txt/release_notes_BagaturEngine.txt | 3 +++ Sources/UCI/src/bagaturchess/uci/impl/Protocol.java | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Sources/Bitboard/src/bagaturchess/bitboard/impl1/internal/MoveGenerator.java b/Sources/Bitboard/src/bagaturchess/bitboard/impl1/internal/MoveGenerator.java index cfb73024..cd01f76a 100644 --- a/Sources/Bitboard/src/bagaturchess/bitboard/impl1/internal/MoveGenerator.java +++ b/Sources/Bitboard/src/bagaturchess/bitboard/impl1/internal/MoveGenerator.java @@ -68,6 +68,8 @@ public final class MoveGenerator { private final ContinuationHistory[] BF_ContinuationHistory = new ContinuationHistory[2]; + private long counter_sorting; + private Random randomizer = new Random(); private int root_search_first_move_index; @@ -695,12 +697,14 @@ public void sort() { final int start_index = nextToMove[currentPly]; final int end_index = nextToGenerate[currentPly] - 1; - //Randomize non attacks only - if (MoveUtil.isQuiet(moves[start_index])) { + //Randomize each 3 sortings + //In order to increase the effect of nondeterminism, ensure first ordering is randomized. + if (counter_sorting == 0 || counter_sorting % 5 == 0) { randomize(moveScores, moves, start_index, end_index); } + for (int i = start_index, j = i; i < end_index; j = ++i) { final long score = moveScores[i + 1]; final int move = moves[i + 1]; @@ -740,6 +744,9 @@ public void sort() { moves[start_index] = move; } } + + + counter_sorting++; } diff --git a/Sources/Resources/doc/engine/txt/release_notes_BagaturEngine.txt b/Sources/Resources/doc/engine/txt/release_notes_BagaturEngine.txt index 1f211fce..18eb880d 100644 --- a/Sources/Resources/doc/engine/txt/release_notes_BagaturEngine.txt +++ b/Sources/Resources/doc/engine/txt/release_notes_BagaturEngine.txt @@ -1,3 +1,6 @@ +Version 3.7b (25 March 2023) + * Less aggressive randomization of move order before sorting. + Version 3.7a (18 February 2023) * Change the condition for randomizing the non-attacking moves. Now they are always randomized. diff --git a/Sources/UCI/src/bagaturchess/uci/impl/Protocol.java b/Sources/UCI/src/bagaturchess/uci/impl/Protocol.java index 0cb53d4a..8175c7ba 100644 --- a/Sources/UCI/src/bagaturchess/uci/impl/Protocol.java +++ b/Sources/UCI/src/bagaturchess/uci/impl/Protocol.java @@ -30,7 +30,7 @@ public class Protocol { - public static final String COMMAND_TO_GUI_ID_VERSION_STR = "3.7a"; + public static final String COMMAND_TO_GUI_ID_VERSION_STR = "3.7b"; public static final String COMMAND_TO_ENGINE_UCI_STR = "uci"; public static final String COMMAND_TO_ENGINE_ISREADY_STR = "isready";