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

Denormalize KRKP #2786

Closed

Conversation

protonspring
Copy link

This is a non-functional code style change that denormalizes the KRKP endgame. For me, this is a bit easier to read, and it's a little less code.

Here's why it's less code, since it may not be immediately apparent:

relative_square() and relative_rank() are 2 operations, a rank_of() is a single shift, and a pawn_push is a ternary operator.

For the relevant changes, master does 10 operations (4 relative_squares, and two rank_of).
This patch reduces the relevant code to 6 operations (3 relative_ranks) and 2 pawn_pushes.

I don't suspect this needs to be tested, but I'm happy to do it if requested.

@vondele
Copy link
Member

vondele commented Jul 3, 2020

for me that's also easier to read, but I'd like the opinion of others here..

@vondele vondele added the to be merged Will be merged shortly label Jul 6, 2020
@vondele vondele closed this in c5b2a92 Jul 6, 2020
@vondele
Copy link
Member

vondele commented Jul 6, 2020

Thanks!

ddugovic pushed a commit to ddugovic/Stockfish that referenced this pull request Jul 7, 2020
a non-functional code style change that denormalizes the KRKP endgame,
making it somewhat easier to read.

closes official-stockfish#2786

No functional change
noobpwnftw pushed a commit to noobpwnftw/Stockfish that referenced this pull request Aug 15, 2020
a non-functional code style change that denormalizes the KRKP endgame,
making it somewhat easier to read.

closes official-stockfish#2786

No functional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be merged Will be merged shortly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants