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

Replace Edges and Corner arrays in endgames.cpp #2577

Closed

Conversation

protonspring
Copy link

This is a functional simplification that removes the large arrays in endgames.cpp. I submit this version (ps_endgames9) because it performed best at LTC, but may regress a little at STC. In this patch, the values are closer to master, but are more expensive to calculate.

ps_endgames8 is faster, but less accurate. This seems to support better at STC performance, but worse at LTC. This may be just noise, I don't know. Is ps_endgames8 better?
http://tests.stockfishchess.org/tests/user/protonspring

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

Bench 5070301

@vondele
Copy link
Member

vondele commented Mar 9, 2020

merge into master, with the addition of a fen that should trigger endgames more often.

@MichaelB7
Copy link
Contributor

MichaelB7 commented Mar 11, 2020

This was not a simplification that one would expect with a simplification. It is a functional change which obfuscates the array that was being used which was quite easy for a reader to understand. In addition the alleged bug was not explained or detailed. If there was a bug created by a recent prior commit, the buggy commit should be reverted first and this simplification should be tested against the unbugged version. This commit being accepted as a simplification is dubious at best. In the big scheme of things , it probably matters very little, but it does set a precedent which may not be best practice. Just my $.02.

@mstembera
Copy link
Contributor

IMO the arrays made it much easier to comprehend what the code was actually doing. The formulas while using less syntax are more obfuscated. Also I appreciate the fast commits of patches but it would be nice to leave things open for say 48 hours in order to allow people to have a chance to comment before committing.

MichaelB7 added a commit to MichaelB7/Stockfish that referenced this pull request Mar 11, 2020
… strictly for Stockfish, also note, I previouslly reverted 'Consolidate Square Flipping official-stockfish#2568' since it supposedly contained a bug, as noted in commit 47be966 .
@vondele
Copy link
Member

vondele commented Mar 11, 2020

I agree this one was a bit too quick. This was indeed because it contained a bug fix. That bug fix should have been presented as a separate PR.

@protonspring
Copy link
Author

protonspring commented Mar 11, 2020 via email

@vondele
Copy link
Member

vondele commented Mar 11, 2020

@protonspring I think there is nothing to be done right now. I'd suggest next time you notice a bug in an earlier commit, communicate it clearly and early.... bugs happen, we just need to deal with it effectively.

With the added fen, at least our testing improves a bit.... long ago I proposed to have some coverage testing as part of CI, and at that point, I observed that KBNK was not covered, unfortunately, that was not followed up.

silversolver1 added a commit to silversolver1/Stockfish that referenced this pull request Mar 11, 2020
* Equations for edges and corners.

This is a functional simplification that removes the large arrays in endgames.cpp.
It also fixes a recently introduced bug (960d59d) in KNBvK,
now using flip_file() instead of ~.

One fen added to bench to increase endgame coverage.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

closes official-stockfish#2577

Bench: 5527957

* Remove set statScore to zero

Simplification. Removes setting statScore to zero if negative.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 84820 W: 16100 L: 16033 D: 52687
Ptnml(0-2): 1442, 9865, 19723, 9944, 1436
https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57658 W: 7435 L: 7391 D: 42832
Ptnml(0-2): 441, 5397, 17104, 5451, 436
https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307

closes official-stockfish#2578

Bench: 5168890

Co-authored-by: protonspring <mike@whiteley.org>
silversolver1 added a commit to silversolver1/Stockfish that referenced this pull request Mar 14, 2020
* Equations for edges and corners.

This is a functional simplification that removes the large arrays in endgames.cpp.
It also fixes a recently introduced bug (960d59d) in KNBvK,
now using flip_file() instead of ~.

One fen added to bench to increase endgame coverage.

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 174724 W: 33325 L: 33404 D: 107995
Ptnml(0-2): 2503, 19607, 43181, 19608, 2463
http://tests.stockfishchess.org/tests/view/5e6448ffe42a5c3b3ca2e287

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 35640 W: 4679 L: 4621 D: 26340
Ptnml(0-2): 189, 2991, 11424, 3005, 211
http://tests.stockfishchess.org/tests/view/5e650b24e42a5c3b3ca2e2d8

closes official-stockfish#2577

Bench: 5527957

* Remove set statScore to zero

Simplification. Removes setting statScore to zero if negative.

STC:
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 84820 W: 16100 L: 16033 D: 52687
Ptnml(0-2): 1442, 9865, 19723, 9944, 1436
https://tests.stockfishchess.org/tests/view/5e654fdae42a5c3b3ca2e2f8

LTC:
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 57658 W: 7435 L: 7391 D: 42832
Ptnml(0-2): 441, 5397, 17104, 5451, 436
https://tests.stockfishchess.org/tests/view/5e657ce9e42a5c3b3ca2e307

closes official-stockfish#2578

Bench: 5168890

* simplify castling part of generate_all.

somewhat more compact, generates same code.

close official-stockfish#2580

No functional change.

* Simplify futility pruning parent node

only continuation histories seem needed for this purpose.

STC:
http://tests.stockfishchess.org/tests/view/5e6b88dfe42a5c3b3ca2e4ab
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 113356 W: 21725 L: 21696 D: 69935
Ptnml(0-2): 1999, 13255, 26163, 13240, 2021

LTC:
http://tests.stockfishchess.org/tests/view/5e6babbfe42a5c3b3ca2e4c2
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 22164 W: 2917 L: 2821 D: 16426
Ptnml(0-2): 173, 2040, 6548, 2160, 161

closes official-stockfish#2583

bench: 4839496

* Small cleanups

closes official-stockfish#2567

No functional change.

Co-authored-by: protonspring <mike@whiteley.org>
Co-authored-by: pb00067 <pb00067@PHXL0356.wp.lan>
Co-authored-by: Joost VandeVondele <Joost.VandeVondele@gmail.com>
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

4 participants