Aggression Test

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

Moderators: hgm, Rebel, chrisw

chesskobra
Posts: 216
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Aggression Test

Post by chesskobra »

Rebel wrote: Wed Apr 03, 2024 11:08 am
pohl4711 wrote: Wed Apr 03, 2024 10:55 am
The reason is, the EAS Tool looks for less material, a missing queen, but later the win for this color. But the 2 conditions (less material, a missing queen) must be true for 8 plies in a row. In this rare case here, the queen is recaptured after 9 plies...
In most cases, the 8-ply interval works fine. If I would increase it to 10 or 12, a lot of sacs would be missed by the EAS Tool.
So 8 plies work best, but there is no perfect world... If you parse games only by their moves with pgn-extract, without any evaluation by an engine (that makes the EAS Tool so brutally fast), there can be mismatches finding sacs. I am not able to avoid this completely, sorry.
Yep.

If have to see the perfection definition is a sac, anyone?
I have been thinking about exactly this problem (and especially the issue pointed out by Stefan) last couple of days. I think to improve the sac discovery, using the current implementation of pgn-extract, will be complicated. We will have to implement something like what they call 'technical analysis' in the finance world, where they (mostly amateurs) consider various patterns in ups and downs of a stock value for making buy or sell decisions. Although, technical analysis is considered pseudo-science in finance, it could be useful in chess to an extent. But beyond searching for sacs, it will be pseudo-science in chess as well.
chrisw
Posts: 4360
Joined: Tue Apr 03, 2012 4:28 pm

Re: Aggression Test

Post by chrisw »

Rebel wrote: Wed Apr 03, 2024 11:08 am
pohl4711 wrote: Wed Apr 03, 2024 10:55 am
Rebel wrote: Wed Apr 03, 2024 8:41 am [pgn][Event "?"]
[Site "?"]
[Date "2024.04.02"]
[Round "105"]
[White "Rebel-xyz"]
[Black "Clover-5.0"]
[Result "1-0"]
[ECO "D31"]
[Opening "QGD"]
[Variation "3.Nc3"]
[TimeControl "40/10"]
[Termination "adjudication"]
[PlyCount "204"]

1. d4 d5 2. c4 e6 3. Nc3 Bb4 4. Qc2 Nf6 5. cxd5 exd5 6. Bg5 c5 7. dxc5 h6
8. Bh4 Nc6 9. e3 Be6 10. Bb5 O-O 11. Ne2 Bxc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3 98. Rb6 Ke8
99. Rb8+ Kd7 100. Nb3 Ke7 101. Nc5 Kf7 102. Nxd3 Kg6 1-0
[/pgn]

@Stefan, I came across this game labelled as queen sacrifice, 24.Re1 Qxe2 25.Bxf6 but it really isn't, see 29.Nxe2
The reason is, the EAS Tool looks for less material, a missing queen, but later the win for this color. But the 2 conditions (less material, a missing queen) must be true for 8 plies in a row. In this rare case here, the queen is recaptured after 9 plies...
In most cases, the 8-ply interval works fine. If I would increase it to 10 or 12, a lot of sacs would be missed by the EAS Tool.
So 8 plies work best, but there is no perfect world... If you parse games only by their moves with pgn-extract, without any evaluation by an engine (that makes the EAS Tool so brutally fast), there can be mismatches finding sacs. I am not able to avoid this completely, sorry.
Yep.

If have to see the perfection definition is a sac, anyone?
Yup, detection is using the PV.
1. PV[0] can be any move except a capture.
2. PV[1] is a capture by the opponent that reduces raw material balance below zero.
3. The capture piece at 2 has not been recaptured by PV[end] and raw material balance is still below zero.
4. Score (which equals static eval at PV[end]) is above zero and not reached mate.

In other words the (PV, score) shows positive even though the material balance is still negative. The engine didn’t just sacrifice because it has tactics that recover, it must have sacrificed because it has positional knowledge that compensates for the material sacrificed. As far as I can tell, no aggressiveness algorithm has been put forward which uses this test. Aggression algorithms that do not use this test will contain many false positives because they are detecting tactical sacrifices. The faster/deeper the engine the more the false positives, therefore the latest SF will show the highest false results.
Werewolf
Posts: 1848
Joined: Thu Sep 18, 2008 10:24 pm

Re: Aggression Test

Post by Werewolf »

pohl4711 wrote: Wed Apr 03, 2024 10:59 am
Werewolf wrote: Wed Apr 03, 2024 9:44 am
pohl4711 wrote: Wed Apr 03, 2024 6:20 am
Werewolf wrote: Tue Apr 02, 2024 5:32 pm
chesskobra wrote: Tue Apr 02, 2024 3:45 am What is aggressive chess? Counting sacrifices is just one metric, somewhat meaningless in my opinion.
Yes I agree. This may be the reason, perhaps, I'm getting very different results to Mr. Pohl.

I'm defining it as a propensity to attack the enemy king.
Where are these different results? What was measured? And how?

(And by the way: My EAS-Tool does much, much more, than just counting sacs...)
OK noted about your EAS tool. I'm not criticising it, but I do get different results.

It'll take me another month to build up the data but I'm testing engines with around 1000 Elo difference in strength, where resignation is not allowed, based on this logic:

1) Where massive Elo difference exists the stronger side can usually exert its will without much resistance
2) Checkmate terminates a game immediately
3) Therefore, an engine with a tendency to attack the enemy king by flinging pieces at it will likely have shorter games on average than a grinder.
The EAS Tool measures short wins and the overall length of all won games of an engine, too.
https://www.sp-cc.de/files/eas_scoring_explanation.txt
Point 1 is missing though.
chesskobra
Posts: 216
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Aggression Test

Post by chesskobra »

I would like to see evidence that an engine playing against stronger engines demonstrates the same aggressiveness as when playing against weaker engines, as measured by the EAS tool.

Also, why not use a very simple metric like number of points earned per 100 moves? This will incentivise short wins. For example, if your engine wins a game in 50 moves, draws another in 50 moves, its score is 1.5, which is better than an engine grinding 2 wins in 200 moves. Maybe some variation of this, since an engine winning a game in 100 moves gets 1 point, and another engine winning one game in 50 and losing 1 in 50 also gets a score of 1. It depends on how you want to assign weights. But such a metric will be much easier to calculate and will be quite informative at the same time.
User avatar
pohl4711
Posts: 2516
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: Aggression Test

Post by pohl4711 »

chesskobra wrote: Wed Apr 03, 2024 4:56 pm I would like to see evidence that an engine playing against stronger engines demonstrates the same aggressiveness as when playing against weaker engines, as measured by the EAS tool.
Here:
https://www.sp-cc.de/experiments.htm
User avatar
pohl4711
Posts: 2516
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: Aggression Test

Post by pohl4711 »

Werewolf wrote: Wed Apr 03, 2024 1:19 pm
pohl4711 wrote: Wed Apr 03, 2024 10:59 am
Werewolf wrote: Wed Apr 03, 2024 9:44 am
pohl4711 wrote: Wed Apr 03, 2024 6:20 am
Werewolf wrote: Tue Apr 02, 2024 5:32 pm
chesskobra wrote: Tue Apr 02, 2024 3:45 am What is aggressive chess? Counting sacrifices is just one metric, somewhat meaningless in my opinion.
Yes I agree. This may be the reason, perhaps, I'm getting very different results to Mr. Pohl.

I'm defining it as a propensity to attack the enemy king.
Where are these different results? What was measured? And how?

(And by the way: My EAS-Tool does much, much more, than just counting sacs...)
OK noted about your EAS tool. I'm not criticising it, but I do get different results.

It'll take me another month to build up the data but I'm testing engines with around 1000 Elo difference in strength, where resignation is not allowed, based on this logic:

1) Where massive Elo difference exists the stronger side can usually exert its will without much resistance
2) Checkmate terminates a game immediately
3) Therefore, an engine with a tendency to attack the enemy king by flinging pieces at it will likely have shorter games on average than a grinder.
The EAS Tool measures short wins and the overall length of all won games of an engine, too.
https://www.sp-cc.de/files/eas_scoring_explanation.txt
Point 1 is missing though.
Just depends on you, which games you give to the EAS Tool. Play a lot of enginegames with huge Elo differences of the engines and give these games to the EAS Tool. Point 1 no longer missing.