Does YOUR Engine Play This Exchange Sac?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

BrendanJNorman
Posts: 2593
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Does YOUR Engine Play This Exchange Sac?

Post by BrendanJNorman »

So yesterday I played against a buddy of mine in Russia on chess.com and after losing the first game on time (I really suck at playing fast on the phone app), I played really aggressively and won the second game quickly...

One of the key ideas was this idea 19...Rd4!? I came up with.

[fen]3rk2r/1pq1bpp1/p3bn2/2p1p3/N3P2p/3BBP2/PPP2QPP/2RR2K1 b k - 0 19[/fen]

Black gets a serious initiative and precise defense is required (especially for humans).

My question is: Does YOUR engine play it?

This is a nice test of how "human" your engine is, even though the alternative 19...c4 is also strong.

For those interested, here is the full game.

[pgn][Event "Live Chess"]
[Site "Chess.com"]
[Date "2022.01.19"]
[Round "?"]
[White "Barefoot_Chess_King"]
[Black "BrendanJNorman"]
[Result "0-1"]
[ECO "B90"]
[WhiteElo "2325"]
[BlackElo "2259"]
[PlyCount "50"]
[EventDate "2022.??.??"]
[TimeControl "180"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be7 8. f3
Be6 9. Qd2 h5 10. Be2 Nbd7 11. O-O Rc8 12. Rfd1 Qc7 13. Rac1 Nb6 14. Na5 h4 15.
Bd3 Nbd7 16. Nb3 Nc5 17. Qf2 Rd8 18. Nxc5 dxc5 19. Na4 Rd4 20. Bxd4 exd4 21. b3
Bd6 22. h3 Bg3 23. Qe2 Bf4 24. Rb1 Be3+ 25. Kf1 Nh5 0-1

[/pgn]

P.S. This was a 3+0 game played on phone app, so the quality is far from perfect. :D
peter
Posts: 3550
Joined: Sat Feb 16, 2008 7:38 am
Full name: Peter Martan

Re: Does YOUR Engine Play This Exchange Sac?

Post by peter »

BrendanJNorman wrote: Thu Jan 20, 2022 6:06 am [pgn][Event "Live Chess"]
[Site "Chess.com"]
[Date "2022.01.19"]
[Round "?"]
[White "Barefoot_Chess_King"]
[Black "BrendanJNorman"]
[Result "0-1"]
[ECO "B90"]
[WhiteElo "2325"]
[BlackElo "2259"]
[PlyCount "50"]
[EventDate "2022.??.??"]
[TimeControl "180"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be7 8. f3
Be6 9. Qd2 h5 10. Be2 Nbd7 11. O-O Rc8 12. Rfd1 Qc7 13. Rac1 Nb6 14. Na5 h4 15.
Bd3 Nbd7 16. Nb3 Nc5 17. Qf2 Rd8 18. Nxc5 dxc5 19. Na4 Rd4 20. Bxd4 exd4 21. b3
Bd6 22. h3 Bg3 23. Qe2 Bf4 24. Rb1 Be3+ 25. Kf1 Nh5 0-1

[/pgn]
SF, Crystal and LC0 prefer 19...Rd4 too at short ponder- time, didn't try very long, seems to be best move anyhow, even if (as you say too) ...c4 isn't really worse, cause ..Rd4 might not be a game changer neither, if Black doesn't blunder like here with 21.b3?
21.c3 instead might have kept things rather equal still, I guess.
Thanks for sharing.
Peter.
User avatar
AdminX
Posts: 6384
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: Does YOUR Engine Play This Exchange Sac?

Post by AdminX »

Most engines I looked at prefer c4, however Dragon, Normal and MCTS both like Rd4. Normal Dragon spots it faster.

Image

No way I would ever do online chess via my phone! The Bigger the screen the better. I did not even like online via my Tablet. Now Ebooks and Database lookups are okay for those.
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
BrendanJNorman
Posts: 2593
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: Does YOUR Engine Play This Exchange Sac?

Post by BrendanJNorman »

peter wrote: Thu Jan 20, 2022 8:52 am
BrendanJNorman wrote: Thu Jan 20, 2022 6:06 am [pgn][Event "Live Chess"]
[Site "Chess.com"]
[Date "2022.01.19"]
[Round "?"]
[White "Barefoot_Chess_King"]
[Black "BrendanJNorman"]
[Result "0-1"]
[ECO "B90"]
[WhiteElo "2325"]
[BlackElo "2259"]
[PlyCount "50"]
[EventDate "2022.??.??"]
[TimeControl "180"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 a6 6. Be3 e5 7. Nb3 Be7 8. f3
Be6 9. Qd2 h5 10. Be2 Nbd7 11. O-O Rc8 12. Rfd1 Qc7 13. Rac1 Nb6 14. Na5 h4 15.
Bd3 Nbd7 16. Nb3 Nc5 17. Qf2 Rd8 18. Nxc5 dxc5 19. Na4 Rd4 20. Bxd4 exd4 21. b3
Bd6 22. h3 Bg3 23. Qe2 Bf4 24. Rb1 Be3+ 25. Kf1 Nh5 0-1

[/pgn]
SF, Crystal and LC0 prefer 19...Rd4 too at short ponder- time, didn't try very long, seems to be best move anyhow, even if (as you say too) ...c4 isn't really worse, cause ..Rd4 might not be a game changer neither, if Black doesn't blunder like here with 21.b3?
21.c3 instead might have kept things rather equal still, I guess.
Thanks for sharing.
Hi Peter, yes 21.c3! is the type of move that only a computer would see...especially in blitz.

In this position...

Image

...black threatens ....b5 trapping the knight on a4, and to even a strong human (my opponent is 2330 Elo), the only way to avoid this is with 21.b3 (giving the knight the b2 square).

What Stockfish/Lc0 proposes with 21.c3 is a POSITIONAL piece sacrifice - allowing 21...b5 with the idea of 22.Nxc5 Qxc5 23.cxd4 where white's big center gives compensation for the material.

I would hardly call missing this a "blunder" just because Stockfish eval jumps sharply. The game would have been very interesting if he'd been inspired and found the 21.c3 idea though!

I wonder if that's a good test position/exit position for engine matches to test? :?:
BrendanJNorman
Posts: 2593
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: Does YOUR Engine Play This Exchange Sac?

Post by BrendanJNorman »

AdminX wrote: Thu Jan 20, 2022 9:00 am Most engines I looked at prefer c4, however Dragon, Normal and MCTS both like Rd4. Normal Dragon spots it faster.

Image

No way I would ever do online chess via my phone! The Bigger the screen the better. I did not even like online via my Tablet. Now Ebooks and Database lookups are okay for those.
Hmmm seems so. Interesting to test this with older engines, and only to see that seemingly none of them (except Deep Saros Human) wants to play ...Rd4. Engines have come a long way.

As for playing online, yes!, my play drops by probably 100 Elo when I don't have a big screen and a mouse handy. :lol:

BTW...what is that GUI? A themed-up Shredder Classic? Looks nice!
User avatar
AdminX
Posts: 6384
Joined: Mon Mar 13, 2006 2:34 pm
Location: Acworth, GA

Re: Does YOUR Engine Play This Exchange Sac?

Post by AdminX »

BrendanJNorman wrote: Thu Jan 20, 2022 11:19 am BTW...what is that GUI? A themed-up Shredder Classic? Looks nice!
Yes it is Shredder;

Image

Dark Mode Settings

Goto Windows Menu > Design > Colors

Text and Moves R: 228 G: 243 B: 243
Text Background R: 117 G: 117 B: 117
Windows Background R:89 G: 89 B:89
Engine Information R: 58 G: 116 B: 116
Engine Name R: 255 G: 255 B: 255
Engine Name Background R: 0 G: 193 B: 49

First Variation R: 187 G: 255 B: 187
Further Variations R: 245 G: 245 B: 245
Current Move R: 255 G: 255 B: 121
Comments R: 255 G: 255 B: 255
Permanent Brain Info R: 215 G: 215 B: 236

Classic Light 2D Squares R: 208 G: 224 B: 208
Classic Dark 2D Squares R: 128 G: 160 B: 160
"Good decisions come from experience, and experience comes from bad decisions."
__________________________________________________________________
Ted Summers
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Does YOUR Engine Play This Exchange Sac?

Post by algerbrex »

The dev version of Blunder eventually finds c4 and sticks with it:

Code: Select all

position fen 3rk2r/1pq1bpp1/p3bn2/2p1p3/N3P2p/3BBP2/PPP2QPP/2RR2K1 b k - 0 19
go
info depth 1 score cp 68 nodes 253 nps 477358 time 0 pv c5c4
info depth 2 score cp 51 nodes 470 nps 892518 time 0 pv h4h3 a4c5 e7c5 e3c5 h3g2 g1g2
info depth 3 score cp 51 nodes 1510 nps 958608 time 1 pv h4h3 a4c5 e7c5 e3c5 h3g2 g1g2
info depth 4 score cp 51 nodes 1972 nps 939047 time 3 pv h4h3 a4c5 e7c5 e3c5 h3g2 g1g2
info depth 5 score cp 40 nodes 8192 nps 976319 time 11 pv h4h3 e3c5 h3g2 c5b6 c7c6 b6d8 e7d8
info depth 6 score cp 27 nodes 19712 nps 952726 time 31 pv h4h3 d3e2 h3g2 a4c5 e7c5 e3c5
info depth 7 score cp 0 nodes 17775 nps 1116414 time 46 pv h4h3 a4c5 e6a2 d3e2 h3g2 d1d8 c7d8 f2g2
info depth 8 score cp 17 nodes 83849 nps 952657 time 134 pv f6d7 a4c3 d7b6 d3e2 e8g8 h2h3 f8e8 a2a3
info depth 9 score cp 14 nodes 52687 nps 1043707 time 184 pv f6d7 a4c3 d7b6 d3e2 e8g8 h2h3 f8e8 a2a3 b6c4
info depth 10 score cp -7 nodes 242025 nps 1037971 time 417 pv d8c8 c2c4 h4h3 a4c3 h3g2 f2g2 g7g6 c3d5 f6d5 c4d5
info depth 11 score cp -7 nodes 105852 nps 1064722 time 516 pv d8c8 c2c4 h4h3 a4c3 h3g2 f2g2 e8g8 c3d5 f6d5 c4d5 e6d7
info depth 12 score cp -14 nodes 248127 nps 1108686 time 739 pv d8c8 c2c4 h4h3 a4c3 c7b6 c3d5 f6d5 c4d5 e6d7 d3f1 h3g2 f1g2
info depth 13 score cp -9 nodes 264214 nps 1080169 time 983 pv d8c8 c2c4 h4h3 a4c3 h3g2 f2g2 g7g6 c3d5 f6d5 c4d5 e6d7 g2g3 c8d8
info depth 14 score cp -18 nodes 647570 nps 1110370 time 1566 pv d8c8 c2c4 h4h3 a4c3 h3g2 f2g2 g7g6 c3d5 f6d5 c4d5 e6d7 g2g3 c8d8 d3e2
info depth 15 score cp -17 nodes 568135 nps 1087765 time 2088 pv d8c8 c2c4 h4h3 a4c3 h3g2 f2g2 e6d7 c3d5 f6d5 c4d5 e8g8 b2b4 d7a4 d1e1 c7b6
info depth 16 score cp -21 nodes 8471280 nps 1107498 time 9737 pv d8c8 c2c4 h4h3 g2g3 e8g8 a4c3 c7a5 c3d5 f6d5 c4d5 e6d7
info depth 17 score cp -5 nodes 8086639 nps 1143428 time 16809 pv c5c4 d3f1 h4h3 g2h3 e8g8 e3b6 d8d1 c1d1 c7c6 a4c3 e7b4 f1g2 c6c8 f2e3 e6h3 c3d5 f6d5 e4d5
info depth 18 score cp -5 nodes 6582945 nps 1112480 time 22726 pv c5c4 d3f1 h4h3 g2h3 e8g8 e3b6 d8d1 c1d1 c7c6 a4c3 e7b4 f1g2 c6c8 f2e3 e6h3 c3d5 f6d5 e4d5
info depth 19 score cp -5 nodes 9484513 nps 1109414 time 31275 pv c5c4 d3f1 h4h3 g2h3 e8g8 e3b6 d8d1 c1d1 c7c6 a4c3 e7b4 f1g2 c6c8 h3h4 c8c6 a2a3 b4c3 b2c3 f8e8
info depth 20 score cp -1 nodes 22391538 nps 1167409 time 50455 pv c5c4 d3f1 d8d1 c1d1 e8g8 e3b6 c7c6 a4c3 f8e8 b6e3 h4h3 g2h3 e8d8
info depth 21 score cp -2 nodes 44271321 nps 1162223 time 88546 pv c5c4 d3f1 d8d1 c1d1 e8g8 a4c3 h4h3 g2h3 c7c8 h3h4 f8e8 e3b6 c8c6 f1g2 e7b4 a2a3 b4c3 b2c3 f6d7 b6e3 d7f6
User avatar
lithander
Posts: 925
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Does YOUR Engine Play This Exchange Sac?

Post by lithander »

algerbrex wrote: Thu Jan 20, 2022 12:20 pm The dev version of Blunder eventually finds c4 and sticks with it:
MinimalChess too switches to c5c4 at depth 14 and never reconsiders. Maybe engines with a mostly PST based evaluation don't like giving away material (Rook for a Bishop) with no immediate compensation because all the tactical/strategical benefits are not easy to encode in such simplistic evaluations.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Does YOUR Engine Play This Exchange Sac?

Post by algerbrex »

lithander wrote: Thu Jan 20, 2022 12:52 pm
algerbrex wrote: Thu Jan 20, 2022 12:20 pm The dev version of Blunder eventually finds c4 and sticks with it:
MinimalChess too switches to c5c4 at depth 14 and never reconsiders. Maybe engines with a mostly PST based evaluation don't like giving away material (Rook for a Bishop) with no immediate compensation because all the tactical/strategical benefits are not easy to encode in such simplistic evaluations.
Yep, that makes sense.

I've done a good bit of work to put some other positional ideas into Blunder's evaluation, and it shows, as last time I tested all of the evaluation terms added (mobility, king safety, pawn structure, piece activity, etc.) gained Blunder around 160-170 Elo.

But even with that, it's still not easy to make a PST-based engine see the sac, as you said. Blunder's gotten better at being able to do this since I've added these terms, but not perfect. Still, it's now much more willing to sac a pawn or two to crack open the enemy king's safety or trade a rook for a knight if it can see the enemy king's safety breaking down on the horizon.

But more subtle sacs and trades like Rc4 just aren't easy for an engine to make sense of at first sight.
User avatar
algerbrex
Posts: 608
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: Does YOUR Engine Play This Exchange Sac?

Post by algerbrex »

I was curious to see how Blunder would manage the position for white and black after Rc4. It eventually drew itself (tc=40/2 min):

[pgn]
[Event "?"]
[Site "?"]
[Date "2022.01.20"]
[Round "?"]
[White "Blunder dev"]
[Black "Blunder dev"]
[Result "1/2-1/2"]
[FEN "4k2r/1pq1bpp1/p3bn2/2p1p3/N2rP2p/3BBP2/PPP2QPP/2RR2K1 w k - 1 1"]
[GameDuration "00:07:36"]
[GameEndTime "2022-01-20T06:11:12.340 Central Standard Time"]
[GameStartTime "2022-01-20T06:03:35.750 Central Standard Time"]
[PlyCount "52"]
[SetUp "1"]
[TimeControl "40/300"]

1. Bxd4 {+0.35/18 9.8s} exd4 {-0.39/17 7.5s} 2. c3 {+0.30/17 9.7s}
Bd7 {-0.44/17 7.5s} 3. b3 {+0.34/16 7.4s} b5 {-0.40/17 7.5s}
4. cxd4 {+0.65/15 9.6s} bxa4 {-0.48/17 7.5s} 5. b4 {+0.62/17 9.5s}
h3 {-0.63/16 9.8s} 6. bxc5 {+0.71/16 7.3s} hxg2 {-0.62/17 9.7s}
7. Qg3 {+0.50/17 7.3s} Qa7 {-0.52/16 16s} 8. Bc4 {+0.53/16 7.3s}
Nh5 {-0.49/17 12s} 9. Qe5 {+0.47/17 9.4s} f6 {-0.35/18 12s}
10. Qd5 {+0.26/17 12s} Qc7 {-0.35/16 8.8s} 11. Qf7+ {+0.26/15 15s}
Kd8 {-0.25/14 8.7s} 12. Rb1 {-0.25/16 15s} g5 {-0.25/16 11s}
13. Bxa6 {-0.25/15 11s} Nf4 {+0.02/16 23s} 14. Rb7 {-0.25/16 11s}
Ne2+ {-0.25/16 13s} 15. Kf2 {-0.25/16 6.1s} Qxh2 {-0.25/16 5.6s}
16. Rxd7+ {-0.25/15 13s} Kxd7 {-0.25/15 5.6s} 17. c6+ {-0.25/15 9.8s}
Kd8 {-0.25/14 5.6s} 18. c7+ {-0.25/14 12s} Qxc7 {-0.25/14 5.6s}
19. Bxe2 {-0.25/16 12s} Qh2 {-0.25/16 9.5s} 20. Rg1 {-0.25/17 6.5s}
g4 {-0.25/17 9.2s} 21. Rxg2 {-0.25/16 6.4s} g3+ {-0.25/18 5.2s}
22. Kf1 {-0.25/18 4.9s} Qh1+ {-0.25/19 5.2s} 23. Rg1 {-0.25/19 4.9s}
Qh3+ {-0.25/19 6.8s} 24. Rg2 {-0.25/18 4.9s} Qh1+ {-0.25/19 5.2s}
25. Rg1 {-0.25/100 0.002s} Qh3+ {-0.25/19 6.7s} 26. Rg2 {-0.25/25 5.2s}
Qh1+ {-0.25/19 5.1s, Draw by 3-fold repetition} 1/2-1/2
[/pgn]