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
24 changes: 17 additions & 7 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,22 @@ jobs:
run: echo "dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Configure CMake
run: >
cmake -B ${{ steps.vars.outputs.dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
shell: bash
run: |
CXX_FLAGS=""
LINK_FLAGS=""
if [[ "${{ matrix.os }}" == "ubuntu-latest" && "${{ matrix.build_type }}" == "Debug" ]]; then
CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g"
LINK_FLAGS="-fsanitize=address,undefined"
fi

cmake -B "${{ steps.vars.outputs.dir }}" \
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS_DEBUG="$CXX_FLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$LINK_FLAGS" \
-S "${{ github.workspace }}"

- name: Build
run: cmake --build ${{ steps.vars.outputs.dir }} --config ${{ matrix.build_type }}
Expand All @@ -68,4 +78,4 @@ jobs:
ctest --build-config ${{ matrix.build_type }} --verbose
else
ctest --verbose
fi
fi
4 changes: 3 additions & 1 deletion position.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ template <typename T, std::size_t MaxSize> class HeapAllocatedValueList {
};

enum class MoveGenType : uint8_t { ALL, PAWN, KNIGHT, BISHOP, ROOK, QUEEN, KING, CAPTURE };
template <typename PieceC = EnginePiece, typename = std::enable_if_t<std::is_same_v<PieceC, EnginePiece> || std::is_same_v<PieceC, PolyglotPiece> || std::is_same_v<PieceC, ContiguousMappingPiece>>> class _Position {
template <typename PieceC = EnginePiece, typename = std::enable_if_t<is_piece_enum<PieceC>::value>> class _Position {
private:
HistoryEntry<PieceC> current_state;

Expand Down Expand Up @@ -524,6 +524,8 @@ template <typename PieceC = EnginePiece, typename = std::enable_if_t<std::is_sam
}
return b != 0;
}
// Material-only key (note: Zobrist=Zpieces^Zep^Zcastling^Zturn, we just XORs the remaining, it's trivial)
__FORCEINLINE Key material_key() const { return hash() ^ (zobrist::RandomTurn * ~sideToMove()) ^ (zobrist::RandomCastle[castlingRights()]) ^ (zobrist::RandomEP[ep_square() == SQ_NONE ? file_of(ep_square()) : FILE_NB]); }
template <bool Strict = false> bool is_valid() const;

private:
Expand Down