BoCC -- Beauty of Computer Chess

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

Moderator: Ras

User avatar
Rebel
Posts: 7323
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: BoCC -- Beauty of Computer Chess

Post by Rebel »

Image

New tool, extract from PGN (with or without comments) interesting king-attacks.

In the above example I used Million Base 3.45M, human games.

The output is controlled by the parameter King Attack Margin, a lower value than 100 will produce more games, a higher value less games. It's not exact science, just a matter of taste. An extreme low value of 10 might extract not so convincing games. The parameter is found in the king-attack.ini file.

Download :
90% of coding is debugging, the other 10% is writing bugs.
User avatar
pohl4711
Posts: 2741
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: BoCC -- Beauty of Computer Chess

Post by pohl4711 »

Buggy: I filtered my Super 3 tournament games, got 170 games (said the tool). But it were 171 (1 win with black). Said ORDO. I trust Ordo more. FritzGUI also says 171 games.

Sadly, I have to say, I am still not convinced by this idea/algorithm. I looked into these found 171 games and already game 6 is not a king attack. Mostly the opposite is true here (nearly everything in this game happens on queenside of the board). Just having a simple pattern like queen and bishop on the a1/h8 diagonal (happens in this game) is not a king-attack. I can be. But here it is definitly not the case. And, if a tool only delivers 171 games out of a 19350 games gamebase, and games mostly played by aggressive playing engines (Patrica, Rebel Extreme, CS Tal 2.1, Revenge 1, Cerberus), these 171 games should really nail it... And that does not happen.

[pgn]
[Event "Super 3 tournament"]
[Site "?"]
[Date "2024.06.01"]
[Round "138"]
[White "Komodo 14.1 HCE"]
[Black "Lc0 791921 CPU"]
[Result "1-0"]
[ECO "A57"]
[WhiteFideId "-1"]
[WhiteFideId "-1"]
[PlyCount "101"]
[GameId "2204558239056107"]
[EventDate "2024.??.??"]

1. d4 {book} Nf6 {book} 2. c4 {book} c5 {book} 3. d5 {book} b5 {book} 4. cxb5 {book} g6 {book} 5. Nc3 {book} Bg7 {book} 6. e4 {book} d6 {book} 7. f4 {book} Nbd7 {book} 8. Nf3 {book} O-O {book} 9. a4 {1.07/28 69s} a6 {-0.48/11 34} 10. Be2 {0.87/29 66s} axb5 {-0.42/13 27} 11. Bxb5 {0.81/29 20} Ba6 {-0.41/12 10} 12. Bxa6 {1.11/28 11} Rxa6 {-0.44/12 9.0s} 13. O-O {0.90/28 63s} Qa8 {-0.43/11 16} 14. Ra3 {0.96/26 15} Nb6 {-0.42/12 25} 15. Qc2 {0.92/29 45} Nfd7 {-0.40/16 24} 16. b3 {0.92/30 14} c4 {-0.40/17 9.1s} 17. b4 {0.76/31 14} Bxc3 {-0.41/18 8.9s} 18. Qxc3 {0.99/31 9.8s} Rxa4 {-0.43/18 12} 19. Bb2 {1.05/30 11} Nf6 {-0.50/18 35} 20. Rfa1 {0.99/30 15} Rc8 {-0.56/18 58} 21. g4 {1.87/33 9.9s} Qa7 {-0.39/18 9.7s} 22. Kg2 {2.23/32 10} Rxa3 {-0.74/16 7.9s} 23. Rxa3 {2.65/32 13} Na4 {-1.07/15 9.4s} 24. Rxa4 {2.69/34 19} Qxa4 {-2.03/13 13} 25. g5 {3.09/32 14} h5 {-1.97/13 35} 26. gxf6 {6.58/27 7.7s} exf6 {-2.41/14 5.8s} 27. Qxf6 {7.43/30 11} c3 {-5.82/14 19} 28. Ng5 {7.65/29 10} Qd7 {-8.33/14 18} 29. Bxc3 {8.66/30 15} Rxc3 {-9.71/13 7.7s} 30. Qxc3 {9.18/29 21} Qg4+ {-10.18/12 7.9s} 31. Qg3 {9.84/30 18} Qe2+ {-10.33/10 17} 32. Kh3 {9.71/29 13} f6 {-8.53/9 37} 33. Ne6 {10.63/29 14} Kf7 {-7.50/12 23} 34. f5 {10.67/27 12} g5 {-8.19/13 17} 35. Nxg5+ {10.72/25 8.6s} fxg5 {-10.24/12 9.4s} 36. Qxg5 {10.57/24 8.9s} Qf3+ {-11.13/11 31} 37. Qg3 {13.88/28 17} Qf1+ {-11.25/11 24} 38. Kh4 {15.01/25 9.7s} Qe2 {-9.86/9 6.6s} 39. Qg6+ {15.86/24 12} Kf8 {-11.25/9 20} 40. Qxd6+ {19.67/22 6.9s} Kf7 {-14.44/8 16} 41. Qd7+ {25.88/25 8.1s} Kf8 {-8.99/9 17} 42. Kg5 {32.93/23 8.5s} Qxh2 {-7.18/9 14} 43. Qc8+ {#25/25 1.6s} Kf7 {-7.23/10 12} 44. Qe6+ {#23/26 1.6s} Kf8 {-8.59/1 0.001s} 45. f6 {#21/29 2.1s} Qc7 {-19.48/13 20} 46. d6 {#11/49 1.2s} Qf7 {-#12/6 1.2s} 47. Qxf7+ {#9/99 0.31s} Kxf7 {-117.70/1 0.001s} 48. d7 {#7/99 0.010s} Ke6 {-#6/4 0.13s} 49. d8=Q {#5/99 0.016s} Kf7 {-#4/1 0.001s} 50. Qe7+ {#3/99 0.007s} Kg8 {-#2/1 0.001s} 51. Qg7# {#1/99 0.006s, White mates} 1-0
[/pgn]
User avatar
Rebel
Posts: 7323
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: BoCC -- Beauty of Computer Chess

Post by Rebel »

pohl4711 wrote: Mon Jul 28, 2025 1:04 pm Buggy: I filtered my Super 3 tournament games, got 170 games (said the tool). But it were 171 (1 win with black). Said ORDO. I trust Ordo more. FritzGUI also says 171 games.

Sadly, I have to say, I am still not convinced by this idea/algorithm. I looked into these found 171 games and already game 6 is not a king attack. Mostly the opposite is true here (nearly everything in this game happens on queenside of the board). Just having a simple pattern like queen and bishop on the a1/h8 diagonal (happens in this game) is not a king-attack. I can be. But here it is definitly not the case. And, if a tool only delivers 171 games out of a 19350 games gamebase, and games mostly played by aggressive playing engines (Patrica, Rebel Extreme, CS Tal 2.1, Revenge 1, Cerberus), these 171 games should really nail it... And that does not happen.

[pgn]
[Event "Super 3 tournament"]
[Site "?"]
[Date "2024.06.01"]
[Round "138"]
[White "Komodo 14.1 HCE"]
[Black "Lc0 791921 CPU"]
[Result "1-0"]
[ECO "A57"]
[WhiteFideId "-1"]
[WhiteFideId "-1"]
[PlyCount "101"]
[GameId "2204558239056107"]
[EventDate "2024.??.??"]

1. d4 {book} Nf6 {book} 2. c4 {book} c5 {book} 3. d5 {book} b5 {book} 4. cxb5 {book} g6 {book} 5. Nc3 {book} Bg7 {book} 6. e4 {book} d6 {book} 7. f4 {book} Nbd7 {book} 8. Nf3 {book} O-O {book} 9. a4 {1.07/28 69s} a6 {-0.48/11 34} 10. Be2 {0.87/29 66s} axb5 {-0.42/13 27} 11. Bxb5 {0.81/29 20} Ba6 {-0.41/12 10} 12. Bxa6 {1.11/28 11} Rxa6 {-0.44/12 9.0s} 13. O-O {0.90/28 63s} Qa8 {-0.43/11 16} 14. Ra3 {0.96/26 15} Nb6 {-0.42/12 25} 15. Qc2 {0.92/29 45} Nfd7 {-0.40/16 24} 16. b3 {0.92/30 14} c4 {-0.40/17 9.1s} 17. b4 {0.76/31 14} Bxc3 {-0.41/18 8.9s} 18. Qxc3 {0.99/31 9.8s} Rxa4 {-0.43/18 12} 19. Bb2 {1.05/30 11} Nf6 {-0.50/18 35} 20. Rfa1 {0.99/30 15} Rc8 {-0.56/18 58} 21. g4 {1.87/33 9.9s} Qa7 {-0.39/18 9.7s} 22. Kg2 {2.23/32 10} Rxa3 {-0.74/16 7.9s} 23. Rxa3 {2.65/32 13} Na4 {-1.07/15 9.4s} 24. Rxa4 {2.69/34 19} Qxa4 {-2.03/13 13} 25. g5 {3.09/32 14} h5 {-1.97/13 35} 26. gxf6 {6.58/27 7.7s} exf6 {-2.41/14 5.8s} 27. Qxf6 {7.43/30 11} c3 {-5.82/14 19} 28. Ng5 {7.65/29 10} Qd7 {-8.33/14 18} 29. Bxc3 {8.66/30 15} Rxc3 {-9.71/13 7.7s} 30. Qxc3 {9.18/29 21} Qg4+ {-10.18/12 7.9s} 31. Qg3 {9.84/30 18} Qe2+ {-10.33/10 17} 32. Kh3 {9.71/29 13} f6 {-8.53/9 37} 33. Ne6 {10.63/29 14} Kf7 {-7.50/12 23} 34. f5 {10.67/27 12} g5 {-8.19/13 17} 35. Nxg5+ {10.72/25 8.6s} fxg5 {-10.24/12 9.4s} 36. Qxg5 {10.57/24 8.9s} Qf3+ {-11.13/11 31} 37. Qg3 {13.88/28 17} Qf1+ {-11.25/11 24} 38. Kh4 {15.01/25 9.7s} Qe2 {-9.86/9 6.6s} 39. Qg6+ {15.86/24 12} Kf8 {-11.25/9 20} 40. Qxd6+ {19.67/22 6.9s} Kf7 {-14.44/8 16} 41. Qd7+ {25.88/25 8.1s} Kf8 {-8.99/9 17} 42. Kg5 {32.93/23 8.5s} Qxh2 {-7.18/9 14} 43. Qc8+ {#25/25 1.6s} Kf7 {-7.23/10 12} 44. Qe6+ {#23/26 1.6s} Kf8 {-8.59/1 0.001s} 45. f6 {#21/29 2.1s} Qc7 {-19.48/13 20} 46. d6 {#11/49 1.2s} Qf7 {-#12/6 1.2s} 47. Qxf7+ {#9/99 0.31s} Kxf7 {-117.70/1 0.001s} 48. d7 {#7/99 0.010s} Ke6 {-#6/4 0.13s} 49. d8=Q {#5/99 0.016s} Kf7 {-#4/1 0.001s} 50. Qe7+ {#3/99 0.007s} Kg8 {-#2/1 0.001s} 51. Qg7# {#1/99 0.006s, White mates} 1-0[/pgn]
We must have a different understanding about the definition of a king attack.

After 24.Rxa4 score 2.69
25.g5 score 3.09
26.gxf6 score 6.58
27.Qxf6 score 7.43

The game is over.

A classic king attack.

I am more concerned about the games the tool did not found, but should have.

There is work to do.
90% of coding is debugging, the other 10% is writing bugs.
User avatar
pohl4711
Posts: 2741
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: BoCC -- Beauty of Computer Chess

Post by pohl4711 »

Rebel wrote: Mon Jul 28, 2025 7:13 pm
I am more concerned about the games the tool did not found, but should have.

There is work to do.
Indeed, 171 out of 19350 games is a very small margin. Only 0.88%. That is way too less to build a working scoring-system for a EAS-like-tool. Because if the number of input-games is "only" 1000 or so, only some few games (10 or less) will be found. Not all gamebases are that big.
User avatar
pohl4711
Posts: 2741
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: BoCC -- Beauty of Computer Chess

Post by pohl4711 »

Rebel wrote: Mon Jul 28, 2025 7:13 pm We must have a different understanding about the definition of a king attack.
Indeed, for me a king-attack does not happen in or close before the endgame like in this game here. This king-attack was just a possible threat in the whole middlegame. But it did not happen. When it finally became a real threat, the game was already in the endgame.
Thats exactly what the core of the problem is, IMO: The simple HCE-eval sees a possible king-attack, but that does not mean, it really happens, because the eval of the playing engine can be totally different - perhaps it wants just to win the endgame and uses the threat of a king-attack just for some positional progress. Who knows? Your tool does not, my tool does not. So, IMHO it is way better not to use any evals. Especially not using a simple HCE-eval when deciding, if a superstrong neuralnet engine launches a king-attack or not. That will never work properly, I presume. A neuralnet evaluation is on another planet, compared to a simple HCE-eval. Thats why HCE evals are no longer used in engines.

But, for me, it seems legit, that an engine, which is a great king-attacking-player, should score very good in my sub-EAS-stat "Very short wins", because real king-attacks (launched right after the opening!) will lead to more wins in this category (mating the king with an attack launched right after the opening is a very short win...)

Here my Super 3 Tournament

Code: Select all

C: Very short wins (40 moves or less)                : [1]:04.00% CSTal 2.1 EAS  
                                                       [2]:02.43% Patricia 250510 a512  
                                                       [3]:01.92% Rebel Extreme 1.0  
                                                       [4]:01.68% Revenge 1.0 avx2  
                                                       [5]:01.66% Cerberus 21124081r81 
Clear lead for CSTal 2.1 EAS here.

Or take a look of the C-category of my full UHO-Ratinglist (1.8 million games). Same here:

Code: Select all

C: Very short wins (45 moves or less)                : [1]:11.05% CSTal 2.1 EAS  
                                                       [2]:09.00% Patricia 3.1 avx2  
                                                       [3]:07.97% Patricia 250510 a512  
                                                       [4]:07.32% Stockfish final HCE  
                                                       [5]:06.16% Slow Chess 2.9 avx2  
So, it is possible to find the best king-attacker without using any evals? Not sure about that, but it looks promising. This category alone seems to find the good king-attacking engines. To find the king-attack games, you should look only into these supershort wins (using a way smaller king-attack margin than 100) and search for king-attack patterns only in these games. This could work. Perhaps.

So, I would try this: Calculate the average length of all won games and sub -15 or -10 or -5 (experimental...). Then look only in games for a king-attack, which are that short, but do this with a smaller king-attack-margin to find more games.
User avatar
Rebel
Posts: 7323
Joined: Thu Aug 18, 2011 12:04 pm
Full name: Ed Schröder

Re: BoCC -- Beauty of Computer Chess

Post by Rebel »

@pohl4711

Your judgement is way out of control, you haven't understood the difference between between the rating part (BoCC) and the pgn-king-attack-extraction tool.
as said earlier wrote:The output is controlled by the parameter King Attack Margin, a lower value than 100 will produce more games, a higher value less games. It's not exact science, just a matter of taste. An extreme low value of 10 might extract not so convincing games. The parameter is found in the king-attack.ini file.
Just set the King Attack Margin = 10 and run again.

On BoCC however all games from 1 to infinity are calculated, the vast majority is below 100 and the value 100 is just for PGN output only in BoCC.
90% of coding is debugging, the other 10% is writing bugs.