When will the chess programmers write an engine that plans ?

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

Moderator: Ras

jefk
Posts: 1025
Joined: Sun Jul 25, 2010 10:07 pm
Location: the Netherlands
Full name: Jef Kaan

Re: When will the chess programmers write an engine that plans ?

Post by jefk »

With 'Father' and 'Tsvetkov' being silent, its
time again for some human input imho:

Talking about computer plans and 'strategy' :
What engines do *not* have is the subtle strategy of a human;
knowing about the possible fallacies and weaknesses
of his opponent....

Watch here (in horror) the subtle strategy below ; where White (yours truly)
applies a trick against another human, almost equal in (tactical)
strength, but not aware of opening traps, two examples"
(with Black playing the sometimes thought to be most solid,
strategic defence (Caro-Kann) possible against White...
(lol)
[Site "Chess.com"]
[Date "2020.09.30"]
[White "jefk"]
[Black "Dxxxhxxd"]
[Result "1-0"]
[TimeControl "900+10"]
[EndTime "7:04:12 PDT"]
[Termination "jefk won by checkmate"]
1. e4 1... c6 2. Nc3 {[%clk 0:15:10]}
2... d5 {[%clk 0:15:10]} 3. Nf3 {[%clk 0:15:20]} 3... dxe4 {[%clk 0:15:20]} 4.
Nxe4 {[%clk 0:15:30]} 4... Bg4 {[%clk 0:15:30]} 5. h3 {[%clk 0:15:40]} 5... Bh5
{[%clk 0:15:40]} 6. Qe2 {[%clk 0:15:50]} 6... Nd7 {[%clk 0:15:50]} 7. Nd6#
{[%clk 0:16:00]} 1-0
:)

Example 2:
[Site "Chess.com"]
[Date "2020.08.24"]
[White "jefk"]
[Black "jaxxrxk"]
[Result "1-0"]
[ECO "B10"]
[WhiteElo]
[BlackElo "1466"]
[TimeControl "900+10"]
[Termination "jefk won by checkmate"]
1. e4 1... c6 2. Nc3 {[%clk 0:15:10]} 2... d5 {[%clk 0:15:10]}
3. Nf3 {[%clk 0:15:20]} 3... dxe4 {[%clk 0:15:20]} 4.
Nxe4 {[%clk 0:15:30]} 4... Bf5 {[%clk 0:15:30]} 5. Qe2 {[%clk 0:15:40]} 5... Nd7
{[%clk 0:15:40]} 6. Nd6# {[%clk 0:15:50]} 1-0

lol
:)
yes i know, i set a trap, with a suboptimal move (Qe2)
hoping that the opponent will make (fatal) mistake;
in other words 'speculative' play. Neither Lco nor NNue
are doing that; you only can do that with 'high contempt'
(and chess knowledge).

Now you say, you cannot do this against computer programs ???
Yes we can ! Here's an example, accomplished against an engine
on Fics (no NNUE, simple alfa beta), rapid rating 2000+ plays
like a toddler:

[Event "Computer chess game"]
[Site "freechess.org"]
[Date "2020.10.03"]
[White "jefk"]
[Black "SpeckEngine"]
[Result "1-0"]
[ECO "C28"]
[Opening "Vienna"]
[Time "19:03:16"]
[Variation "3.Bc4 Nc6 4.f4"]
[TimeControl "840+1"]
[PlyCount "49"]
[WhiteType "human"]
[BlackType "program"]
[Comment "SpeckEngine checkmated 1-0"]
1. e4 e5 2. Nc3 Nf6 3. Bc4 Nc6 4. f4 exf4 5. Nf3 Na5 6. Be2 Nc6 7. d4 Bb4
8. e5 Nd5 9. Bd2 Ne3 10. Bxe3 fxe3 11. d5 Ne7 12. Qd3 O-O 13. h4 Bxc3+ 14.
bxc3 d6 15. c4 Nf5 16. Ng5 h6 17. g4 hxg5 18. gxf5 gxh4 19. O-O-O dxe5 20.
Rdf1 Bd7 21. f6 h3 22. Rhg1 g6 23. Rxg6+ Kh7 24. Rg7+ Kh8 25. Qh7# 1-0

Well that was simple, wasn't it (don't tell me i played lousy; i know
but that was not the point, i'ts the last point that counts...)
:)
As for 'simple' ? well actually not, i just played with intuition
(see PS below). Bottom line, for humans know the playing style of your
opponent, try to exploit weaknesses, and know that chess is a game
(where the opponent can make 'strategic' mistakes); you don't have to
play perfectly dull positional chess (often ending in a draw with strong
opponents) to make a fun game out of it; possibly true at higher levels
as well (Lco and Nnue are still machines, they don't have creativity).

How to build in 'creativity' (exploiting possible mistakes of
the opponent (like eg Carlsen is doing in the endgame even
at GM level) for comps ? It requires another sort of contempt
and some knowledge about the sort of opponent (rating (once
crafty had a feature to know things about the opponent on ICC,
eg human/comp, not sure about rating), playing style, etc).
Will it add rating points ? mwah only for the best (lco of SF,
with such an extra feature); will it solve chess ?
Definitely not (it's a draw!); will it add some more fun
to the game(s)? Yes it will, imho.

best regards

jef


PS simple? well only because looked beyond the horizon (Nnue and lco ofcourse
would be more difficult), and i have some recent experience with the Vienna:
see eg this one :

[Site "Chess.com"]
[Date "2020.09.30"]
[White "jefk"]
[Black "Vexxkoxxj"]
[Result "1-0"]
[ECO "C25"]
[TimeControl "900+10"]
[EndTime "6:35:28 PDT"]
[Termination "jefk won by checkmate"]
1. e4 1... e5 2. Nc3 {[%clk 0:15:10]} 2... Bc5 {[%clk 0:15:10]} 3. Bc4 {[%clk 0:15:20]} 3... h6 {[%clk 0:15:20]} 4. f4 {[%clk 0:15:30]} 4... Nc6 {[%clk 0:15:30]} 5. Nf3 {[%clk 0:15:40]} 5... exf4
{[%clk 0:15:40]} 6. d4 {[%clk 0:15:50]} 6... Bb6 {[%clk 0:15:50]} 7. Bxf4 {[%clk
0:16:00]} 7... d6 {[%clk 0:16:00]} 8. Qd2 {[%clk 0:16:10]} 8... Nf6 {[%clk
0:16:10]} 9. h3 {[%clk 0:16:20]} 9... O-O {[%clk 0:16:20]} 10. O-O-O {[%clk
0:16:30]} 10... Ba5 {[%clk 0:16:30]} 11. Bxh6 {[%clk 0:16:40]} 11... gxh6 {[%clk
0:16:40]} 12. Qxh6 {[%clk 0:16:50]} 12... Nh7 {[%clk 0:16:50]} 13. Nd5 {[%clk
0:17:00]} 13... Be6 {[%clk 0:17:00]} 14. Bd3 {[%clk 0:17:10]} 14... Bxd5 {[%clk
0:17:10]} 15. exd5 {[%clk 0:17:20]} 15... Nb4 {[%clk 0:17:20]} 16. Qxh7# {[%clk
0:17:30]} 1-0

PS2 chessdb.cn now only displaying xianchi apparently ?
ah well. it getting a bit boring nowadays in corresp chess..
jefk
Posts: 1025
Joined: Sun Jul 25, 2010 10:07 pm
Location: the Netherlands
Full name: Jef Kaan

Re: When will the chess programmers write an engine that plans ?

Post by jefk »

analyzed my (recent) Vienna game against 'speckengine' with komodo ,
and indeed, it was not perfect; Komodo gives a ? for my move 15 c4
But Speckengine plays Pf5 instead of dxe5 !
And later makes the mistake 20...Ld7??
(20...Qf6 was better, but even then White
ie yours truly was already strategically winning)
Did i see all that ?
nope not in such detail. LIke i said, intuition.
Now i don't have the chess abilities of Lco and SFNnue i admit
but they don't have 'intuitive' capabilities (knowing about
your opponent, tricks, traps, opening strategies, etc) and
there's still imho some room for improvement.
Top of 4000 lo ? mwah dunno, 3800 maybe. we'll see.
In general there's still are hybrid (human/comp) improvement
possible in the game of chess, once known to be the 'fruitfly' of AI.
With nowadays the hype of coming socalled AGI (and (much) later ASI
it's still interesting to see how this field is doing in this relatively
simple (but in fact not so simple) game of 'chess''...
;-)
jef
PS my whole change in playing style (with the Vienna examples
was a result of the Lco revolution; i already have a solid 1.d4
repertoire, but against weaker players (or weak comps like
this speckengine), i sometimes try 1.e4 (and then deviating
from known theory, or at least comp opening books)
if i'm in a strong/confident mood... yeah i know Capablanca
advised to kiddies to get strong in the endgame but i never
bothered coz i like it in amateur chess when i win within 20 moves
or so which deserves me another beer at least...
:)
User avatar
Ovyron
Posts: 4562
Joined: Tue Jul 03, 2007 4:30 am

Re: When will the chess programmers write an engine that plans ?pp

Post by Ovyron »

BrendanJNorman wrote: Mon Mar 23, 2020 8:42 am If you knew how to beat 2300 players, you wouldn't be 1500. Period.
Whew! Finally made it to a +1900 rating in blitz at lichess, so I can show the account now...

https://lichess.org/@/Yntec

And after reading the discussion again, it turns out you were right about not being able to improve as fast... oh well!
Your beliefs create your reality, so be careful what you wish for.
User avatar
towforce
Posts: 12506
Joined: Thu Mar 09, 2006 12:57 am
Location: Birmingham UK
Full name: Graham Laight

Re: When will the chess programmers write an engine that plans ?

Post by towforce »

mclane wrote: Fri Mar 20, 2020 11:22 pm I mean that creates a plan and develops a main line that leads to something.
Not the usual engines we have today. That play chess within a Horizont of search depth.

The above was asked in March 2020 - more than 2 years before ChatGPT 3.5 took the world by storm and changed our perception of AI in November 2022. Now they CAN make plans!

There's an article about planning at link. Here's then FEN for the first position in that article:

2r5/4q1k1/bp2prpn/p1pp3p/3P1Q1P/2P1NNP1/PP3P2/3RR1K1 w - - 0 25

Both Gemini and ChatGPT offered me a nice overview of the position and a good attempt at making a plan - but neither recommended the move offered in the article.

ChatGPT's Overview And Plan

In the given position:

Code: Select all

```
8   2 r . . . . . .   
7   . . . . q . k .   
6   b p . . r p r p n   
5   p . p p . . . p   
4   . . . P . Q 1 P   
3   . . P 1 N N P 1   
2   P P . . 1 P . 2   
1   . . 3 r 1 K 1   

    a b c d e f g h 
```
### Material Imbalance and Key Observations:
- **Material**: Black has two rooks and a bishop, while White has two rooks and knights. Black is pressuring White with doubled rooks and pieces coordinated for a potential attack.
- **King Safety**: Black's king is somewhat exposed on g7, while White's king is relatively safe on g1.
- **Tactical Themes**: White's knights and queen are centralized and well-coordinated, with potential threats on Black's king.

### Plan for White:

1. **Leverage Activity**: White's queen and knights are well-positioned to initiate a direct attack on Black's king. Utilizing these pieces to create immediate threats is essential.

2. **Key Tactical Idea**:
- The queen and knight coordination creates a tactical opportunity against the Black king.
- White can immediately launch an attack by sacrificing material to exploit the open lines near Black's king.

### Immediate Move:
- **25. Nxd5!**
- Sacrificing the knight to break open the position and attack Black’s vulnerable king.
- This sacrifice forces Black to respond, and White's queen can penetrate to dangerous squares.

### Calculation After 25. Nxd5!:
- If **25... exd5**, White can play **26. Rxe7+**, leading to a deadly attack on Black's king:
- **26... Qxe7 27. Rxe7+ Kf8 28. Qxf6+** and Black is either getting mated or will lose significant material.

### Summary:
The key tactical plan for White revolves around the move **25. Nxd5!**, which sacrifices material to open lines and create devastating threats against Black’s king.


Gemini's Overview And Plan

Here's a plan for White in the given position:

**Overall Assessment**

White has a material advantage (an extra pawn) and a more active position. The open nature of the position and the presence of opposite-coloured bishops suggest that the game could become very tactical. White should try to increase the pressure on Black's king and look for opportunities to create threats.

**Concrete Plan**

1. **Centralize the King**: The White king is somewhat exposed on the kingside. The first priority should be to bring the king towards the centre where it's safer. A possible sequence could be Kf1-Ke2-Kd3.

2. **Activate the Rooks**: The rooks on d1 and e1 are not ideally placed. The plan should be to double the rooks on the d-file and use them to put pressure on the d5 pawn.

3. **Pressure the d5 pawn**: The d5 pawn is a weakness in Black's position. White should try to increase the pressure on this pawn with moves like Nc4 (with the idea of Nd6) and Qe5 (attacking f6 and putting pressure on the e6 square).

4. **Watch out for Black's counterplay**: Black's pieces are active and they have the potential to create counterplay. The most likely threats are:
* **...Ng4**: Black could try to sacrifice the knight on g4 to open the h-file and create threats to the White king.
* **...Rf3**: Black could try to exchange the rooks on the f-file and then bring their queen to the f-file to create threats.

**Illustrative line**

1. Kf1 Ke2
2. Kd3 Rcf8
3. Nc4 Qd7
4. Qe5 (increasing the pressure)

**Additional Considerations**

* **Opposite-coloured bishops**: With opposite-coloured bishops, the position could become very tactical with lots of potential sacrifices. It's important to calculate carefully and be aware of the potential for hidden threats.
* **Open files and diagonals**: The open nature of the position means that there are many lines of attack for both sides. It's important to be aware of the potential threats and to try to control the key files and diagonals.
* **Black's weaknesses**: Black has a few weaknesses in their position, such as the d5 pawn and the somewhat exposed king. White should try to exploit these weaknesses.

**Conclusion**

White has a good position and a clear plan to increase the pressure on Black. By centralizing the king, activating the rooks, and increasing the pressure on the d5 pawn, White should be able to create winning chances. However, it's important to be aware of Black's counterplay and to calculate carefully in this complex position.
Human chess is partly about tactics and strategy, but mostly about memory
BrendanJNorman
Posts: 2584
Joined: Mon Feb 08, 2016 12:43 am
Full name: Brendan J Norman

Re: When will the chess programmers write an engine that plans ?pp

Post by BrendanJNorman »

Ovyron wrote: Sun Aug 18, 2024 1:51 pm
BrendanJNorman wrote: Mon Mar 23, 2020 8:42 am If you knew how to beat 2300 players, you wouldn't be 1500. Period.
Whew! Finally made it to a +1900 rating in blitz at lichess, so I can show the account now...

https://lichess.org/@/Yntec

And after reading the discussion again, it turns out you were right about not being able to improve as fast... oh well!
Unbelievable that you'd respond to this after 4 years with a humble response.

Never had anything against you, but as a very serious chess player and coach I saw your claims as preposterous.

Still haven't forgotten your insight ten years ago when I was deeply into the Thinker/ProDeo engines.

Hope you're doing well after these years. 8-)