To analysis.sesse.net owner : disable contempt

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

Moderators: hgm, Rebel, chrisw

BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

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

Post by BeyondCritics »

syzygy wrote: Sun Dec 02, 2018 2:26 pm
BeyondCritics wrote: Sun Dec 02, 2018 1:45 pm
The explanation for the wiggling is very simple: if white is to move at the root, white is given a contempt bonus (and, equivalently, black is given a contempt penalty) throughout the tree, so white's score is too high. If black is to move at the root, black is given a contempt bonus (and, equivalently, white is given a contempt penalty) throughout the tree, so black's score is too high (white's score is too low).
...
So if contempt is +0.20 and the objective score is about +1.00 for white, you'll see about +1.20 if white is to move at the root and about +0.80 if black is to move at the root. Each time Carlsen or Caruana plays a move, the side to move at the root switches and the score wiggles.
This is all wrong and you haven't understood contempt correctly.
This is an approximation, which is why I wrote "about".

If white is to move at the root, all scores throughout the tree are increased for white by "about" the contempt value. Therefore, the reported score is skewed in white's favour by "about" the contempt value.

If black is to move at the root, the same applies with colors reversed. So the reported score is skewed in black's favour by "about" the contempt value.

This trivially explains the wiggling that is obvious for all to see.

So now please read again what I wrote. And maybe you should not assume that I don't know how this stuff works.
Sorry, i must insist on that. And you haven't written that all scores throughout the tree are increased by "about" the contempt value. You wrote, that white(black) is given a contempt bonus(penalty).
The wiggling does not occur always either.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

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

Post by zullil »

syzygy wrote: Sun Dec 02, 2018 2:26 pm
BeyondCritics wrote: Sun Dec 02, 2018 1:45 pm
The explanation for the wiggling is very simple: if white is to move at the root, white is given a contempt bonus (and, equivalently, black is given a contempt penalty) throughout the tree, so white's score is too high. If black is to move at the root, black is given a contempt bonus (and, equivalently, white is given a contempt penalty) throughout the tree, so black's score is too high (white's score is too low).
...
So if contempt is +0.20 and the objective score is about +1.00 for white, you'll see about +1.20 if white is to move at the root and about +0.80 if black is to move at the root. Each time Carlsen or Caruana plays a move, the side to move at the root switches and the score wiggles.
This is all wrong and you haven't understood contempt correctly.
This is an approximation, which is why I wrote "about".

If white is to move at the root, all scores throughout the tree are increased for white by "about" the contempt value. Therefore, the reported score is skewed in white's favour by "about" the contempt value.

If black is to move at the root, the same applies with colors reversed. So the reported score is skewed in black's favour by "about" the contempt value.

This trivially explains the wiggling that is obvious for all to see.

So now please read again what I wrote. And maybe you should not assume that I don't know how this stuff works.
Perhaps BeyondCritics is unaware that you are the author of Cfish, and that you know the Stockfish code as fully as anyone on the planet.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

BeyondCritics wrote: Sun Dec 02, 2018 3:06 pm Sorry, i must insist on that. And you haven't written that all scores throughout the tree are increased by "about" the contempt value. You wrote, that white(black) is given a contempt bonus(penalty).
The wiggling does not occur always either.
How about trying to understand what I wanted to convey?

Sure, the wiggling does not occur if the PV ends in a draw whether white or black is given the contempt bonus. But do you really not understand my explanation?

In my view there is no dishonor in admitting being mistaken.
BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

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

Post by BeyondCritics »

@zulli Isn't this just trolling? What else does say this post, as simply "Shut up!". You can get that back from me: If you can't argue constructively, please shut up and stop trolling me! Thank you in advance zulli. And note, that i have studied stockfish too very extensivly.

@syzygy
Since you try to "backpatch" your posting, i assume that you have by now understood that you have missed completely the concept of tapered eval. If so, please admit. And if not, why are you talking about a "bonus"? There is no damned bonus. There is a penalty, which increases with the endgame content of the score.
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

BeyondCritics wrote: Sun Dec 02, 2018 3:31 pm @zulli Isn't this just trolling? What else does say this post, as simply "Shut up!". You can get that back from me: If you can't argue constructively, please shut up and stop trolling me! Thank you in advance zulli. And note, that i have studied stockfish too very extensivly.
He was just pointing out that it is not necessarily productive to assume that I know nothing about what I am writing here.
@syzygy
Since you try to "backpatch" your posting, i assume that you have by now understood that you have missed completely the concept of tapered eval. If so, please admit.
Is it a bad thing to "backpatch" my posting to clarify a thing that apparently confused you? My backpatched posting should now be clear. Can't we just go on with the actual discussion?

The actual discussion is not about tapered contempt but about why SF's default contempt settings inherently lead to wiggling scores during analysis, namely when the side to move switches (and about why the fact that "it works in testing" has nothing to do with this because the wiggling simply does not happen in test matches).
And if not, why are you talking about a "bonus"? There is no damned bonus. There is a penalty, which increases with the endgame content of the score.
The contempt setting works out as a bonus for white if white is to move at the root and as a bonus for black if black is to move at the root. Bonus for white means penalty for black. What is the problem?
BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

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

Post by BeyondCritics »

syzygy wrote: Sun Dec 02, 2018 3:54 pm The contempt setting works out as a bonus for white if white is to move at the root and as a bonus for black if black is to move at the root. ...
Sorry what? What a bonus is this, when a get a penalty as white, simply because i am going into simplifactions? Please explain!
syzygy
Posts: 5557
Joined: Tue Feb 28, 2012 11:56 pm

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

Post by syzygy »

BeyondCritics wrote: Sun Dec 02, 2018 3:58 pm
syzygy wrote: Sun Dec 02, 2018 3:54 pm The contempt setting works out as a bonus for white if white is to move at the root and as a bonus for black if black is to move at the root. ...
Sorry what? What a bonus is this, when a get a penalty as white, simply because i am going into simplifactions? Please explain!
https://github.com/official-stockfish/S ... e.cpp#L816

Code: Select all

    Score score = pos.psq_score() + me->imbalance() + pos.this_thread()->contempt;
If it is positive and added to the score, I call it a bonus.

The bonus becomes smaller towards the endgame.

SF's contempt implementation awards white a bonus for not drawing, the bonus becoming smaller as material disappears from the board. That is, if white is to move at the root. If black is to move at the root, it is black that gets the bonus. Hence the wiggling.
BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

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

Post by BeyondCritics »

syzygy wrote: Sun Dec 02, 2018 4:00 pm
BeyondCritics wrote: Sun Dec 02, 2018 3:58 pm
syzygy wrote: Sun Dec 02, 2018 3:54 pm The contempt setting works out as a bonus for white if white is to move at the root and as a bonus for black if black is to move at the root. ...
Sorry what? What a bonus is this, when a get a penalty as white, simply because i am going into simplifactions? Please explain!
https://github.com/official-stockfish/S ... e.cpp#L816

Code: Select all

    Score score = pos.psq_score() + me->imbalance() + pos.this_thread()->contempt;
If it is positive and added to the score, I call it a bonus.

The bonus becomes smaller towards the endgame.

SF's contempt implementation awards white a bonus for not drawing, the bonus becoming smaller as material disappears from the board. That is, if white is to move at the root. If black is to move at the root, it is black that gets the bonus. Hence the wiggling.
Good, you are describing the basic mechanism correctly now. But there is is still a problem: If contempt=white, white always gets the penalty for simplifications. This does not depend on the move rights at the root. And there is no wiggling in this case. Wiggling occurs, if "contempt=both" is set. This you may call problematic or "wrong", if you like.
In any case you should not simply subtract contempt at the root, this makes no real sense.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

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

Post by zullil »

BeyondCritics wrote: Sun Dec 02, 2018 3:31 pm @zulli Isn't this just trolling? What else does say this post, as simply "Shut up!". You can get that back from me: If you can't argue constructively, please shut up and stop trolling me! Thank you in advance zulli. And note, that i have studied stockfish too very extensivly.
It was a well-meaning attempt to temper the escalation that I feared might occur. Sorry if it came across as "trolling."

Full Disclaimer---I have an ulterior motive. I'd rather see Ronald updating Cfish than engaging in this. :)
BeyondCritics
Posts: 396
Joined: Sat May 05, 2012 2:48 pm
Full name: Oliver Roese

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

Post by BeyondCritics »

zullil wrote: Sun Dec 02, 2018 4:25 pm
BeyondCritics wrote: Sun Dec 02, 2018 3:31 pm @zulli Isn't this just trolling? What else does say this post, as simply "Shut up!". You can get that back from me: If you can't argue constructively, please shut up and stop trolling me! Thank you in advance zulli. And note, that i have studied stockfish too very extensivly.
It was a well-meaning attempt to temper the escalation that I feared might occur. Sorry if it came across as "trolling."

Full Disclaimer---I have an ulterior motive. I'd rather see Ronald updating Cfish than engaging in this. :)
This sounds more like a human talking to me. Everyone should consider following this example...