Stockfish hash tables and evaluation display

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

PostHypermodern

Stockfish hash tables and evaluation display

Post by PostHypermodern »

I don't really have interest in programming; I just play engine correspondence and I'm looking to get the most out of my machine.

I read in Robin Smith's book Modern Chess Analysis about the technique of getting better analysis by running the moves backwards. However, he said this only works with engines that don't clear hash tables between moves. I know Stockfish has an option to clear them, but are they left uncleared by default?

Also, he mentioned that Crafty has the option of displaying detailed evaluation, like what bonuses and penalties were assigned because of things like passed or doubled pawns. Can this also be done in Stockfish? I would like to see this because it will be easier for me to tell when the engine is factoring in things which may not be relevant to a certain position.

Lastly can you recommend other free engines with similar playing strength to Stockfish that don't clear hash tables and have this detailed evaluation option?

And I see my butterfingers screwed up my name. :cry:
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Stockfish hash tables and evaluation display

Post by tpetzke »

Stockfish has a nice evaluation output. It motivated me to display my evaluation terms very similar to this in my own engine.

About clearing the hash I'm not sure. I don't think it will clear them by default because they might still be useful for a later search. But they might be overwritten anyway, so if your analyses method depends on an old entry being present you should have a Plan B if its not.

Thomas...

Code: Select all

           Eval term |    White    |    Black    |     Total
                     |   MG    EG  |   MG    EG  |   MG     EG
---------------------+-------------+-------------+---------------
Material, PST, Tempo |   ---   --- |   ---   --- |   0.12   0.06
  Material imbalance |   ---   --- |   ---   --- |   0.00   0.00
               Pawns |   ---   --- |   ---   --- |   0.00   0.00
             Knights |  0.00  0.00 |  0.00  0.00 |  +0.00  +0.00
             Bishops |  0.00  0.00 |  0.00  0.00 |  +0.00  +0.00
               Rooks | -0.45  0.00 | -0.45  0.00 |  +0.00  +0.00
              Queens |  0.00  0.00 |  0.00  0.00 |  +0.00  +0.00
            Mobility | -0.61 -0.94 | -0.61 -0.94 |  +0.00  +0.00
         King safety |  0.97  0.00 |  0.97  0.00 |  +0.00  +0.00
             Threats |  0.00  0.00 |  0.00  0.00 |  +0.00  +0.00
        Passed pawns |  0.00  0.00 |  0.00  0.00 |  +0.00  +0.00
   Unstoppable pawns |   ---   --- |   ---   --- |  +0.00  +0.00
               Space |  0.46  0.00 |  0.46  0.00 |  +0.00  +0.00
---------------------+-------------+-------------+---------------
               Total |   ---   --- |   ---   --- |  +0.12  +0.06

Uncertainty margin: White: +0.00, Black: +0.00
Scaling: 100.00% MG,   0.00% * 100.00% EG.
Total evaluation: 0.12
PostHypermodern

Re: Stockfish hash tables and evaluation display

Post by PostHypermodern »

How do I get Stockfish to display this? I use Linux, but I dual boot with Vista. Can I see this display in SCID, or do I have to use the terminal?
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Stockfish hash tables and evaluation display

Post by tpetzke »

I don't use SCID, so can't comment on that. I communicate with engines usually via the terminal.

So you send first a UCI position command for the position you are interested in. e.g. position fen 8/k3P1P1/3P1p2/8/1p6/8/6p1/K7 b - - 0 1 and then enter eval

Thomas...
PostHypermodern

Re: Stockfish hash tables and evaluation display

Post by PostHypermodern »

Ah, thanks! Just one last question: what does "EG" and "MG" mean?
mar
Posts: 2552
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Stockfish hash tables and evaluation display

Post by mar »

PostHypermodern wrote:Ah, thanks! Just one last question: what does "EG" and "MG" mean?
endgame and midgame
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Stockfish hash tables and evaluation display

Post by lucasart »

PostHypermodern wrote:I don't really have interest in programming; I just play engine correspondence and I'm looking to get the most out of my machine.

I read in Robin Smith's book Modern Chess Analysis about the technique of getting better analysis by running the moves backwards. However, he said this only works with engines that don't clear hash tables between moves. I know Stockfish has an option to clear them, but are they left uncleared by default?
You seem to misunderstand how hash tables work.

Yes, Stockfish never clears the hash table, unless 1/ you restart it (obviously) 2/ you click the "clear hash" button.

But that's not the point. A lot of engines clear the hash before every newgame. But I don't think any engine would clear the hash table after a move is played: that would be completely retarded.

If you want a good engine for analysis, Stockfish, Critter and IvanHoe are certainly the best choices in the non commercial category. They all have about equal elo, but Critter is arguable above the crowd when it comes to tactical test suites.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Stockfish hash tables and evaluation display

Post by lucasart »

PostHypermodern wrote:How do I get Stockfish to display this? I use Linux, but I dual boot with Vista. Can I see this display in SCID, or do I have to use the terminal?
Yes, obviously, you need to use the terminal. The "eval" command of Stockfish is an extra command. It doesn't belong to the UCI protocol. So it's very much to each engine author what extra command he may find useful to provide. I suppose the SF team did that mainly for their own debugging purposes.

For a GUI to be able to display that kind of info, the eval command would have to be specified by the UCI protocol, and especially the output format, so it can be parsed in the same way for all engines. And that's *never* going to happen (if only because closed source engine authors won't comply with that feature, starting with Stefan MK who is the sole author of the UCI protocol).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
PostHypermodern

Re: Stockfish hash tables and evaluation display

Post by PostHypermodern »

lucasart wrote: You seem to misunderstand how hash tables work.

Yes, Stockfish never clears the hash table, unless 1/ you restart it (obviously) 2/ you click the "clear hash" button.

But that's not the point. A lot of engines clear the hash before every newgame. But I don't think any engine would clear the hash table after a move is played: that would be completely retarded.

If you want a good engine for analysis, Stockfish, Critter and IvanHoe are certainly the best choices in the non commercial category. They all have about equal elo, but Critter is arguable above the crowd when it comes to tactical test suites.
In the book I mentioned, the author stated that engines used to clear the hash after every move. Perhaps this is just an antiquated method.

And yes, I don't have much knowledge on hash tables or programming in general. :(

Thanks for the engine recommendations
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Stockfish hash tables and evaluation display

Post by tpetzke »

if only because closed source engine authors won't comply with that feature, starting with Stefan MK who is the sole author of the UCI protocol
Fear leads to anger, anger leads to hate, hate leads to suffering.
Yoda