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

Updated KNNKP endgame. #2553

Closed

Conversation

protonspring
Copy link

@protonspring protonspring commented Feb 18, 2020

This is a patch that significantly improves KNNKP endgames. My testing suggests this is better than master by 3:1 (in these specific endings).

Theory: KNNK is a dead draw, however the presence of the additional weakSide pawn opens up some mate opportunities. The idea is to block the pawn (preferably behind the Troitsky line) with one of the knights and press the weakSide king into a corner. If we can stalemate the king, we release the pawn with the knight (to avoid actual stalemate), and use the knight to complete the mate before the pawn promotes. This is also why there is an additional penalty for advancement of the pawn.

Please help verify: You can download my KNNvKPFens.epd and use it as an opening book in cutechess. https://drive.google.com/drive/folders/1AoGr2bt1xPSYYENCp-bdqfXMCKLc8gBy

Set book depth to 1, repeat on, random order, disable resigning and draws.

This patch does not regress against master in normal games:

STC
LLR: 2.94 (-2.94,2.94) {-1.50,0.50}
Total: 96616 W: 18459 L: 18424 D: 59733
Ptnml(0-2): 1409, 10812, 23802, 10905, 1380
http://tests.stockfishchess.org/tests/view/5e49dfe6f8d1d52b40cd31bc

LTC
LLR: 2.95 (-2.94,2.94) {-1.50,0.50}
Total: 49726 W: 6340 L: 6304 D: 37082
Ptnml(0-2): 239, 4227, 15906, 4241, 250
http://tests.stockfishchess.org/tests/view/5e4ab9ee16fb3df8c4cc01d0

Bench 4981770

Bench 4981770
@protonspring protonspring mentioned this pull request Feb 18, 2020
8 tasks
@protonspring
Copy link
Author

protonspring commented Feb 18, 2020

Comments in Issue #2288

KNNKP
There is no check whatsoever on the pawn/king combined positions, which means that without TB, SF frequently has extremely inflated evals.

Example position : 8/3k4/8/3N4/8/6K1/1p6/1N6 b - - 4 6

+7 for the side with the knights (!) with seldepth 100 (it stops at the 50mr barrier)

@erbsenzaehler
Copy link

I did quick test run of your patch against master with tc=5+0.05, resign off and your openings. Result is in agreement with your finding:

Score of 2553 vs master: 132 - 38 - 830 [0.547] 1000
Elo difference: 32.8 +/- 8.7, LOS: 100.0 %, DrawRatio: 83.0 %
Finished match

Can upload the games if required

@vondele
Copy link
Member

vondele commented Feb 18, 2020

similar here :

Score of master vs ps: 316 - 841 - 4863  [0.456] 6020
Elo difference: -30.4 +/- 3.8, LOS: 0.0 %, DrawRatio: 80.8 %

@joergoster
Copy link
Contributor

Just as a side note: I tried to classify this endgame as type ScaleFactor, yet Lazy Eval prevents the reduced scaling factor to kick in!

Now I wonder if this happens with other scaling functions, too ...

@adentong
Copy link

So shall we merge this since the gains are real?

@vondele
Copy link
Member

vondele commented Feb 19, 2020

I wonder if one can show that it not only plays the endgame well (this is clear now), but also if it decides at the right point to simplify into that. E.g. If we have KNNPPPvKNP will it simplify into KNNvKP, or should it go into a different endgame (KNPPPvKP). (or better examples).

@protonspring
Copy link
Author

@joergoster I tested all of the ScaleFactor endings. Currently, all of them are being used.

@MichaelB7
Copy link
Contributor

Something similar was suggested in the past.

Add KNNvKP Endgame Heuristic. #1939

Might be worth to take a look at it,

@vondele vondele closed this in ab930f8 Feb 20, 2020
@vondele
Copy link
Member

vondele commented Feb 20, 2020

Thanks!

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

6 participants