To analysis.sesse.net owner : disable contempt

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
syzygy
Posts: 4343
Joined: Tue Feb 28, 2012 10:56 pm

Re: To analysis.sesse.net owner : disable contempt

Post by syzygy » Sun Dec 02, 2018 5:02 pm

BeyondCritics wrote:
Sun Dec 02, 2018 4:58 pm
So you are referring to the next sentence.
Ok, we are now getting into surreal territory.

I was referring to the sentence immediately after the sentence you quoted. Obvious to me, apparently not obvious to you.

So you don't want to communicate. Fine with me. You have earned my contempt.

BeyondCritics
Posts: 335
Joined: Sat May 05, 2012 12:48 pm
Location: Bergheim

Re: To analysis.sesse.net owner : disable contempt

Post by BeyondCritics » Sun Dec 02, 2018 5:23 pm

syzygy wrote:
Sun Dec 02, 2018 5:02 pm
BeyondCritics wrote:
Sun Dec 02, 2018 4:58 pm
So you are referring to the next sentence.
Ok, we are now getting into surreal territory.

I was referring to the sentence immediately after the sentence you quoted. Obvious to me, apparently not obvious to you.

So you don't want to communicate. Fine with me. You have deserved my contempt.
Ok my mistake, i understand what you were referring to now.
But it still makes absolutely no sense. Just pretend for the time being, i am just analyzing a single postion. Then there is no sign switching and no wiggling issue. According to you, i am allowed to subtract the raw contempt value from the root, to get "about" the "objective" score. Many have expressed, that they believe at least something similar. Someone being aware of "tapered eval" should know, that you at most get a lower bound for the "objective" score. I think we have:

Code: Select all

"objective score" + (1/2) "contempt" <= "contempted score" <= "objective score" + "contempt"
Do you see how relevant the implementation is?

MikeB
Posts: 2720
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

Re: To analysis.sesse.net owner : disable contempt

Post by MikeB » Sun Dec 02, 2018 6:50 pm

BeyondCritics wrote:
Wed Nov 21, 2018 7:12 pm
Please can you explain, why setting "Contempt=Both" is so unbearable in analysis mode?
At the very least it relieves us from useless 3-fold repetitions in the pv, which were really a plague, as you might recall.
You can't use it in analysis mode when playing moves back and forth, it pollutes the hash table and it takes much longer to get an accurate score. This is because with "Both" on , the score is different from the white POV as compared to the black POV . You like "Both", that's fine, different strokes for different folks, but for many of us, for the way we use the engine, it's totally useless.

BeyondCritics
Posts: 335
Joined: Sat May 05, 2012 12:48 pm
Location: Bergheim

Re: To analysis.sesse.net owner : disable contempt

Post by BeyondCritics » Sun Dec 02, 2018 6:56 pm

MikeB wrote:
Sun Dec 02, 2018 6:50 pm
BeyondCritics wrote:
Wed Nov 21, 2018 7:12 pm
Please can you explain, why setting "Contempt=Both" is so unbearable in analysis mode?
At the very least it relieves us from useless 3-fold repetitions in the pv, which were really a plague, as you might recall.
You can't use it in analysis mode when playing moves back and forth, it pollutes the hash table and it takes much longer to get an accurate score. This is because with "Both" on , the score is different from the white POV as compared to the black POV . You like "Both", that's fine, different strokes for different folks, but for many of us, for the way we use the engine, it's totally useless.
I fully agree, it pollutes the hash table and this is likely _the_ serious issue with it. At the time i wrotes this, i wasn't really into the source code, so i just asked.

Dann Corbit
Posts: 9055
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: To analysis.sesse.net owner : disable contempt

Post by Dann Corbit » Mon Dec 03, 2018 8:04 pm

There are two different issues at play.

Contempt causes weird scores, especially when the score is close to zero.
There is also the stockfish "sewing machine" effect, which has been partially cured, but sometimes raises it's ugly head.
So I have a setting to turn both of those things off.

This one requires further changes in the source code (which I have described elsewhere):
o["Contempt"] << Option(0, -100, 100);
Also this one:
o["Show Fail High and Fail Low"] << Option(true);
which I used to default to false, but I have turned it back on because it is much more rare today, due to a fix a while back in SF.

I would switch to CFish exclusively, but the logging in CFish is dead code that no longer works and I need the logging for what I like to do.
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.

JohnS
Posts: 107
Joined: Sun Feb 24, 2008 1:08 am

Re: To analysis.sesse.net owner : disable contempt

Post by JohnS » Wed Dec 05, 2018 2:17 am

Dann Corbit wrote:
Mon Dec 03, 2018 8:04 pm
There are two different issues at play.

Contempt causes weird scores, especially when the score is close to zero.
There is also the stockfish "sewing machine" effect, which has been partially cured, but sometimes raises it's ugly head.
So I have a setting to turn both of those things off.

This one requires further changes in the source code (which I have described elsewhere):
o["Contempt"] << Option(0, -100, 100);
Also this one:
o["Show Fail High and Fail Low"] << Option(true);
which I used to default to false, but I have turned it back on because it is much more rare today, due to a fix a while back in SF.

I would switch to CFish exclusively, but the logging in CFish is dead code that no longer works and I need the logging for what I like to do.
Dann

Are you saying that setting Contempt=0 and Analysis Contempt=Off in Stockfish10 is not enough to produce neutral scores (no white/black bias) in analysis mode?

Thanks.

Dann Corbit
Posts: 9055
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: To analysis.sesse.net owner : disable contempt

Post by Dann Corbit » Wed Dec 05, 2018 7:16 pm

JohnS wrote:
Wed Dec 05, 2018 2:17 am
Dann Corbit wrote:
Mon Dec 03, 2018 8:04 pm
There are two different issues at play.

Contempt causes weird scores, especially when the score is close to zero.
There is also the stockfish "sewing machine" effect, which has been partially cured, but sometimes raises it's ugly head.
So I have a setting to turn both of those things off.

This one requires further changes in the source code (which I have described elsewhere):
o["Contempt"] << Option(0, -100, 100);
Also this one:
o["Show Fail High and Fail Low"] << Option(true);
which I used to default to false, but I have turned it back on because it is much more rare today, due to a fix a while back in SF.

I would switch to CFish exclusively, but the logging in CFish is dead code that no longer works and I need the logging for what I like to do.
Dann

Are you saying that setting Contempt=0 and Analysis Contempt=Off in Stockfish10 is not enough to produce neutral scores (no white/black bias) in analysis mode?

Thanks.
Yes.
I have a third setting also in UCI, and you have to make code changes as well.
There is also this one:
o["Dynamic Contempt"] << Option(false);

Code dealing with setting up contempt is here:

Code: Select all

    int ct = int(Options["Contempt"]) * PawnValueEg / 100; // From centipawns

    // In analysis mode, adjust contempt in accordance with user preference
    if (Limits.infinite || Options["UCI_AnalyseMode"])
        ct =  Options["Analysis Contempt"] == "Off"  ? 0
              : Options["Analysis Contempt"] == "Both" ? ct
              : Options["Analysis Contempt"] == "White" && us == BLACK ? -ct
              : Options["Analysis Contempt"] == "Black" && us == WHITE ? -ct
              : ct;

    // In evaluate.cpp the evaluation is from the white point of view
    contempt = (us == WHITE ?  make_score(ct, ct / 2)
                : -make_score(ct, ct / 2));
And more importantly here, where a change to the existing code must be made:

Code: Select all

                // Adjust contempt based on root move's previousScore (dynamic contempt)
                int dct;
                if (Options["Dynamic Contempt"] == false)
                {
                    dct = 0;
                    contempt = Score(0);
                }
                else
                {
                    dct = ct + 88 * previousScore / (abs(previousScore) + 200);
                    contempt = (us == WHITE ?  make_score(dct, dct / 2)
                                : -make_score(dct, dct / 2));
                }
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.

Post Reply