-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Optimize an expression in endgame.cpp #1644
Conversation
One thought. This code is only used for a specialized ending (KRKP). I guess it's possible that too many simplifications here could pass if the games don't use these endings much (it would be no different from master in this case). Is there any way to specifically test these kinds of endings to make sure there really is no elo loss? |
Looks good to me, However, I would prefer |
The patch doesn't look correct to me. Many of the endgame functions are written in this style. I guess the reason is that most of the code had its origins in Glaurung 1.0 which was a mailbox engine (?) |
I might be missing something, but my understanding is that
b) After above normalisation, the next line shows that master is expecting the weakside pawn to move towards the first rank
c) Finally the single line change
seems logically equivalent to this
|
@Rocky640 Sorry, you are right. I missed that |
Merged via fc3af7c, thanks. |
I believe using foward_file_bb() here is fewer instructions. a) Fewer instructions and probably more clear (debatable). b) Possible that a lookup is slower than a few local operations, but the forward_file_bb table is probably used often enough that it is always cached. Passed LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21004 W: 4263 L: 4141 D: 12600 http://tests.stockfishchess.org/tests/view/5b1cad830ebc5902ab9c6239 Closes official-stockfish#1644 No functional change.
I believe using foward_file_bb() here is fewer instructions. a) Fewer instructions and probably more clear (debatable). b) Possible that a lookup is slower than a few local operations, but the forward_file_bb table is probably used often enough that it is always cached. Passed LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21004 W: 4263 L: 4141 D: 12600 http://tests.stockfishchess.org/tests/view/5b1cad830ebc5902ab9c6239 Closes official-stockfish#1644 No functional change.
I believe using foward_file_bb() here is fewer instructions. a) Fewer instructions and probably more clear (debatable). b) Possible that a lookup is slower than a few local operations, but the forward_file_bb table is probably used often enough that it is always cached. Passed LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21004 W: 4263 L: 4141 D: 12600 http://tests.stockfishchess.org/tests/view/5b1cad830ebc5902ab9c6239 Closes official-stockfish#1644 No functional change.
This is non-functional. I believe using foward_file_bb here is fewer instructions.
GOOD) fewer instructions and probably more clear (debatable).
BAD) Possible that a lookup is slower than a few local operations, but the forward_file_bb table is probably used often enough that it is always cached.
STC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 21004 W: 4263 L: 4141 D: 12600
http://tests.stockfishchess.org/tests/view/5b1cad830ebc5902ab9c6239