Tool for converting PGN to EPD for analysis.

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

Moderator: Ras

Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Tool for converting PGN to EPD for analysis.

Post by Ferdy »

reflectionofpower wrote:
Ferdy wrote:
Lonnie wrote:Q7/8/8/8/2K5/k7/8/1q6 b - - fmvn 73; hmvc 0; pm Kb2; bm a3b2; ce 0; c0 "Stockfish 6 64 POPCNT";
1r1r4/6p1/8/2Pkb1RR/1P2p3/1P5P/3p2P1/6K1 b - - fmvn 39; hmvc 1; pm d1=Q+; bm d2d1q; dm 6; c0 "Stockfish 6 64 POPCNT";
5Q2/8/p3Q1Q1/1p1P4/8/1K6/P6k/8 w - - fmvn 57; hmvc 3; pm Qfh6#; bm f8h6; dm 1; c0 "Stockfish 6 64 POPCNT";

I did 10 games in my test file, a few had ce 0 so I assume these were draws as there was 2 of them and some had ce 0 meaning checkmate?
2 types of epd output line, one line has ce, the other has dm.
dm = distance to mate (in moves), dm 1 is mate in 1.
The ce is for centipawn evaluation. A queen ahead could be ce 1000 for example. That ce 0; is drawish.

Hold on!!
I got a bug here, I am actually extracting the 2nd to the last position in a game, by using

Code: Select all

pgn2fen 1.pgn -e >out.pgn.
it should have been

Code: Select all

pgn2fen 1.pgn -e -l >out.pgn

I will issue version 3 later.
ok, gotcha ya
Here already compressed with UPX. Try to experiment with this there could still be bugs.
http://www.mediafire.com/download/rx4i0 ... tion-3.rar

The output currently. I plan to add acs if you need this info, see opcodes below. And also the hash size, the threads used and the depth reached in the analysis, even the hardware info.

Code: Select all

5rk1/1p3pb1/2n3pp/4pq2/2P3n1/6P1/1BN1PPBP/Q2R2K1 w - - fmvn 23; hmvc 3; bm g2f3; ce -24; c0 "Stockfish 6 64 POPCNT";
These are other possible opcodes.

Code: Select all

acn analysis count nodes
acs analysis count seconds
am avoid move(s)
bm best move(s)
c0 comment (primary, also c1 though c9)
ce centipawn evaluation
dm direct mate fullmove count
draw_accept accept a draw offer
draw_claim claim a draw
draw_offer offer a draw
draw_reject reject a draw offer
eco Encyclopedia of Chess Openings opening code
fmvn fullmove number
hmvc halfmove clock
id position identification
nic _New In Chess_ opening code
noop no operation
pm predicted move
pv predicted variation
rc repetition count
resign game resignation
sm supplied move
tcgs telecommunication game selector
tcri telecommunication receiver identification
tcsi telecommunication sender identification
v0 variation name (primary, also v1 though v9)
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Tool for converting PGN to EPD for analysis.

Post by Ferdy »

GEPA version 4
* Added support for Max CPUs option
* Added support for Cores option
* Extend info on output epd, id, hash, threads, acs and hardware
* Added an option to output log of engine and script. The file is app_log.txt
* The app is compressed with UPX

Sample run.

Code: Select all

Game End Position Analyzer (GEPA) v4

System         : Windows
Release        : 7
Machine        : AMD64
Processor      : Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
Brand          : Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz

orig.pgn file is found!!
pgn2fen.exe file is found!!
ai_engine.exe file is found!!

Enter 1 to enable log output [0/1]? 1
Enter engine analysis time in milliseconds? 500
Enter engine Hash value in MB? 128
Enter engine number of threads? 1
Enter win margin in cp? 300

Converting pgn to epd ...
Error loading PGN: Error: Line 75: Unexpected End-of-file
Saving end position of every game ...
Analyzing positions ...

id name Stockfish 6 64 POPCNT

Pos 1: 5rk1/1p3pb1/2n3pp/4pq2/2P3n1/6P1/1BN1PPBP/Q2R2K1 w - - fmvn 23; hmvc 3;
fen: 5rk1/1p3pb1/2n3pp/4pq2/2P3n1/6P1/1BN1PPBP/Q2R2K1 w - - 3 23
engine bestmove: g2f3
engine time (ms): 504
engine score (cp): -14 @depth 15
Sample output.

Code: Select all

5rk1/1p3pb1/2n3pp/4pq2/2P3n1/6P1/1BN1PPBP/Q2R2K1 w - - fmvn 23; hmvc 3; bm g2f3; ce -16; acs 0.3; c0 "Stockfish 6 64 POPCNT"; c1 "Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz"; c2 "Hash 64"; c3 "Threads 1"; id 1;
Download.
http://www.mediafire.com/download/uxf9k ... /gepa4.rar