Skip to content
Merged
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
5 changes: 3 additions & 2 deletions src/repetition_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "position.hpp"
#include "rays.hpp"
#include "util/types.hpp"
#include "zobrist.hpp"
#include <unordered_set>

namespace Clockwork {
Expand Down Expand Up @@ -73,12 +74,12 @@ bool RepetitionInfo::has_game_cycle(const Position& pos, usize ply) {
Bitboard occ = pos.board().get_occupied_bitboard();
HashKey original_key = pos.get_hash_key();

HashKey other = ~(original_key ^ old_key(2));
HashKey other = original_key ^ old_key(2) ^ Zobrist::side_key;

for (usize i = 3; i <= end; i += 2) {
HashKey curr_key = old_key(i + 1);

other ^= ~(curr_key ^ old_key(i));
other ^= curr_key ^ old_key(i) ^ Zobrist::side_key;
if (other != 0) {
continue;
}
Expand Down
Loading