From c416831afc2c64d97390cc8d24d5b7c222f1ce77 Mon Sep 17 00:00:00 2001 From: pkrisz99 <5463243+pkrisz99@users.noreply.github.com> Date: Mon, 15 Jun 2026 21:16:37 +0200 Subject: [PATCH 1/3] asan complained --- Renegade/Transpositions.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Renegade/Transpositions.cpp b/Renegade/Transpositions.cpp index 73739f7..b29d665 100644 --- a/Renegade/Transpositions.cpp +++ b/Renegade/Transpositions.cpp @@ -96,18 +96,23 @@ void Transpositions::Prefetch(const uint64_t hash) const { } void Transpositions::AllocateTable(const uint64_t clusterCount) { + const uint64_t requestedBytes = clusterCount * sizeof(TranspositionCluster); + #if defined(_MSC_VER) || defined(_WIN32) // Windows: just allocate memory, don't bother with memory tricks - Table = static_cast(_aligned_malloc(clusterCount * sizeof(TranspositionCluster), 64)); + Table = static_cast(_aligned_malloc(requestedBytes, 64)); + #elif defined(__linux__) && defined(MADV_HUGEPAGE) + // Linux: request transparent huge pages for a possible speed up (if requested size is compatible with that) + if (requestedBytes % (2 * 1024 * 1024) == 0) { + Table = static_cast(std::aligned_alloc(2 * 1024 * 1024, requestedBytes)); + madvise(Table, requestedBytes, MADV_HUGEPAGE); + } + else { + Table = static_cast(std::aligned_alloc(64, requestedBytes)); + } #else - #if defined(__linux__) && defined(MADV_HUGEPAGE) - // Linux: request transparent huge pages for a possible speed up - Table = static_cast(std::aligned_alloc(2 * 1024 * 1024, clusterCount * sizeof(TranspositionCluster))); - madvise(Table, clusterCount * sizeof(TranspositionCluster), MADV_HUGEPAGE); - #else - // Fall back if system is not compatible - Table = static_cast(std::aligned_alloc(64, clusterCount * sizeof(TranspositionCluster))); - #endif + // Fall back if system is not compatible + Table = static_cast(std::aligned_alloc(64, requestedBytes)); #endif // Check if successful From 4e983e2887f8c2deca3101040928e726de8b65fb Mon Sep 17 00:00:00 2001 From: pkrisz99 <5463243+pkrisz99@users.noreply.github.com> Date: Mon, 15 Jun 2026 22:04:09 +0200 Subject: [PATCH 2/3] more bench: 4758615 --- Renegade/Search.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Renegade/Search.cpp b/Renegade/Search.cpp index 1ad5755..34cf0da 100644 --- a/Renegade/Search.cpp +++ b/Renegade/Search.cpp @@ -270,7 +270,7 @@ void Search::SearchMoves(ThreadData& t) { } - const Move& bestMove = t.PrincipalVariationTable[0].pvLine[0]; + const Move& bestMove = (t.PrincipalVariationTable[0].pvLine.size() > 0) ? t.PrincipalVariationTable[0].pvLine[0] : NullMove; if (previousBestMove == bestMove) { bestMoveStability += 1; } @@ -579,7 +579,7 @@ int Search::SearchRecursive(ThreadData& t, int depth, const int level, int alpha } // Low-depth singular extensions - else if (depth < 6 && !inCheck && (staticEval <= alpha - 29) && ttEntry.scoreType == ScoreType::LowerBound && m == ttMove) { + else if (depth < 6 && !inCheck && (staticEval <= alpha - 29) && found && ttEntry.scoreType == ScoreType::LowerBound && m == ttMove) { extension = 1; } From b8c0c9aa8539915def9e38f1df9e346fcc4f3247 Mon Sep 17 00:00:00 2001 From: pkrisz99 <5463243+pkrisz99@users.noreply.github.com> Date: Mon, 15 Jun 2026 22:21:13 +0200 Subject: [PATCH 3/3] bump --- Renegade/Utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Renegade/Utils.h b/Renegade/Utils.h index 9e29506..453e4a5 100644 --- a/Renegade/Utils.h +++ b/Renegade/Utils.h @@ -19,7 +19,7 @@ using std::cout; using std::endl; using Clock = std::chrono::high_resolution_clock; -constexpr std::string_view Version = "dev 1.2.65"; +constexpr std::string_view Version = "dev 1.2.66"; // Evaluation helpers -----------------------------------------------------------------------------