Skip to content

Commit

Permalink
Improve only on tt mate
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaCat-OuO committed Nov 10, 2024
1 parent 56a8f62 commit 48130f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ Value Search::Worker::search(
excludedMove = ss->excludedMove;
posKey = pos.key();
auto [ttHit, ttData, ttWriter] = tt.probe(posKey);
ttHit &= tt.stable(pos);
ttHit &= std::abs(ttData.value) < VALUE_MATE_IN_MAX_PLY || tt.stable(pos);
// Need further processing of the saved data
ss->ttHit = ttHit;
ttData.move = rootNode ? thisThread->rootMoves[thisThread->pvIdx].pv[0]
Expand Down Expand Up @@ -1423,7 +1423,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
// Step 3. Transposition table lookup
posKey = pos.key();
auto [ttHit, ttData, ttWriter] = tt.probe(posKey);
ttHit &= tt.stable(pos);
ttHit &= std::abs(ttData.value) < VALUE_MATE_IN_MAX_PLY || tt.stable(pos);
// Need further processing of the saved data
ss->ttHit = ttHit;
ttData.move = ttHit ? ttData.move : Move::none();
Expand Down
1 change: 1 addition & 0 deletions src/tt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ uint8_t TranspositionTable::generation() const { return generation8; }
// minus 8 times its relative age. TTEntry t1 is considered more valuable than
// TTEntry t2 if its replace value is greater than that of t2.
std::tuple<bool, TTData, TTWriter> TranspositionTable::probe(const Key key) const {

TTEntry* const tte = first_entry(key);
const uint16_t key16 = uint16_t(key); // Use the low 16 bits as key inside the cluster

Expand Down

0 comments on commit 48130f2

Please sign in to comment.