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

Simplify remove_piece #2460

Closed

Conversation

protonspring
Copy link

This is a non-functional simplification (speedup?). Instead of passing the piece type for remove_piece, we can rely on the board. The only exception is en-passant which must be explicitly set because the destination square for the capture is not the same as the piece to remove.

STC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 18624 W: 4147 L: 4070 D: 10407
Ptnml(0-2): 223, 1933, 4945, 1938, 260
http://tests.stockfishchess.org/tests/view/5dfeaa93e70446e17e451163

bench 5371271

@protonspring
Copy link
Author

Updated test.

LLR: 2.94 (-2.94,2.94) [-3.00,1.00] 
Total: 32306 W: 7165 L: 7113 D: 18028 
Ptnml(0-2): 414, 3372, 8488, 3446, 403

http://tests.stockfishchess.org/tests/view/5e000f52c13ac2425c4a9a0f

@protonspring
Copy link
Author

Anyone know how to fix the build?

@ghost
Copy link

ghost commented Dec 28, 2019

Anyone know how to fix the build?

Push a dummy space fixing comment. It will restart all tests.

@snicolet
Copy link
Member

snicolet commented Jan 9, 2020

Are you sure that this PR is correct in case of Chess960 castling?

@protonspring
Copy link
Author

protonspring commented Jan 9, 2020 via email

@snicolet
Copy link
Member

snicolet commented Jan 9, 2020

Andrew Grant has calculated perft numbers for a set of chess960 positions there: https://www.chessprogramming.org/Chess960_Perft_Results

@protonspring
Copy link
Author

protonspring commented Jan 9, 2020 via email

@Rocky640
Copy link

This pr is modifying only move_piece

do_castling is a special function and does not call move_piece, only put_piece

I'm quite sure everything is fine.

@protonspring
Copy link
Author

I've verified that the perft numbers for the top 10 positions in Andrew Grant's perft numbers (up to depth 6) all match exactly.

snicolet pushed a commit that referenced this pull request Jan 23, 2020
This is a non-functional simplification. Instead of passing the piece type
for remove_piece, we can rely on the board. The only exception is en-passant
which must be explicitly set because the destination square for the capture
is not the same as the piece to remove.

Verified also in the Chess960 castling case by running a couple of perft, see
the pull request discussion: #2460

STC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 18624 W: 4147 L: 4070 D: 10407
Ptnml(0-2): 223, 1933, 4945, 1938, 260
http://tests.stockfishchess.org/tests/view/5dfeaa93e70446e17e451163

No functional change
@snicolet
Copy link
Member

Merged via 7a7bcd6, thanks!

@snicolet snicolet closed this Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants