Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Renegade/Search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down
23 changes: 14 additions & 9 deletions Renegade/Transpositions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TranspositionCluster*>(_aligned_malloc(clusterCount * sizeof(TranspositionCluster), 64));
Table = static_cast<TranspositionCluster*>(_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<TranspositionCluster*>(std::aligned_alloc(2 * 1024 * 1024, requestedBytes));
madvise(Table, requestedBytes, MADV_HUGEPAGE);
}
else {
Table = static_cast<TranspositionCluster*>(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<TranspositionCluster*>(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<TranspositionCluster*>(std::aligned_alloc(64, clusterCount * sizeof(TranspositionCluster)));
#endif
// Fall back if system is not compatible
Table = static_cast<TranspositionCluster*>(std::aligned_alloc(64, requestedBytes));
#endif

// Check if successful
Expand Down
2 changes: 1 addition & 1 deletion Renegade/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------------------------------

Expand Down