Practical use of the stockfish "eval" command

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

eric.oldre
Posts: 18
Joined: Thu Jun 19, 2014 5:07 am
Location: Minnesota, USA

Practical use of the stockfish "eval" command

Post by eric.oldre »

From my understanding Stockfish has a command "eval" which when run, outputs debugging information about the evaluation of the current position.

I would like to implement something similar in my engine to help debug / tune its evaluation. But typing in FEN positions into a command line one by one doesn't seem too practical.

Ideally I'd like to run through games in PGN format in some GUI, and be able to view the output of the eval command as I cycle through moves. Is there a GUI that enables you to do this?

If not, what strategies do you more experienced guys use for this type of analysis.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Practical use of the stockfish "eval" command

Post by bob »

eric.oldre wrote:From my understanding Stockfish has a command "eval" which when run, outputs debugging information about the evaluation of the current position.

I would like to implement something similar in my engine to help debug / tune its evaluation. But typing in FEN positions into a command line one by one doesn't seem too practical.

Ideally I'd like to run through games in PGN format in some GUI, and be able to view the output of the eval command as I cycle through moves. Is there a GUI that enables you to do this?

If not, what strategies do you more experienced guys use for this type of analysis.
I've had this same command for 40 years now in both Cray Blitz and Crafty. I find it useful when I see a PV with a score that seems "off" to my human sensibilities... I can set up the position, feed in the PV moves, and then type "score" to see the score that goes with this position. I break it down by piece type, by eg/mg and so forth, so that if one of those seems way out of range, I know exactly where to start looking in the evaluate.c source code.

I'm not sure it is of use to a general user other than to ask "what is your snap-judgement of this position with no search whatsoever to help?"
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Practical use of the stockfish "eval" command

Post by Ferdy »

eric.oldre wrote:From my understanding Stockfish has a command "eval" which when run, outputs debugging information about the evaluation of the current position.

I would like to implement something similar in my engine to help debug / tune its evaluation. But typing in FEN positions into a command line one by one doesn't seem too practical.

Ideally I'd like to run through games in PGN format in some GUI, and be able to view the output of the eval command as I cycle through moves. Is there a GUI that enables you to do this?

If not, what strategies do you more experienced guys use for this type of analysis.
Convert the pgn to epd using pgn2fen program, then analyze or take the eval of every positions using a script (I use python) from your engine, and let script save relevant info together with the epd. Then you can view those positions together with the eval info using arena or scid vs pc gui, these two I have tried so far. What you save is something like below.

Code: Select all

4r3/3br2k/3p2pp/pp1P1p2/2pBnQ1P/2P5/PP4PK/4R3 b - - fmvn 33; hmvc 5; pm Rg8; ce -5;
That ce -5 is the centipawn evaluation from your engine. It is even possible to save the static eval, search eval, material difference and others.