Skip to content
Permalink
Browse files

Merge pull request #3 from official-stockfish/master

Update to master
  • Loading branch information...
Chess13234 committed Dec 23, 2018
2 parents fbdb150 + 656aad8 commit 9fbe4a7a1e1aac8c930ac95655a76ebd3f5d7422
Showing with 9 additions and 11 deletions.
  1. +1 −1 src/movegen.cpp
  2. +2 −1 src/syzygy/tbprobe.cpp
  3. +6 −9 src/tt.cpp
@@ -29,7 +29,7 @@ namespace {
ExtMove* generate_castling(const Position& pos, ExtMove* moveList) {

constexpr CastlingRight Cr = Us | Cs;
constexpr bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO);
constexpr bool KingSide = (Cs == KING_SIDE);

if (pos.castling_impeded(Cr) || !pos.can_castle(Cr))
return moveList;
@@ -224,8 +224,9 @@ class TBFile : public std::ifstream {
exit(1);
}
#else
// Note FILE_FLAG_RANDOM_ACCESS is only a hint to Windows and as such may get ignored.
HANDLE fd = CreateFile(fname.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, nullptr);

if (fd == INVALID_HANDLE_VALUE)
return *baseAddress = nullptr, nullptr;
@@ -85,7 +85,7 @@ void TranspositionTable::clear() {

std::vector<std::thread> threads;

for (size_t idx = 0; idx < Options["Threads"]; idx++)
for (size_t idx = 0; idx < Options["Threads"]; ++idx)
{
threads.emplace_back([this, idx]() {

@@ -148,12 +148,9 @@ TTEntry* TranspositionTable::probe(const Key key, bool& found) const {
int TranspositionTable::hashfull() const {

int cnt = 0;
for (int i = 0; i < 1000 / ClusterSize; i++)
{
const TTEntry* tte = &table[i].entry[0];
for (int j = 0; j < ClusterSize; j++)
if ((tte[j].genBound8 & 0xFC) == generation8)
cnt++;
}
return cnt;
for (int i = 0; i < 1000 / ClusterSize; ++i)
for (int j = 0; j < ClusterSize; ++j)
cnt += (table[i].entry[j].genBound8 & 0xFC) == generation8;

return cnt * 1000 / (ClusterSize * (1000 / ClusterSize));
}

0 comments on commit 9fbe4a7

Please sign in to comment.
You can’t perform that action at this time.