Pretty good, pretty , prittty, pritttty good...

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

Moderators: hgm, Rebel, chrisw

mroh
Posts: 29
Joined: Thu Nov 02, 2017 6:51 am
Location: Germany

Re: Pretty good, pretty , prittty, pritttty good...

Post by mroh »

Eelco de Groot wrote:But contempt = 20 was committed 5 days go already Ulysses? Or do you want to set it even higher? The discussion is just if it should be switched off for Analysis in this Don't use the contempt setting in the analysis mode #1369
Wow, I just read that thread... They talked about making different hashentries, loosing elo or even checked if cutechess sets UCI_AnalyseMode... wtf? How to analyze at all in cutechess?

syzygy hits the nail there and I really hope they set contempt=0, because one cant analyze a position at all with anything other. You cant compare evals , hash gets polluted, eval might be not symmetric etc,pp...
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Pretty good, pretty , prittty, pritttty good...

Post by Ovyron »

mroh wrote:I really hope they set contempt=0, because one cant analyze a position at all with anything other. You cant compare evals , hash gets polluted, eval might be not symmetric etc,pp...
Have they discussed implementing some "White Contempt" checkbox copying Komodo's behavior? So that it's automatically off for analysis and it's only used if you check this box, but uses negative contempt for the black side automatically, with the user being expected to create some "Black Stockfish" instance on their GUI with negative contempt and the box checked (which would reverse the contempt setting for the white side), for analyzing with the black side?

It's interesting that this problem was found by the Komodo team years ago, and they couldn't fin a better solution.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Pretty good, pretty , prittty, pritttty good...

Post by MikeB »

Ovyron wrote:
mroh wrote:I really hope they set contempt=0, because one cant analyze a position at all with anything other. You cant compare evals , hash gets polluted, eval might be not symmetric etc,pp...
Have they discussed implementing some "White Contempt" checkbox copying Komodo's behavior? So that it's automatically off for analysis and it's only used if you check this box, but uses negative contempt for the black side automatically, with the user being expected to create some "Black Stockfish" instance on their GUI with negative contempt and the box checked (which would reverse the contempt setting for the white side), for analyzing with the black side?

It's interesting that this problem was found by the Komodo team years ago, and they couldn't fin a better solution.
They have never focused on it and their default of zero was fine for most people previously. Now the default contempt is 20 because after extensive testing , it was found to be worth a few ELO. It's a good discussion, but I can deal with it no matter what they decide so I'm not overly concerned.
mroh
Posts: 29
Joined: Thu Nov 02, 2017 6:51 am
Location: Germany

Re: Pretty good, pretty , prittty, pritttty good...

Post by mroh »

I dont get the Contempt handling of sf9, it seems to be too asymetric with Contempt=0 :

Code: Select all

./stockfish
Stockfish 9 64 POPCNT by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
setoption name Contempt value 0
setoption name Threads value 10
setoption name Hash value 4096
go depth 30
...
info depth 30 seldepth 36 multipv 1 score cp 18 nodes 640649243 nps 11434243 hashfull 847 tbhits 0 time 56029 pv d2d4 g8f6 g1f3 e7e6 c1f4 d7d5 e2e3 f8d6 b1d2 e8g8 f1d3 c7c5 d4c5 d6c5 e1g1 b8c6 a2a3 c5d6 f4d6 d8d6 c2c4 c8d7 c4d5 e6d5 a1c1 a8c8 d2b3 f8e8 h2h3 b7b6 b3d4 c6d4 f3d4 c8c1 d1c1
bestmove d2d4 ponder g8f6
position startpos move d2d4
go depth 30
...
info depth 30 seldepth 43 multipv 1 score cp -30 nodes 1057839816 nps 11161002 hashfull 973 tbhits 0 time 94780 pv g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 f8b4 c1d2 b4d2 d1d2 c8a6 b2b3 d7d5 f1g2 e8g8 b1c3 d8d6 e1g1 b8c6 c3b5 a6b5 c4b5 c6e7 f3e5 c7c5 b5c6 e7c6 d2b2 f8e8 f1c1 c6e7 c1c2 a8c8 a1c1 f6d7 e2e4 c8c2 c1c2 d7f6 e4d5
bestmove g8f6 ponder c2c4
position startpos move d2d4 g8f6
go depth 30
...
info depth 30 seldepth 39 multipv 1 score cp 27 nodes 265124024 nps 11317028 hashfull 471 tbhits 0 time 23427 pv c2c4 e7e6 g1f3 d7d5 b1c3 c7c6 e2e3 b8d7 f1d3 d5c4 d3c4 b7b5 c4e2 f8e7 e1g1 e8g8 a2a3 c8b7 e3e4 c6c5 e4e5 f6d5 e2b5 c5d4 d1d4 d5c3 b2c3 d7c5 f1d1 d8b6 c3c4 b7f3 g2f3
bestmove c2c4 ponder e7e6
It goes from 18, -30, 27 with contempt=0
and this goes on for every black move...

To me, it looks like, they have some kind of implicit contempt for black all the time or am I doing something wrong?

Can anyone confirm this?

(In this state, its not usable at all for analysis...)

(for default Contempt=20 the delta for the black moves are smaller(?): 41,3,22 I dont care, as I will never use Contempt, but this also smells wrong ^^ )
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Pretty good, pretty , prittty, pritttty good...

Post by Ovyron »

mroh wrote:(In this state, its not usable at all for analysis...)
Sure is. As I said before, just use two different instances of SF, one for the white side, and one for the black side, and only backsolve white scores for the white side, and black scores for the black side.

I had found about this independently with Komodo Contempt, where you'd use different engines for the sides, and with a contempt of 100, of course you don't backsolve the -1.00 scores with the 1.00 scores. Komodo with Contempt ON for white would prefer the white side, and with Contempt on for black will prefer the black side, up to 1.20 vs -1.20 scores...

So now I have positions that I'd like to play with both white, and black, as they have good winning chances, while before, if it was good for white, then I'd avoid it as black, but this is clearly a mistake. What you want is to avoid drawish positions, regardless of your own color!

I think this is a new paradigm shift, and I wonder if this will separate those that can grasp the concept (positions being favorable for both sides, and positions being unfavorable for both sides.)

I love this, and live for these things. Though it may be hard to wrap your head around this, if you're too used to the "one side has the advantage and the other is best avoiding this position", obsolete way of thinking.
User avatar
Eelco de Groot
Posts: 4564
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Pretty good, pretty , prittty, pritttty good...

Post by Eelco de Groot »

mroh wrote:I dont get the Contempt handling of sf9, it seems to be too asymetric with Contempt=0 :

Code: Select all

./stockfish
Stockfish 9 64 POPCNT by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
setoption name Contempt value 0
setoption name Threads value 10
setoption name Hash value 4096
go depth 30
...
info depth 30 seldepth 36 multipv 1 score cp 18 nodes 640649243 nps 11434243 hashfull 847 tbhits 0 time 56029 pv d2d4 g8f6 g1f3 e7e6 c1f4 d7d5 e2e3 f8d6 b1d2 e8g8 f1d3 c7c5 d4c5 d6c5 e1g1 b8c6 a2a3 c5d6 f4d6 d8d6 c2c4 c8d7 c4d5 e6d5 a1c1 a8c8 d2b3 f8e8 h2h3 b7b6 b3d4 c6d4 f3d4 c8c1 d1c1
bestmove d2d4 ponder g8f6
position startpos move d2d4
go depth 30
...
info depth 30 seldepth 43 multipv 1 score cp -30 nodes 1057839816 nps 11161002 hashfull 973 tbhits 0 time 94780 pv g8f6 c2c4 e7e6 g1f3 b7b6 g2g3 f8b4 c1d2 b4d2 d1d2 c8a6 b2b3 d7d5 f1g2 e8g8 b1c3 d8d6 e1g1 b8c6 c3b5 a6b5 c4b5 c6e7 f3e5 c7c5 b5c6 e7c6 d2b2 f8e8 f1c1 c6e7 c1c2 a8c8 a1c1 f6d7 e2e4 c8c2 c1c2 d7f6 e4d5
bestmove g8f6 ponder c2c4
position startpos move d2d4 g8f6
go depth 30
...
info depth 30 seldepth 39 multipv 1 score cp 27 nodes 265124024 nps 11317028 hashfull 471 tbhits 0 time 23427 pv c2c4 e7e6 g1f3 d7d5 b1c3 c7c6 e2e3 b8d7 f1d3 d5c4 d3c4 b7b5 c4e2 f8e7 e1g1 e8g8 a2a3 c8b7 e3e4 c6c5 e4e5 f6d5 e2b5 c5d4 d1d4 d5c3 b2c3 d7c5 f1d1 d8b6 c3c4 b7f3 g2f3
bestmove c2c4 ponder e7e6
It goes from 18, -30, 27 with contempt=0
and this goes on for every black move...

To me, it looks like, they have some kind of implicit contempt for black all the time or am I doing something wrong?

Can anyone confirm this?

(In this state, its not usable at all for analysis...)

(for default Contempt=20 the delta for the black moves are smaller(?): 41,3,22 I dont care, as I will never use Contempt, but this also smells wrong ^^ )
From the output you have given I deduce that contempt is set to zero so Stockfish is not using any contempt at all. The value of 30 centipawns for Black is -30 for White is normal with Black at the Root of the search. That it goes up and down a bit is just sideffects of searching with only one position at the Root That is why you should not pay too much attention to scores around zero. Essentially Stockfish saying "This looks like a total draw to me". What value to give to such a score, literally I mean? Only the moves matter here.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
Eelco de Groot
Posts: 4564
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: Pretty good, pretty , prittty, pritttty good...

Post by Eelco de Groot »

Eelco de Groot wrote: Only the moves matter here.
What I meant with that is that if you look at the way Stockfish' search decides what final score is propagated back to the Root, it is like trying to get a picture of the world with an opaque mask that has several thousand pinholes in it, in random places, through which you can see tiny patches of what is around you. In the last few plies, enormous numbers of possible replies are being thrown out of the window without search ever looking at them. Those last plies are mostly captures wth just a few random quiet moves thrown in, if time allows. Extremely selective. This is where Monte Carlo search becomes interesting, because it has less bias. If your eval function (or search itself) has bias, search has to do an enormous effort to correct this bias. And most of the time it will not succeed.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
mroh
Posts: 29
Joined: Thu Nov 02, 2017 6:51 am
Location: Germany

Re: Pretty good, pretty , prittty, pritttty good...

Post by mroh »

I know what you mean, but the solution (one engine for every side) is far too impractical for me. (also I think, one can get the same result (good positions for both sides) with a "normal, classical approach")

Not only because of handling two different engines, but mostly because the technique of "back stepping" (dont know a better word, Im sure, you know what I mean) is not usable any more, where you propagate an eval up the tree in the hashtable of the engine, not somewhere in the gui or db etc ...

But well, just read that Ronald has implemented contempt in cfish, just tested it, and there its perfectly fine, as it should be!

So, I will use cfish as an "sf9 reference" point in my gui (Im an old school c hacker and c++ hater, so I always liked cfish very much anyway ^^)
User avatar
Ovyron
Posts: 4556
Joined: Tue Jul 03, 2007 4:30 am

Re: Pretty good, pretty , prittty, pritttty good...

Post by Ovyron »

mroh wrote:Not only because of handling two different engines, but mostly because the technique of "back stepping" (dont know a better word, Im sure, you know what I mean) is not usable any more, where you propagate an eval up the tree in the hashtable of the engine
Why doesn't this technique work anymore? You just never allow SF to look at the opposite side of what you're analyzing, "back stepping" should still work.

Anyway, glad to see CFish picked this up and offered a solution for those who want the classic paradigm :) - I just hope more people know about this and switch to CFish, so they miss out Analysis Contempt, since being able to take advantage of it looks like a great skill to develop for correspondence games :twisted:

Contempt=0 is obsolete.
mroh
Posts: 29
Joined: Thu Nov 02, 2017 6:51 am
Location: Germany

Re: Pretty good, pretty , prittty, pritttty good...

Post by mroh »

Ovyron wrote: Why doesn't this technique work anymore? You just never allow SF to look at the opposite side of what you're analyzing, "back stepping" should still work.
What do you do if the refutation of a line is a move of the opposite side? (which sounds pretty natural to me)

You cant propagate this refutation to the other side, because you cant mix the hashtables.

Or, if you are not fast enough to skip the other side, so that some evals still make its way to the wrong side? (and our friend morphy makes it so that these evals are getting important... ^^ )