move_handling: improve castle rights | mask_tables: move tables and clean up mask table usage - #192
Merged
Merged
Conversation
hansbinderup
force-pushed
the
hans/improve-castle-rights
branch
2 times, most recently
from
July 23, 2025 22:11
2833d26 to
2b3971d
Compare
clarashepherd
approved these changes
Jul 26, 2025
clarashepherd
left a comment
Collaborator
There was a problem hiding this comment.
Looks good! My only suggestion is that perhaps the second and third commits could be combined, because they both perform a cleanup and reduce redundancy :)
The colour-swap trick is neat ⚡
Owner
Author
You're right, I'll squash them 👍
Glad you like it 🚀 |
No need to do runtime look up when we can do it at compile time. Minor improvement, but a nice little clean up. Bench 1354847 Signed-off-by: Hans Binderup <hbinderup94@gmail.com>
This will make it possible to add more generic masks to the file as well. Also it was stored in evaluation context which is not correct. Now it's stored as a core feature which should be able to be used by any part of the engine. This commit also cleans up the mask tables a bit. Now there's less redundant code and we store all the mask tables in one location. Bench 1354847 Signed-off-by: Hans Binderup <hbinderup94@gmail.com>
Before we had an odd mask table; a kinda reversed pawn attack mask where we could look up the pawns based on where it would attack from for a given position. This is quite redundant as we already have a way to compute this.. ie. just invert the attack (use white instead of black eg). Bench 1354847 Signed-off-by: Hans Binderup <hbinderup94@gmail.com>
hansbinderup
force-pushed
the
hans/improve-castle-rights
branch
from
July 26, 2025 20:09
2b3971d to
fd562b3
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See each commit for details :)
Mostly a clean up but also a slight performance gain in terms of the castle lookup and faster pawn attack lookup (only for terms not movegen).