cjbolt / EubosChess

A Java chess engine. Uses UCI protocol. Playable on lichess.
GNU General Public License v3.0
14 stars 3 forks source link

Eubos v2.18 blunders unexpectedly #9

Open tissatussa opened 1 year ago

tissatussa commented 1 year ago

Some time ago i stumbled upon this position :

8/p5pp/1pk5/5p2/P1nn4/2NN3P/5PPK/8 w - - 0 1

4-knights-pos-white-move

White to move

Black is a pawn ahead and he can try to win .. White must not try to win the game and he can make a draw in many ways .. Black should keep 1 pawn alive and try to promote it, without a pawn Black cannot win, even with 2 knights ..

Btw. lately i also mentioned this in an Issue of another engine, regarding training of some NN : NN for the "4 Knights Position" ? See https://github.com/Disservin/Smallbrain/issues/320 , it gives you more information about this position.

Here's a game in CuteChess between 4KU (see https://github.com/kz04px/4ku ) with the White pieces and your Eubos v2.18 playing Black, using a not-so-fast 10m10s time control : it seems Black will win, but finally something weird happens, see the little video i created today. The animation is LiChess' replay mode "by CPL", reflecting the PGN clocktimes.

https://user-images.githubusercontent.com/1109281/215741570-79368cdd-6f80-4902-ac94-c31438667aa1.mp4

Maybe the cause of Eubos' last move was due to my memory setting, i use this command in CuteChess :

java -Xshare:off -XX:MaxInlineSize=40 -Djdk.attach.allowAttachSelf -Xmx4G -Xms4G -jar ./Eubos_v2.18_asset.jar

i don't remember where i got this command, i just made a copy of my v2.17 settings while adding the new v2.18 to my CuteChess .. it looks like the '4G' thing points to 4 Gb memory, which is way too big for my system - i have max 8 Gb RAM - so i guess i should adjust this .. and what about the other options ? Isn't just java -jar ./Eubos_v2.18_asset.jar good enough ?


[Event "engine vs engine"]
[Site "Holland @ https://lichess.org/Cob9RZcC "]
[Date "2023.01.31"]
[Round "?"]
[White "4ku v1.0"]
[Black "Eubos v2.18"]
[Result "1/2-1/2"]
[FEN "8/p5pp/1pk5/5p2/P1nn4/2NN3P/5PPK/8 w - - 0 1"]
[GameDuration "00:32:43"]
[PlyCount "97"]
[SetUp "1"]
[TimeControl "600+10"]

1. Kg3 {-1.66/28 28s} Kd6 {+1.45/11 14s} 2. Kf4 {-1.65/27 78s} a6 {+1.40/11 14s} 3. h4 {-1.14/25 22s} g6 {+1.39/11 14s} 4. Kg5 {-1.25/29 20s} Ne5 {+1.46/14 43s} 5. Nxe5 {-1.32/29 36s} Kxe5 {+1.49/13 13s} 6. Kh6 {-1.26/29 18s} b5 {+1.25/13 14s} 7. axb5 {-1.21/30 18s} axb5 {+1.21/15 14s} 8. Na2 {-1.70/30 68s} f4 {+1.88/14 14s} 9. Kxh7 {-1.29/27 20s} Nf5 {+1.70/15 14s} 10. g3 {-1.24/31 22s} fxg3 {+2.02/16 14s} 11. fxg3 {-1.30/35 33s} Kf6 {+2.20/17 14s} 12. g4 {-1.66/34 120s} Nxh4 {+1.84/18 14s} 13. Kh6 {-1.71/30 13s} Nf3 {+1.89/18 19s} 14. Nc3 {-1.79/30 8.5s} Nd4 {+1.89/17 14s} 15. Nd5+ {-1.71/31 9.3s} Kf7 {+0.93/16 35s} 16. Nb4 {-1.92/32 16s} Nf3 {+2.44/18 19s} 17. g5 {-1.37/26 9.4s} Ne5 {+2.76/18 14s} 18. Kh7 {-3.59/32 19s} Ke6 {+2.90/18 14s} 19. Nc2 {-3.67/32 12s} Kf5 {+2.67/18 14s} 20. Kh6 {-3.67/34 11s} Ng4+ {+4.69/17 15s} 21. Kg7 {-3.68/34 20s} Kxg5 {+4.62/17 15s} 22. Kf7 {-3.69/35 54s} Nh2 {+4.51/17 18s} 23. Ke6 {-3.69/29 6.5s} Kf4 {+4.99/17 15s} 24. Nd4 {-4.09/33 36s} b4 {+5.40/17 15s} 25. Kd5 {-4.09/32 33s} Nf3 {+5.43/16 15s} 26. Ne6+ {-4.10/32 10s} Kf5 {+5.06/16 34s} 27. Ng7+ {-4.99/33 12s} Kf6 {+6.30/16 23s} 28. Ne8+ {-4.99/32 18s} Ke7 {15s} 29. Nd6 {-5.78/33 22s} Nd2 {+6.18/16 15s} 30. Nc8+ {-5.79/32 13s} Kd8 {+6.22/16 15s} 31. Nb6 {-5.48/29 6.1s} Kc7 {+5.62/16 16s} 32. Na4 {-5.84/30 6.0s} g5 {+5.96/17 16s} 33. Kd4 {-6.18/30 5.2s} g4 {+5.96/15 16s} 34. Nc5 {-8.19/32 40s} g3 {+6.82/15 26s} 35. Ne6+ {-8.71/30 8.6s} Kc6 {+8.72/16 50s} 36. Ke3 {-8.64/25 3.4s} g2 {+8.55/14 22s} 37. Nd4+ {-8.99/28 4.3s} Kd5 {+12.64/15 32s} 38. Ne2 {-8.87/30 5.0s} Nf3 {+12.79/16 15s} 39. Nf4+ {-9.03/30 9.5s} Kc4 {+13.09/16 15s} 40. Nxg2 {-9.43/32 10s} b3 {+13.19/16 16s} 41. Kxf3 {-9.83/33 37s} b2 {+13.24/15 16s} 42. Kf4 {-10.23/32 28s} b1=Q {+13.25/14 16s} 43. Ne3+ {-11.36/31 22s} Kd3 {+13.35/13 17s} 44. Nf5 {-12.51/28 18s} Qb2 {+13.60/14 17s} 45. Ng3 {-12.91/23 15s} Qf2+ {+18.14/14 65s} 46. Kg4 {-12.91/21 5.0s} Kd4 {+M19/14 49s} 47. Nh5 {-21.31/24 8.8s} Kd5 48. Ng3 {-30.11/31 6.4s} Qf1 49. Nxf1 {+3.59/28 2.4s, Draw by insufficient mating material} 1/2-1/2
cjbolt commented 1 year ago

Thanks for the information about this position. I might add it to my test suites.

Unfortunately Eubos is not very sophisticated. Although it recognises draws by insufficient material, it isn't very sophisticated about keeping pawns for the possibility of promotion. It also doesn't have any behaviour hard-coded about trying to keep complexity in the position when trying to draw. I attempted to implement that at one stage in the past and found it a negative impact.

I expect what is happening here is, in an attempt to move to good squares and activate pawns, it creates longer term weaknesses outside the horizon of the search.

I'm an amateur, not a specialist, so there are only fairly simple, generic evaluation functions (though the king safety and mobility evaluation is all my own work). I'm also a weak chess player - so I can't claim to have more insight than my engine.

I let Eubos search for 5mins or so and I can see from the continuation it comes up with that it doesn't understand what is needed to try and draw.

FEN: 8/p5pp/1pk5/5p2/P1nn4/2NN3P/5PPK/8 w - - 0 1 Eubos Dev Version: 8/17 00:01 567k 504k -1.36 h4 a5 h5 Kd6 9/19 00:01 1,286k 835k -1.39 h4 a5 h5 b5 axb5+ Nxb5 Na4 h6 Kg1 Nd4 10/21 00:03 3,762k 1,543k -1.37 h4 a5 h5 b5 axb5+ Nxb5 Na4 Nb6 Ne5+ Kd6 Nf7+ Ke7 Nxb6 Kxf7 11/23 00:06 11,961k 1,912k -1.38 h4 h6 Kg1 Kd6 h5 Ne5 Nf4 a6 f3 b5 axb5 axb5 12/24 00:13 28,335k 2,147k -1.43 h4 h6 Kg1 a5 h5 b5 axb5+ Nxb5 Na4 Nb6 Nac5 a4 g3 13/25 00:34 81,411k 2,361k -1.45 h4 h6 h5 Kd6 f3 Ne3 Kh3 Nd5 Nxd5 Kxd5 Nf4+ Kc4 Kg3 b5 axb5 Kxb5 14/28 03:01 455,268k 2,510k -1.47 h4 a5 h5 g5 Kg3 h6 f3 f4+ Kh2 Ne6

Thanks for the info on the position, I'll think about it.

tissatussa commented 1 year ago

Nice info again. I'm a fairly good (club) chess player myself, rating about 1830, and i have a lot of experience. The position once arose in some other CuteChess game between engines, it fascinated me and i did many games with this starting position, just to see how engines play. The position has many aspects, and you're right about "..outside the horizon of the search.." - i hope it can help you !