-
Notifications
You must be signed in to change notification settings - Fork 0
Zagreus 6.0 - Rewrite from Scratch #82
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
Draft
Dannyj1
wants to merge
268
commits into
master
Choose a base branch
from
rewrite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 14 commits
Commits
Show all changes
268 commits
Select commit
Hold shift + click to select a range
2db260c
Implemented check to see if a position is legal/valid, added setPiece…
Dannyj1 02e9609
Implemented makeMove and unmakeMove, started perft implementation
Dannyj1 0b98f79
Implemented setting board from FEN, implemented perft. Move generatio…
Dannyj1 f257129
Fixed many move generation issues, perft accurate up until depth 4
Dannyj1 14f567a
Implemented en passant, perft accurate up until depth 5. Depth 6 is i…
Dannyj1 0a70888
Remove some TODO comments
Dannyj1 bf3790a
Implemented position command, fixed some movegen bugs. Perft depth 6 …
Dannyj1 515cc55
Fixed en passant bug. Startpos perft accurate until depth 6.
Dannyj1 41e4cde
Performance improvements
Dannyj1 f03dc9a
Implemented castling, startpos perft accurate up until depth 7 (didn'…
Dannyj1 5e72925
Fixed castling bugs
Dannyj1 abb88e5
Implemented promotions, fix more castling bugs. Move gen seems to be …
Dannyj1 cd7b627
Slight performance improvements
Dannyj1 6bead70
Create doxygen.yml
Dannyj1 c888138
Update doxygen.yml
Dannyj1 2306222
Update doxygen.yml
Dannyj1 dc4ed04
Add Doxyfile
Dannyj1 35f7efc
Added a very basic material evaluation, commented some important func…
Dannyj1 3f27a7d
Added more documentation
Dannyj1 1385ded
Basic PV search implementation that isn't done yet.
Dannyj1 2f75aa1
Implement zobrist hashing
Dannyj1 2bedb00
Implement halfmove and fullmove clock
Dannyj1 bf81a54
Add devcontainer.json
Dannyj1 8a42f30
Install devcontainer llvm prerequisites
Dannyj1 4872019
Update devcontainer with newer clang and IWYU. Ran IWYU
Dannyj1 fde5463
Update license
Dannyj1 2037174
Merge remote-tracking branch 'origin/rewrite' into rewrite
Dannyj1 8a977fa
Implemented basic iterative deepening and a basic "go" command for uci.
Dannyj1 94e1add
Implemented qsearch and mobility evaluation
Dannyj1 45260de
Significant performance improvements
Dannyj1 f0702ef
Further performance improvements
Dannyj1 ed468d7
Implement benchmarking for openbench, disable mobility eval so it can…
Dannyj1 e4a9765
Re-enable mobility eval so it can be tested
Dannyj1 ef57626
Guarantee that the program searches at least through depth 1, also on…
Dannyj1 ece3709
Fix time management issues
Dannyj1 de73dc3
Oops
Dannyj1 96fbcad
Re-enable mobility eval for testing
Dannyj1 668c843
Hopefully fix some illegal moves and crashing when time is low
Dannyj1 94507eb
Re-enable mobility eval for testing
Dannyj1 ec2b258
Implement transposition table
Dannyj1 fe39d8f
TT bug fixes
Dannyj1 02175ed
Don't add results to TT when search is stopped to prevent bad entries…
Dannyj1 9190be5
Hopefully fixed crashing issue
Dannyj1 3ab7b93
Fix illegal moves when very low on time
Dannyj1 eca2a34
Maybe fix illegal moves when very low on time
Dannyj1 74e185d
Updated TT replacement strategy to prefer exact nodes over other node…
Dannyj1 cd378da
Another attempt at fixing illegal moves when low on time
Dannyj1 5703277
Fix compilation on certain compilers
Dannyj1 49867b3
Fix compilation on certain compilers
Dannyj1 b7e7f3a
Update benchmark command in CI
Dannyj1 796aff6
Add move ordering based only on TT
Dannyj1 d044a64
Disable TT for now, implement SEE pruning in qsearch
Dannyj1 7b66f2b
SEE fix
Dannyj1 304bbc5
Fixed checkmate checks missing in qsearch. Moved SEE to the right fun…
Dannyj1 cdb9ca0
Disable TT related UCI code
Dannyj1 84c6523
Add evasion generation for checkmate detection in qsearch
Dannyj1 9d8710c
Fix king moves not being generated in check when using evasions gener…
Dannyj1 532f259
Shorten benchmark
Dannyj1 57aed3d
Fix issue with en passant being parsed incorrectly through UCI
Dannyj1 192694d
Fixed half move and full move clock not being fully parsed from FEN s…
Dannyj1 961e46c
Added PV, corrected some weird iterative deepening behavior
Dannyj1 4d948dc
Fix issues with board resetting when the position command is called.
Dannyj1 358db8a
Add note to README
Dannyj1 54d08e6
Fix README formatting
Dannyj1 a4671c6
Forgot to implement isDraw...
Dannyj1 4d992cf
Fixed issue where the 50-move rule takes priority over checkmate
Dannyj1 63629d9
Add evasion movegen to pvsearch
Dannyj1 5edab0c
Fixed en passant zobrist hash update always happening, even if it sho…
Dannyj1 f20a820
Added PV move sorting
Dannyj1 7dea412
Added TT and TT move sorting
Dannyj1 955ca6c
Add delta pruning to qSearch
Dannyj1 68ed389
Fix failing test
Dannyj1 1d5b5f6
Remove delta pruning, add see pruning to qSearch
Dannyj1 52b4bd3
Use a faster SEE algorithm (largely based on the one from Ethereal)
Dannyj1 651f29c
No SEE pruning when in check
Dannyj1 3ce1b54
Pass move instead of square to see
Dannyj1 055e27c
Added PST evaluation
Dannyj1 9fb3b81
Merge material and PSTQ eval
Dannyj1 d9d3b22
Fix PSTQ eval being wrong
Dannyj1 1b435aa
Make sure PSTs are initialized properly
Dannyj1 f5dfe32
Prepare movepicker for more move scoring implementations, prepare cod…
Dannyj1 dcce535
Attempting Internal Iterative Reductions
Dannyj1 ef9fe23
Revert "Attempting Internal Iterative Reductions"
Dannyj1 366abf5
MVV-LVA move ordering
Dannyj1 4d8d318
Try SEE in move ordering, but only in pvSearch
Dannyj1 0d3701f
Revert "Try SEE in move ordering, but only in pvSearch"
Dannyj1 127b3dd
History gravity + history malus
Dannyj1 e03878e
Fixed typo where history was updated on captures instead of quiet moves
Dannyj1 a129402
Countermove heuristic
Dannyj1 cbe2dbf
Fix history malus being applied to the move causing the beta cutoff, …
Dannyj1 15a1d83
Re-enable countermove heuristic
Dannyj1 b6c5202
Remove countermove heuristic, fix default TT move being A1 instead of…
Dannyj1 5df11f9
Fix bestmove not being set in pvSearch, fix bestmove not being kept t…
Dannyj1 c0b6fcc
Add basic Null Move Pruning implementation
Dannyj1 492ce42
Make NMP R constant for now
Dannyj1 ab84ce7
Only NMP when eval >= beta
Dannyj1 8fbd2db
Revert "Only NMP when eval >= beta"
Dannyj1 22fdd76
More dynamic R in NMP
Dannyj1 d7aef66
More aggressive NMP, but don't drop straight into qSearch
Dannyj1 c354674
Revert "More aggressive NMP, but don't drop straight into qSearch"
Dannyj1 fc2c427
Revert "More dynamic R in NMP"
Dannyj1 79be322
Consistency in search regarding fail-hard
Dannyj1 2730eb1
Don't allow NMP to drop into qSearch
Dannyj1 dada7ae
Revert "Don't allow NMP to drop into qSearch"
Dannyj1 3570298
Make NMP reduction factor dynamic (based on depth only)
Dannyj1 53a3231
Use fail-soft instead of fail-hard
Dannyj1 f89c276
Don't consider underpromotions in qSearch
Dannyj1 6199d72
Revert "Don't consider underpromotions in qSearch"
Dannyj1 b29b4f0
Don't do stand pat while in check
Dannyj1 5c55d5c
Basic LMR implementation
Dannyj1 04a6b5d
Reduce moves in LMR less when the current node is a PV or when the cu…
Dannyj1 7310695
Revert "Reduce moves in LMR less when the current node is a PV or whe…
Dannyj1 860a2c7
Start LMR ealier in non-PV nodes
Dannyj1 c365a0d
Fix LMR starting too early
Dannyj1 7c585de
LMR searches should be Non-PV/Regular searches
Dannyj1 e68bc14
Reduce less when in PV and when in check
Dannyj1 3fc29d7
Reduce less when a move gives checks
Dannyj1 f28e08c
Reduce LMR less when a move gives checks, is a promotion or is a capture
Dannyj1 d8433d9
No LMR foraptures and promotions
Dannyj1 596d922
No LMR for captures and promotions in PV only
Dannyj1 4cbd86f
Speed up movepicker sorting, rework evaluation
Dannyj1 0210d70
Check extension
Dannyj1 b049794
Check extension before dropping into qSearch
Dannyj1 d3e0a09
Rework parts of eval again, implemented eval tracing, started impleme…
Dannyj1 4f29883
Basic gradient descent tuner implementation
Dannyj1 aecf02c
Rework parts of eval again, implemented eval tracing, started impleme…
Dannyj1 8ee63db
Hopefully fixed some tuner issues
Dannyj1 35625c5
Tweaked hyperparameters
Dannyj1 f0b5d4d
Don't consider enemy king square in mobility evaluation
Dannyj1 3b8a4be
Restore base evaluation features to benchmark new eval terms against
Dannyj1 14439a6
Exclude squares attacked by pawns from mobility
Dannyj1 c1cbd93
Added basic square control evaluation to augment mobility evaluation
Dannyj1 488ce6c
Correct mate score threshold check in TT probe
Dannyj1 a572bff
Bishop pair bonus
Dannyj1 c29df0d
Add pawn shield eval bonus
Dannyj1 211a7f4
Fix pawn shield rewarding doubled pawns
Dannyj1 4aab013
Different board side/king file detection for pawn shield
Dannyj1 267c829
Decrease pawnshield bonus, Revert "Different board side/king file det…
Dannyj1 a9a0da8
Revert "Decrease pawnshield bonus, Revert "Different board side/king …
Dannyj1 22e983c
Revert "Different board side/king file detection for pawn shield"
Dannyj1 1d68ff6
Revert "Fix pawn shield rewarding doubled pawns"
Dannyj1 082cafd
Revert "Add pawn shield eval bonus"
Dannyj1 01cec88
Add backward pawn evaluation
Dannyj1 86f33e4
Add backward pawn on (half-)open files evaluation
Dannyj1 a42a5e0
Increase backward pawn penalty
Dannyj1 4d508c1
Revert "Increase backward pawn penalty"
Dannyj1 12a2001
Fix backwards pawn on open file detection
Dannyj1 fe88793
Doubled pawn evaluation
Dannyj1 de7a9dd
Knight outpost evaluation
Dannyj1 4f3f4a8
Knight potential outpost evaluation
Dannyj1 e8fc7d5
Revert "Knight potential outpost evaluation"
Dannyj1 3f6b17b
Use proper pawn spans for outpost evaluation
Dannyj1 8f3056b
Fix outpost evaluation
Dannyj1 68eed15
Fix outpost evaluation: forgot a shift operation
Dannyj1 fb24bc1
Performance improvements
Dannyj1 7fda1b2
Pawn shield evaluation
Dannyj1 a1f2356
Fix gradient descent tuner
Dannyj1 4f9c2b7
Fix incorrect stand-pat evaluation in check
Dannyj1 f6ae755
Tweak outpost evaluation
Dannyj1 29c013e
Fix 3-fold repetition actually checking for 2-fold repetition
Dannyj1 34b12ef
Don't perform a re-search when score < beta in pvSearch.
Dannyj1 d5d63a3
Don't allow LMR to reduce captures and promotions in non-PV nodes
Dannyj1 cde01d3
Slight optimization of getSquareAttackers
Dannyj1 8a9e2b3
Fix TT best move being wrong when a beta-cutoff happens
Dannyj1 f2b1cad
Fix wrong node type being assigned in the TT in certain cases.
Dannyj1 890277c
Try different TT replacement scheme
Dannyj1 d57618a
Revert "Try different TT replacement scheme"
Dannyj1 b0fb1aa
Try depth * depth for history heuristic
Dannyj1 fdb2d04
Revert "Try depth * depth for history heuristic"
Dannyj1 41647ac
Fix en passant moves not being generated in qsearch's movegen
Dannyj1 a2f3509
Make sure history heuristic gets cleared between benchmark positions …
Dannyj1 bd760c3
Fix an issue where qsearch movegen did not generate promotion moves
Dannyj1 d2f4e55
Fix an issue where evasion movegen did not generate en passant moves
Dannyj1 d61ec13
Move draw check to earliest possible moment in pvSearch and qSearch
Dannyj1 b38d96b
Fix some draw detection issues
Dannyj1 cd7c9d7
Fix unmakeMove making board hash history inaccurate in some cases
Dannyj1 1c5967a
Made SEE less bug-prone
Dannyj1 51552d6
Remove redundant draw checks
Dannyj1 a1278c7
Add SEE + Capture History to move ordering
Dannyj1 073fa05
Don't generate castling moves during qsearch or evasions movegen
Dannyj1 2cb8b66
Tweak benchmark positions
Dannyj1 39bb64d
Fix en passant moves often not being considered captures in several p…
Dannyj1 40b95aa
Fix SEE logic for en passant moves causing wrong SEE evaluations
Dannyj1 254fdab
Add castling tests
Dannyj1 762ea0f
Fix qsearch movegen generating more moves than it should
Dannyj1 c4bfdb6
Revert "Made SEE less bug-prone"
Dannyj1 1d5b497
Refactor some movegen genMask weirdness
Dannyj1 547f72d
Add virtual mobility
Dannyj1 15af1ea
Exclude opponent pieces from virtual mobility
Dannyj1 0227382
Revert "Exclude opponent pieces from virtual mobility"
Dannyj1 a26b4b8
Revert back to basic evaluation terms
Dannyj1 9dfaaa2
Don't update history table for promotions, add promotions to move ord…
Dannyj1 94be73a
Add killer move heuristic
Dannyj1 40125f7
Revert "Add killer move heuristic"
Dannyj1 56d3ed5
Make LMR less aggressive
Dannyj1 f1d6a16
Tweak benchmark
Dannyj1 2f662c0
Even less aggressive LMR
Dannyj1 8031eda
Implement very basic futility pruning
Dannyj1 b76cce7
Fix compilation on GCC
Dannyj1 5d64f05
Add stat tracing in search for debugging purposes
Dannyj1 9db5cf7
Fix TT indexing issues affecting hitrate
Dannyj1 31ef82e
Make validationHash 16 bits instead of 64 in TT
Dannyj1 dba2e3e
Add support for the other options in the UCI go command
Dannyj1 1d4babd
Remove futility pruning
Dannyj1 63a1b59
Add proper futility pruning
Dannyj1 b7c09c1
More aggressive futility pruning
Dannyj1 dbde7b3
Added more positions to benchmark and increased depth
Dannyj1 76f6cb4
More aggressive NMP
Dannyj1 ba7fa81
Use LMR after 2 moves are searched instead of 3
Dannyj1 6551769
Revert "Use LMR after 2 moves are searched instead of 3"
Dannyj1 52613d5
Attempt at fixing crash on one of the uci commands that happens under…
Dannyj1 527cc92
Implement uci quit command
Dannyj1 4332295
Attempt to fix badalloc on larger table sizes
Dannyj1 5220263
Reverse futility pruning
Dannyj1 3e78f3c
No reverse futility pruning when there is no TT move
Dannyj1 64571eb
Revert "No reverse futility pruning when there is no TT move"
Dannyj1 fea71d0
Add killer move heuristic
Dannyj1 f2e0e47
Disable killer moves for now, fix conditions on PV re-search
Dannyj1 f80b2b2
Properly handle LMR re-searches
Dannyj1 0ccc2b2
Refactor and clean up search logic
Dannyj1 151e71f
Only NMP when eval >= beta
Dannyj1 b4cc148
Fix pvMove indexation issue in move_picker.cpp
Dannyj1 a8039f0
Singular extensions
Dannyj1 305ca30
Disable singular extensions for now, fix TT depth not being able to f…
Dannyj1 80b0592
Use simpler and more effective TT replacement scheme
Dannyj1 0e803e0
Preserve best TT move when overwriting an entry that has a best move …
Dannyj1 93c5d05
Fix invalid assert
Dannyj1 8846833
Remove redundant and worse performing previousPvLine from board and m…
Dannyj1 d55c43a
Remove INITIAL_ALPHA and INITIAL_BETA
Dannyj1 6fa1d39
Killer moves
Dannyj1 e395a6b
Add doubled and tripled pawn eval
Dannyj1 eadcfaa
Update profiling flags in CMakeLists.txt
Dannyj1 d4d77e0
Add TT prefetch
Dannyj1 0874e15
Move board.getOccupiedBitboard() calls outside evaluation loops
Dannyj1 f00c713
Aspiration windows
Dannyj1 0a61765
Fix compilation on certain systems or compiler
Dannyj1 a2040fe
More aggressive LMR
Dannyj1 81da83e
Improved mobility eval
Dannyj1 f201d8c
Revert "Improved mobility eval"
Dannyj1 75bc6fc
Add gradient descent tuner with SPSA gradient estimation
Dannyj1 0efed31
Testing some tuner improvements
Dannyj1 36deb15
Some more tuner changes
Dannyj1 1b4e8b4
Revert back to untuned values
Dannyj1 7a2ba62
Internal iterative reductions (IIR)
Dannyj1 1c39af0
Revert "Internal iterative reductions (IIR)"
Dannyj1 a3de839
Fix compilation on certain compilers
Dannyj1 7c44d94
Exclude moves that give check from futility pruning
Dannyj1 0c8783a
Test skipping LMR while in check or if a move gives check
Dannyj1 6a122e6
Revert "Test skipping LMR while in check or if a move gives check"
Dannyj1 4118626
Improved performance of move legality checking. Reduced the amount of…
Dannyj1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,5 @@ | |
| /cmake-build-debug/ | ||
| /cmake-build-release/ | ||
| /perft.txt | ||
| /quiet-labeled.epd | ||
| /src/uci-specification.txt | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.