From d4737819cd7aea0e7744df9973dd5c1db228000e Mon Sep 17 00:00:00 2001 From: Tomasz Sobczyk Date: Sun, 20 Sep 2020 10:39:21 +0200 Subject: [PATCH] Fix castling rights feature encoding. --- src/nnue/features/castling_right.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nnue/features/castling_right.cpp b/src/nnue/features/castling_right.cpp index 86fe06fe..ee2c88cf 100644 --- a/src/nnue/features/castling_right.cpp +++ b/src/nnue/features/castling_right.cpp @@ -27,7 +27,7 @@ namespace Eval { } for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) { - if (relative_castling_rights & (i << 1)) { + if (relative_castling_rights & (1 << i)) { active->push_back(i); } } @@ -55,8 +55,8 @@ namespace Eval { } for (Eval::NNUE::IndexType i = 0; i < kDimensions; ++i) { - if ((relative_previous_castling_rights & (i << 1)) && - (relative_current_castling_rights & (i << 1)) == 0) { + if ((relative_previous_castling_rights & (1 << i)) && + (relative_current_castling_rights & (1 << i)) == 0) { removed->push_back(i); } }