Looking for PGN tool

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

Moderators: hgm, Rebel, chrisw

User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Looking for PGN tool

Post by Rebel »

I have a tool that calculates the average used depth of engines parsing a PGN.

Code: Select all

Engine                 Depth
AsmFish                30.65
Sf9                    30.14
But the tool is not command line.

I wonder if there is a similar tool, something like "calc.exe match.pgn" from the command line.
90% of coding is debugging, the other 10% is writing bugs.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Looking for PGN tool

Post by Dann Corbit »

I have tools to do that, but I run them in stages, like pipe functions.
I do not think my tools would be useful for you, because I turn the PGN files into stored procedure calls to load the information into my database.
To do the depth calculation, I actually use SQL Server with: sum(acd) / count(acd) group by EngineName.

I think you might possibly be able to do it with pgn-extract, since it can turn PGN into EPD.
But I am not sure about it.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Looking for PGN tool

Post by Ferdy »

Rebel wrote: Tue Jul 03, 2018 10:57 am I have a tool that calculates the average used depth of engines parsing a PGN.

Code: Select all

Engine                 Depth
AsmFish                30.65
Sf9                    30.14
But the tool is not command line.

I wonder if there is a similar tool, something like "calc.exe match.pgn" from the command line.
Try it at,
https://sites.google.com/view/deuterium ... /tools/pgn

Code: Select all

C:\tools\python\GetAverageDepth>gad.exe -h
usage: gad.exe [-h] [-i INPUT] [-o OUTPUT] [-a MINCP] [-b MAXCP] [-l {0,1}]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        input pgn filename default is games.pgn
  -o OUTPUT, --output OUTPUT
                        output csv filename default is gad_output.csv
  -a MINCP, --mincp MINCP
                        minimum score in centipawn
  -b MAXCP, --maxcp MAXCP
                        maximum score in centipawn
  -l {0,1}, --log {0,1}
                        output some info to gad_log.txt, by default log is
                        disabled or 0
To save average depth without using score filters,

Code: Select all

gad.exe --input yourgames.pgn
It will output the table in csv format. It also output in console.

Code: Select all

Engine                           Depth
Vajolet2 2.5 x64 1CPU            25.11
Bobcat 8.0 x64 1CPU              23.43
Daydreamer 2.0.0 x64             22.26
Amoeba 2.8 x64                   22.17
Tucano 7.00 x64                  21.79
Crafty 25.1 x64 1CPU             21.52
Zurichess Neuchatel x64          21.19
Demolito 2018-03-01 x64 1CPU     20.53
Arasan 20.4.1 x64 1CPU           20.16
Deuterium v2018.1.35.514         19.54
Rodent III 0.172 x64 1CPU        18.29
Dirty v30Apr2017 x64 1CPU        18.03
Cheng 4.39 x64 1CPU              17.51
DisasterArea 1.65 x64 1CPU       17.47
Quazar 0.4 x64 1CPU              17.13
Wasp 3.00 x64 1CPU               16.84
Fruit reloaded 3.2.1 x64 1CPU    16.51
Atlas 3.91 x64 1CPU              16.26
Toga II 4.0 x64 1CPU             16.16
Murka 3.0 x64                    15.99
Hiarcs 14 1CPU                   15.54
Spike 1.4 1CPU                   14.90
Gaviota 1.0 x64 1CPU             13.93
Spark 1.0 x64 1CPU               13.07
To limit its average depth calculation based from a range of scores, useful when you don't want to include depths when one side has already a winning or mating scores (usually high depths).

Code: Select all

gad.exe --input yourgames.pgn --mincp -200 --maxcp 200
To enable logging for checking the output.

Code: Select all

gad.exe -i yourgames.pgn --mincp -200 --maxcp 200 --log 1
It is not really fast but should work fine. It is tested to work from cutesschess and winboard chess pgn output.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Looking for PGN tool

Post by Rebel »

Ferdy wrote: Tue Jul 03, 2018 11:53 pmTry it at,
https://sites.google.com/view/deuterium ... /tools/pgn
I did.

A comparison with my Protools following http://rebel13.nl/los1.html

Code: Select all

Engine                 Depth    GAD   PGN=Arena
AsmFish                30.65   30.60     
Sf9                    30.14   30.11
Looks good.

Code: Select all

Engine                 Depth    GAD   PGN=Arena
ProDeo 2.2 SMP         15.72   22.90
ProDeo 2.2             15.59   15.60
I suppose somehow "ProDeo 2.2 SMP" [22.90] is counted twice (playing white or black) due to the similar names?

Code: Select all

Engine                 Depth    GAD   PGN=cutechess
SF5                    17.88   18.05
[MOB=125]              17.96   18.12
Small differences.

Code: Select all

Engine                 Depth    GAD   PGN=cutechess
[EVAL=95]              10.75   10.74
ProDeo 2.2             10.79   10.78
Excellent.
Ferdy wrote:It is not really fast but should work fine. It is tested to work from cutesschess and winboard chess pgn output.
My experience with counters is that they considerable slow down the process, I usually do it once in 100 or 1000. Anyway I will offer it for download as an alternative for ProTools.
90% of coding is debugging, the other 10% is writing bugs.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Looking for PGN tool

Post by Ferdy »

Rebel wrote:

Code: Select all

Engine                 Depth    GAD   PGN=Arena
ProDeo 2.2 SMP         15.72   22.90
ProDeo 2.2             15.59   15.60
I suppose somehow "ProDeo 2.2 SMP" [22.90] is counted twice (playing white or black) due to the similar names?
Could you send me the pgn of this result? I will check it.

I have tried an Arena pgn output, change names to ProDeo 2.2 SMP and ProDeo 2.2 and result looks fine.
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Looking for PGN tool

Post by Rebel »

Ferdy wrote: Wed Jul 04, 2018 9:47 am
Rebel wrote:

Code: Select all

Engine                 Depth    GAD   PGN=Arena
ProDeo 2.2 SMP         15.72   22.90
ProDeo 2.2             15.59   15.60
I suppose somehow "ProDeo 2.2 SMP" [22.90] is counted twice (playing white or black) due to the similar names?
Could you send me the pgn of this result?
Done.
90% of coding is debugging, the other 10% is writing bugs.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Looking for PGN tool

Post by Ferdy »

Rebel wrote: Wed Jul 04, 2018 3:53 pm
Ferdy wrote: Wed Jul 04, 2018 9:47 am
Rebel wrote:

Code: Select all

Engine                 Depth    GAD   PGN=Arena
ProDeo 2.2 SMP         15.72   22.90
ProDeo 2.2             15.59   15.60
I suppose somehow "ProDeo 2.2 SMP" [22.90] is counted twice (playing white or black) due to the similar names?
Could you send me the pgn of this result?
Done.
There are unusual high depths from black. This could be the reason GAD has higher average depth for Prodeo SMP.

24. b3 {+1.04/14 7} Qa6 {-1.07/214 11}
d = 214

41. a7 {+6.11/13 6} Rd8 {-4.99/215 4}
d = 215

[Event "Smp-cn300"]
[Site "EDDY-PC"]
[Date "2017.10.03"]
[Round "1"]
[White "ProDeo 2.2"]
[Black "ProDeo 2.2 SMP"]
[Result "1-0"]
[BlackElo "2200"]
[ECO "B12"]
[Opening "Caro-Kann"]
[Time "21:28:01"]
[Variation "Advance, 4.Nf3 e6 5.Be2 c5 6.O-O"]
[WhiteElo "2000"]
[TimeControl "40/240:40/240:40/240"]
[Termination "adjudication"]
[PlyCount "94"]
[WhiteType "program"]
[BlackType "program"]

1. e4 c6 2. Nf3 d5 3. e5 Bf5 4. Nd4 Nh6 5. Be2 c5 6. Nb3 e6 7. d4 c4 8.
N3d2 f6 9. Nf3 Nf7 10. exf6 gxf6 11. O-O {+0.34/13 8} Nc6 {+0.03/13 8} 12.
Nh4 {+0.31/13 10} Be4 {-0.27/14 15} 13. Bh5 {+0.46/14 10} Bd6 {-0.07/213
13} 14. Nc3 {+0.92/14 9} Bg6 {-0.60/14 11} 15. Re1 {+1.00/14 9} Qd7
{-0.82/213 6} 16. Bg4 {+0.95/14 9} Nfd8 {-0.91/14 13} 17. Nxd5 {+1.07/14 9}
Bxh2+ {-0.93/13 5} 18. Kxh2 {+0.84/12 1} Qxd5 {-0.98/14 4} 19. c3 {+1.03/14
7} Ne7 {-0.99/13 5} 20. Bf3 {+1.03/14 12} Qd6+ {-0.97/13 8} 21. g3
{+1.17/13 7} Bd3 {-0.93/13 9} 22. Ng2 {+1.09/13 7} Ng6 {-0.99/13 9} 23. Ne3
{+1.25/13 5} O-O {-1.07/14 7} 24. b3 {+1.04/14 7} Qa6 {-1.07/214 11} 25.
Be2 {+1.20/14 7} Bxe2 {-1.25/14 7} 26. Qxe2 {+1.23/13 1} Rc8 {-1.09/14 10}
27. Nxc4 {+1.35/14 7} b5 {-1.21/15 6} 28. Na3 {+1.48/17 14} Rxc3 {-1.37/15
4} 29. Nxb5 {+1.50/16 9} Rc6 {-1.40/14 4} 30. Ba3 {+1.73/15 8} Rf7
{-1.44/14 4} 31. Bc5 {+1.79/14 4} Rd7 {-1.58/13 5} 32. a4 {+1.88/14 5} Kg7
{-1.85/13 5} 33. b4 {+2.08/15 6} Rc8 {-2.00/14 4} 34. a5 {+2.13/15 7} Ra8
{-2.00/15 6} 35. Nxa7 {+2.22/15 5} Raxa7 {-2.10/14 3} 36. b5 {+2.17/15 8}
Qb7 {-2.57/15 16} 37. Bxa7 {+2.17/13 2} Qxa7 {-2.63/13 3} 38. b6 {+2.83/14
8} Qb7 {-2.96/13 9} 39. Reb1 {+3.79/13 9} Qd5 {-3.79/13 7} 40. a6 {+3.82/12
5} Nc6 {-3.89/212 6} 41. a7 {+6.11/13 6} Rd8 {-4.99/215 4} 42. a8=Q
{+7.05/14 5} Rxa8 {-7.26/11 2} 43. Rxa8 {+6.99/11 1} Qf5 {-7.37/13 8} 44.
Rb5 {+8.51/14 7} e5 {-8.55/13 4} 45. Ra7+ {+9.80/14 9} Nge7 {-9.55/14 8}
46. dxe5 {+11.54/13 6} h5 {-9.76/212 4} 47. Rc7 {+14.50/12 6} Kf7
{-16.55/213 10 Arena Adjudication} 1-0
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Looking for PGN tool

Post by Rebel »

Indeed, I remember now.
90% of coding is debugging, the other 10% is writing bugs.