Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zagreus 6.0 - Rewrite from Scratch #82

Draft
wants to merge 89 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
4b7f54b
Remove all code so we can start the rewrite
Dannyj1 May 4, 2024
68416c2
Started implementing UCI
Dannyj1 May 23, 2024
bb32362
Push old changes that weren't pushed yet
Dannyj1 Aug 22, 2024
73aedd8
Changed board implementation
Dannyj1 Sep 17, 2024
6b789c8
Don't copy MoveList to move_gen, use reference instead
Dannyj1 Oct 1, 2024
425d82e
Implement very basic pawn move generation
Dannyj1 Oct 1, 2024
c7cec56
Implement knight move generation
Dannyj1 Oct 4, 2024
83739e2
Attempts at fixing CI
Dannyj1 Oct 4, 2024
bfebd6d
Apply suggestions from code review
Dannyj1 Oct 5, 2024
e2c7a3e
Addressed several code review points, improved structuring of certain…
Dannyj1 Oct 5, 2024
25c544d
Fix to_underlying import
Dannyj1 Oct 5, 2024
3da939a
Fixed bitscanReverse
Dannyj1 Oct 5, 2024
5bc36db
uci-specification.txt was not supposed to be pushed to git
Dannyj1 Oct 5, 2024
89e2e4f
Implement bishop move generation, fix moves being generated that woul…
Dannyj1 Oct 5, 2024
c8e4834
Implement basic move generation for the remaining pieces.
Dannyj1 Oct 6, 2024
06bda65
Fix imports, integrate include what you use with CMake when using the…
Dannyj1 Oct 6, 2024
4a05b0a
Implement lookup tables, added function that gets all attackers of a …
Dannyj1 Oct 6, 2024
dec48d5
Fix wrong import that breaks CI
Dannyj1 Oct 6, 2024
2db260c
Implemented check to see if a position is legal/valid, added setPiece…
Dannyj1 Oct 8, 2024
02e9609
Implemented makeMove and unmakeMove, started perft implementation
Dannyj1 Oct 8, 2024
0b98f79
Implemented setting board from FEN, implemented perft. Move generatio…
Dannyj1 Oct 9, 2024
f257129
Fixed many move generation issues, perft accurate up until depth 4
Dannyj1 Oct 9, 2024
14f567a
Implemented en passant, perft accurate up until depth 5. Depth 6 is i…
Dannyj1 Oct 9, 2024
0a70888
Remove some TODO comments
Dannyj1 Oct 9, 2024
bf3790a
Implemented position command, fixed some movegen bugs. Perft depth 6 …
Dannyj1 Oct 10, 2024
515cc55
Fixed en passant bug. Startpos perft accurate until depth 6.
Dannyj1 Oct 10, 2024
41e4cde
Performance improvements
Dannyj1 Oct 10, 2024
f03dc9a
Implemented castling, startpos perft accurate up until depth 7 (didn'…
Dannyj1 Oct 12, 2024
5e72925
Fixed castling bugs
Dannyj1 Oct 13, 2024
abb88e5
Implemented promotions, fix more castling bugs. Move gen seems to be …
Dannyj1 Oct 13, 2024
cd7b627
Slight performance improvements
Dannyj1 Oct 13, 2024
6bead70
Create doxygen.yml
Dannyj1 Oct 15, 2024
c888138
Update doxygen.yml
Dannyj1 Oct 15, 2024
2306222
Update doxygen.yml
Dannyj1 Oct 15, 2024
dc4ed04
Add Doxyfile
Dannyj1 Oct 15, 2024
35f7efc
Added a very basic material evaluation, commented some important func…
Dannyj1 Oct 19, 2024
3f27a7d
Added more documentation
Dannyj1 Oct 19, 2024
1385ded
Basic PV search implementation that isn't done yet.
Dannyj1 Oct 29, 2024
2f75aa1
Implement zobrist hashing
Dannyj1 Nov 3, 2024
2bedb00
Implement halfmove and fullmove clock
Dannyj1 Nov 5, 2024
bf81a54
Add devcontainer.json
Dannyj1 Nov 20, 2024
8a42f30
Install devcontainer llvm prerequisites
Dannyj1 Nov 20, 2024
4872019
Update devcontainer with newer clang and IWYU. Ran IWYU
Dannyj1 Dec 1, 2024
fde5463
Update license
Dannyj1 Jan 4, 2025
2037174
Merge remote-tracking branch 'origin/rewrite' into rewrite
Dannyj1 Jan 4, 2025
8a977fa
Implemented basic iterative deepening and a basic "go" command for uci.
Dannyj1 Jan 27, 2025
94e1add
Implemented qsearch and mobility evaluation
Dannyj1 Jan 29, 2025
45260de
Significant performance improvements
Dannyj1 Jan 31, 2025
f0702ef
Further performance improvements
Dannyj1 Jan 31, 2025
ed468d7
Implement benchmarking for openbench, disable mobility eval so it can…
Dannyj1 Jan 31, 2025
e4a9765
Re-enable mobility eval so it can be tested
Dannyj1 Jan 31, 2025
ef57626
Guarantee that the program searches at least through depth 1, also on…
Dannyj1 Jan 31, 2025
ece3709
Fix time management issues
Dannyj1 Jan 31, 2025
de73dc3
Oops
Dannyj1 Jan 31, 2025
96fbcad
Re-enable mobility eval for testing
Dannyj1 Jan 31, 2025
668c843
Hopefully fix some illegal moves and crashing when time is low
Dannyj1 Jan 31, 2025
94507eb
Re-enable mobility eval for testing
Dannyj1 Jan 31, 2025
ec2b258
Implement transposition table
Dannyj1 Jan 31, 2025
fe39d8f
TT bug fixes
Dannyj1 Feb 1, 2025
02175ed
Don't add results to TT when search is stopped to prevent bad entries…
Dannyj1 Feb 1, 2025
9190be5
Hopefully fixed crashing issue
Dannyj1 Feb 1, 2025
3ab7b93
Fix illegal moves when very low on time
Dannyj1 Feb 1, 2025
eca2a34
Maybe fix illegal moves when very low on time
Dannyj1 Feb 1, 2025
74e185d
Updated TT replacement strategy to prefer exact nodes over other node…
Dannyj1 Feb 1, 2025
cd378da
Another attempt at fixing illegal moves when low on time
Dannyj1 Feb 1, 2025
5703277
Fix compilation on certain compilers
Dannyj1 Feb 1, 2025
49867b3
Fix compilation on certain compilers
Dannyj1 Feb 1, 2025
b7e7f3a
Update benchmark command in CI
Dannyj1 Feb 1, 2025
796aff6
Add move ordering based only on TT
Dannyj1 Feb 1, 2025
d044a64
Disable TT for now, implement SEE pruning in qsearch
Dannyj1 Feb 2, 2025
7b66f2b
SEE fix
Dannyj1 Feb 2, 2025
304bbc5
Fixed checkmate checks missing in qsearch. Moved SEE to the right fun…
Dannyj1 Feb 2, 2025
cdb9ca0
Disable TT related UCI code
Dannyj1 Feb 2, 2025
84c6523
Add evasion generation for checkmate detection in qsearch
Dannyj1 Feb 2, 2025
9d8710c
Fix king moves not being generated in check when using evasions gener…
Dannyj1 Feb 2, 2025
532f259
Shorten benchmark
Dannyj1 Feb 2, 2025
57aed3d
Fix issue with en passant being parsed incorrectly through UCI
Dannyj1 Feb 2, 2025
192694d
Fixed half move and full move clock not being fully parsed from FEN s…
Dannyj1 Feb 2, 2025
961e46c
Added PV, corrected some weird iterative deepening behavior
Dannyj1 Feb 3, 2025
4d948dc
Fix issues with board resetting when the position command is called.
Dannyj1 Feb 3, 2025
358db8a
Add note to README
Dannyj1 Feb 3, 2025
54d08e6
Fix README formatting
Dannyj1 Feb 3, 2025
a4671c6
Forgot to implement isDraw...
Dannyj1 Feb 3, 2025
4d992cf
Fixed issue where the 50-move rule takes priority over checkmate
Dannyj1 Feb 3, 2025
63629d9
Add evasion movegen to pvsearch
Dannyj1 Feb 3, 2025
5edab0c
Fixed en passant zobrist hash update always happening, even if it sho…
Dannyj1 Feb 3, 2025
f20a820
Added PV move sorting
Dannyj1 Feb 3, 2025
7dea412
Added TT and TT move sorting
Dannyj1 Feb 3, 2025
955ca6c
Add delta pruning to qSearch
Dannyj1 Feb 4, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "17"
version: "18"
arch: "x64"

- name: Configure CMake & Build
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-latest
build-name: Linux
artifact-extension: .tar.gz
config-command: cmake -DCMAKE_BUILD_TYPE=Release -DAPPEND_VERSION_USE_GIT=OFF .
Expand All @@ -39,9 +39,9 @@ jobs:

- name: Setup Clang (Linux)
if: runner.os == 'Linux'
uses: KyleMayes/install-llvm-action@v1
uses: KyleMayes/install-llvm-action@v2
with:
version: "17"
version: "18"

- name: Setup msys and install required packages
if: runner.os == 'Windows'
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:

create-release:
needs: build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Clang
uses: KyleMayes/install-llvm-action@v2
with:
version: "17"
version: "18"
arch: "x64"

- name: Install valgrind
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/cmake-build-debug/
/cmake-build-release/
/perft.txt
/quiet-labeled.epd
/src/uci-specification.txt
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
# along with Zagreus. If not, see <https://www.gnu.org/licenses/>.

cmake_minimum_required(VERSION 3.25)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
project(Zagreus)
set(ZAGREUS_VERSION_MAJOR "5")
set(ZAGREUS_VERSION_MAJOR "6")
set(ZAGREUS_VERSION_MINOR "0")

# Default values
Expand Down Expand Up @@ -200,27 +200,27 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BUILD_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${BUILD_FLAGS}")

file(GLOB inc_zagreus "src/*.h" "src/*.cpp")
file(GLOB inc_senjo "senjo/*.h" "senjo/*.cpp")

add_executable(Zagreus src/main.cpp ${inc_senjo} ${inc_zagreus})
add_executable(Zagreus src/main.cpp ${inc_zagreus})
Dannyj1 marked this conversation as resolved.
Show resolved Hide resolved

target_compile_definitions(Zagreus PRIVATE ZAGREUS_VERSION_MAJOR="${ZAGREUS_VERSION_MAJOR}")
target_compile_definitions(Zagreus PRIVATE ZAGREUS_VERSION_MINOR="${ZAGREUS_VERSION_MINOR}")

if (ENABLE_TESTS)
file(GLOB tests_folder "tests/*.h" "tests/*.cpp")

# Remove main from inc_zagreus
list(REMOVE_ITEM inc_zagreus "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")

add_executable(zagreus-tests ${tests_folder} ${inc_senjo} ${inc_zagreus})
target_link_libraries(zagreus-tests PRIVATE Catch2::Catch2WithMain)

target_compile_definitions(zagreus-tests PRIVATE ZAGREUS_VERSION_MAJOR="${ZAGREUS_VERSION_MAJOR}")
target_compile_definitions(zagreus-tests PRIVATE ZAGREUS_VERSION_MINOR="${ZAGREUS_VERSION_MINOR}")

list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
include(CTest)
include(Catch)
catch_discover_tests(zagreus-tests)
endif ()
# TODO: re-enable
#if (ENABLE_TESTS)
# file(GLOB tests_folder "tests/*.h" "tests/*.cpp")
#
# # Remove main from inc_zagreus
# list(REMOVE_ITEM inc_zagreus "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
#
# add_executable(zagreus-tests ${tests_folder} ${inc_zagreus})
# target_link_libraries(zagreus-tests PRIVATE Catch2::Catch2WithMain)
#
# target_compile_definitions(zagreus-tests PRIVATE ZAGREUS_VERSION_MAJOR="${ZAGREUS_VERSION_MAJOR}")
# target_compile_definitions(zagreus-tests PRIVATE ZAGREUS_VERSION_MINOR="${ZAGREUS_VERSION_MINOR}")
#
# list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
# include(CTest)
# include(Catch)
# catch_discover_tests(zagreus-tests)
#endif ()
Dannyj1 marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ cmake --build .

# Credits
Thanks to:

- [zd3nik](https://github.com/zd3nik) for the [Senjo UCI Adapter](https://github.com/zd3nik/SenjoUCIAdapter), which I
slightly modified
- [AndyGrant](https://github.com/AndyGrant) for the easy to use and open
source [OpenBench Testing Framework](https://github.com/AndyGrant/OpenBench), making testing my engine SO much easier
and allowing you to distribute test over multiple devices (I use a private instance of OpenBench)
Expand All @@ -107,6 +104,3 @@ GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Zagreus. If not, see <https://www.gnu.org/licenses/>.

This project uses the [Senjo UCI Adapter](https://github.com/zd3nik/SenjoUCIAdapter) by zd3nik which is licensed under
the MIT license. All files from the Senjo UCI Adapter retain their original copyright and license notices.
Loading