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

Position::key_after(Move m) #4130

Closed
wants to merge 2 commits into from

Conversation

mstembera
Copy link
Contributor

STC: https://tests.stockfishchess.org/tests/view/62f8547123d42b50a8dac674
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 176640 W: 47699 L: 47189 D: 81752
Ptnml(0-2): 776, 18599, 49129, 18971, 845

A bug fix plus non functional speed optimization. Position::key_after(Move m) is now consistent with Position::key() thus prefetching correct TT entries which speeds things up. Related PR #3759

No functional change
bench: 5868987

@vondele
Copy link
Member

vondele commented Aug 15, 2022

any chance this could be rewritten such that we can guarantee that the definitions in key_after() and key() remain consistent ? Like define constants 13/14 and 8 and reuse them in both functions, or do that part with some inline function?

@mstembera
Copy link
Contributor Author

That's a really good suggestion and I thought about that also but wasn't sure of the trade off because I couldn't think of a clean enough way I was happy with. I pushed my current best attempt but please feel free to suggest additional improvements.

mstembera added 2 commits August 15, 2022 14:26
@vondele vondele closed this in 02ef1f4 Aug 17, 2022
PikaCat-OuO pushed a commit to official-pikafish/Pikafish that referenced this pull request Oct 7, 2022
STC: https://tests.stockfishchess.org/tests/view/62f8547123d42b50a8dac674
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 176640 W: 47699 L: 47189 D: 81752
Ptnml(0-2): 776, 18599, 49129, 18971, 845

A bug fix plus non functional speed optimization. Position::key_after(Move m) is now
consistent with Position::key() thus prefetching correct TT entries which speeds things up.
Related PR #3759

closes official-stockfish/Stockfish#4130

No functional change

(cherry picked from commit 02ef1f4)
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

2 participants