program style, risk aversion

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Ajedrecista
Posts: 1969
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

My numeric method for determine draw trends of each engine.

Post by Ajedrecista »

Hello:
Ajedrecista wrote: In fact, k*µ*(1 - µ) can be µ*D/[2*(1 - µ)] or (1 - µ)*D/(2*µ) if I am not wrong. You can remove the number 2 for doing less calculations.
I was wrong... it looked suspicious to me when I wrote it (this is why I added 'if I am not wrong' because I was not totally sure) but I had not got pencil and paper with me at that moment. The correct thing is that k*µ*(1 - µ) is µ*D/2 or (1 - µ)*D/2, depending if µ > 0.5 or µ < 0.5, respectively. As I said before, the number 2 can be discarded of calculations.

I thought a little more this morning trying to simplify the calculations even more. I came up with a trick that avoids to take care if µ < 0.5 or µ > 0.5:

Code: Select all

a = 0.5 + |µ - 0.5| >= 0.5 &#40;the other option is a' = 0.5 - |µ - 0.5| =< 0.5&#41;.
a = max.&#40;µ, 1 - µ&#41;; a' = min.&#40;µ, 1 - µ&#41;.

&#40;Factor of comparison&#41; = c = a*D &#40;the other option is c' = &#40;a')*D&#41;.

One must be consistent and use c or c' with all the engines and not mix c and c'. Please note that I got rid of the number 2 because it is only a constant.
I manage to avoid thinking about µ < 0.5 or µ > 0.5 with the use of a (or a'). Of course you can use 2a, a/2, etc., but I prefer to avoid constants with the aim of simplifying the calculations. I think that this way (where the arbitrary factor µ*(1 - µ) is included) is very simple to calculate, avoiding all the intermediate results that were useful for explaining my proposal:

Code: Select all

µ_i&#58; score of the i-th engine.
D_i&#58; draw ratio of the i-th engine.

c_i = &#40;0.5 + |µ_i - 0.5|)*D_i
&#40;c')_i = &#40;0.5 - |µ_i - 0.5|)*D_i

Do not forget to use only c_i or &#40;c')_i and avoid to calculate some c_i and some &#40;c')_i in the same Round Robin tournament.
Again, do not mix c_i and &#40;c')_i in comparisons between different Round Robin tournaments.
My method could not work very well but at least is fast and could give a rough idea. I hope no typos in this post.

Regards from Spain.

Ajedrecista.
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: program style, risk aversion

Post by Laskos »

Don wrote:
Laskos wrote:I don't know if this was mentioned, isn't the draw rate related to contempt too?
Yes, it would have an impact.

The contempt factors in my study are zero for Komodo, zero for stockfish and the default for Houdini 3 which I think is -1. That should have virtually no impact on the results.

However if you wish you can view the results as an upper bound on how eager it is to avoid a draw. With zero it would be more willing to accept a draw and thus more like Stockfish in this regard so if anything Houdini's draw fear is over-stated.

It terms of playing style I don't know what increased lose rate really means compared to the other programs. It goes from 59 to 62 percent decisive games for Houdini over the other 2 and I don't know if that is a lot or a little. I really which I had the resources to test a variety of programs (not a bunch of ippolits, but different real families.) I could have added strelka, robbo, ivanhoe but that would be like adding komodo 3, komodo 4 and so on. I tried to add splke but it was going to require very heavy time odds which would have increased the run time dramatically. The other top programs are commercial or too low rated or I cannot get them working on Linux.
Could you try to set contempt 0 in Houdini 3? Maybe that's the main reason of its lower draw rate?

My artistic impression was that risk-takers were for example Junior 8 or Fritz 8, then all programs which were heavily influenced by Fruit/Rybka were more of solid style. But maybe it's just an impression.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: program style, risk aversion

Post by Don »

Laskos wrote:
Don wrote:
Laskos wrote:I don't know if this was mentioned, isn't the draw rate related to contempt too?
Yes, it would have an impact.

The contempt factors in my study are zero for Komodo, zero for stockfish and the default for Houdini 3 which I think is -1. That should have virtually no impact on the results.

However if you wish you can view the results as an upper bound on how eager it is to avoid a draw. With zero it would be more willing to accept a draw and thus more like Stockfish in this regard so if anything Houdini's draw fear is over-stated.

It terms of playing style I don't know what increased lose rate really means compared to the other programs. It goes from 59 to 62 percent decisive games for Houdini over the other 2 and I don't know if that is a lot or a little. I really which I had the resources to test a variety of programs (not a bunch of ippolits, but different real families.) I could have added strelka, robbo, ivanhoe but that would be like adding komodo 3, komodo 4 and so on. I tried to add splke but it was going to require very heavy time odds which would have increased the run time dramatically. The other top programs are commercial or too low rated or I cannot get them working on Linux.
Could you try to set contempt 0 in Houdini 3? Maybe that's the main reason of its lower draw rate?

My artistic impression was that risk-takers were for example Junior 8 or Fritz 8, then all programs which were heavily influenced by Fruit/Rybka were more of solid style. But maybe it's just an impression.
I doubt that 1 point has any impact, I have checked such things out myself in Komodo. But I regret not setting it right from the start, I don't know what I was thinking. I knew this would come up but I was expecting Uly to be the one to bring it up.

I'm going to make a very slight adjustment anyway in the time controls so I will go ahead and set this from now on.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: program style, risk aversion

Post by Laskos »

Don wrote:
Laskos wrote:
Don wrote:
Laskos wrote:I don't know if this was mentioned, isn't the draw rate related to contempt too?
Yes, it would have an impact.

The contempt factors in my study are zero for Komodo, zero for stockfish and the default for Houdini 3 which I think is -1. That should have virtually no impact on the results.

However if you wish you can view the results as an upper bound on how eager it is to avoid a draw. With zero it would be more willing to accept a draw and thus more like Stockfish in this regard so if anything Houdini's draw fear is over-stated.

It terms of playing style I don't know what increased lose rate really means compared to the other programs. It goes from 59 to 62 percent decisive games for Houdini over the other 2 and I don't know if that is a lot or a little. I really which I had the resources to test a variety of programs (not a bunch of ippolits, but different real families.) I could have added strelka, robbo, ivanhoe but that would be like adding komodo 3, komodo 4 and so on. I tried to add splke but it was going to require very heavy time odds which would have increased the run time dramatically. The other top programs are commercial or too low rated or I cannot get them working on Linux.
Could you try to set contempt 0 in Houdini 3? Maybe that's the main reason of its lower draw rate?

My artistic impression was that risk-takers were for example Junior 8 or Fritz 8, then all programs which were heavily influenced by Fruit/Rybka were more of solid style. But maybe it's just an impression.
I doubt that 1 point has any impact, I have checked such things out myself in Komodo. But I regret not setting it right from the start, I don't know what I was thinking. I knew this would come up but I was expecting Uly to be the one to bring it up.

I'm going to make a very slight adjustment anyway in the time controls so I will go ahead and set this from now on.
Isn't contempt in Houdini 3 like "1=moderate", "2=high", "0=no contempt"? So 1 is not a centipawn, and could mean much more and something different from just cp.
User avatar
rvida
Posts: 481
Joined: Thu Apr 16, 2009 12:00 pm
Location: Slovakia, EU

Re: program style, risk aversion

Post by rvida »

Don wrote: I doubt that 1 point has any impact
Contempt=1 does not mean draw score of 1 point. It is actually 6 to 20 points, depending on game phase (measured at root).

Setting contempt=2 does same as contempt=1 plus adds some king safety asymmetry.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: program style, risk aversion

Post by Don »

Laskos wrote:
Don wrote:
Laskos wrote:I don't know if this was mentioned, isn't the draw rate related to contempt too?
Yes, it would have an impact.

The contempt factors in my study are zero for Komodo, zero for stockfish and the default for Houdini 3 which I think is -1. That should have virtually no impact on the results.

However if you wish you can view the results as an upper bound on how eager it is to avoid a draw. With zero it would be more willing to accept a draw and thus more like Stockfish in this regard so if anything Houdini's draw fear is over-stated.

It terms of playing style I don't know what increased lose rate really means compared to the other programs. It goes from 59 to 62 percent decisive games for Houdini over the other 2 and I don't know if that is a lot or a little. I really which I had the resources to test a variety of programs (not a bunch of ippolits, but different real families.) I could have added strelka, robbo, ivanhoe but that would be like adding komodo 3, komodo 4 and so on. I tried to add splke but it was going to require very heavy time odds which would have increased the run time dramatically. The other top programs are commercial or too low rated or I cannot get them working on Linux.
Could you try to set contempt 0 in Houdini 3? Maybe that's the main reason of its lower draw rate?
Actually, I misunderstood the contempt term in Houdini, even when you set the contempt factor to zero by default it has a high contempt.

So it may be the case that Houdini does not really play for the win any more than other programs if their contempt is set the same. I can figure that out by setting Komodo's contempt factor higher to see what impact it has on the draw rates.

Houdini has only 3 Contempt settings. I tried to reverse engineer the values by putting in a position where Houdini would be compelled to go for a draw by repetition. It turns out that 2 had no impact on the score at all even though Houdini was compelled to play for the draw. The contempt for a draw appeared to be -13 if you set it to zero and -21 if you set it to 1 and -21 if you set it to 2. It's probably not that simple however. In Komodo the contempt is scaled by the stage of the game and I think something like that (or something else) is going on here. I could figure it out if I kept at it but this is not interesting to me.

My artistic impression was that risk-takers were for example Junior 8 or Fritz 8, then all programs which were heavily influenced by Fruit/Rybka were more of solid style. But maybe it's just an impression.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: program style, risk aversion

Post by Don »

rvida wrote:
Don wrote: I doubt that 1 point has any impact
Contempt=1 does not mean draw score of 1 point. It is actually 6 to 20 points, depending on game phase (measured at root).

Setting contempt=2 does same as contempt=1 plus adds some king safety asymmetry.
Yes, I had forgotten that. Larry reverse engineered this a while back and told me what the numbers were but I had simply forgotten. I didn't know about the king safety asymmetry but I spend a few minutes reverse engineering it too and discovered that something else must have been going on in addition to different contempt values.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: My numeric method for determine draw trends of each engi

Post by Don »

I decided to build the formula into my cross-table pipe filter. This way I can try other time controls (without adjustments) and see if the value make some sense. Perhaps at the least it will allow me to run these without having to get exact parity with the adjustments. I am also pretty sure I can make minor level adjustments on the fly but I resist doing that since it is harder to document what I did.

Note the column "Risk Style" where lower numbers presumably mean riskier play. I probably need a better label for that.

Code: Select all

Rank    ELO     +/-    Games    Score  Player
---- ------- ------ -------- --------  ----------------------------
   1  3005.2   11.2     2379   50.736  sf23         
   2  3000.3   11.2     2380   49.664  kdev-4518.00 
   3  3000.0   11.2     2379   49.601  hou3         

w/l/d&#58; 1250 922 1397    39.14 percent draws


 Percent   Percent   Percent   Percent      Risk 
Decisive      Wins    Losses     Draws     Style  Player
--------  --------  --------  --------  --------  -------------------
   62.79     31.00     31.79     37.21   0.18754  hou3
   60.48     31.00     29.48     39.52   0.20059  sf23
   59.32     29.30     30.02     40.68   0.20485  kdev-4518.00
Ajedrecista wrote:Hello:
Ajedrecista wrote: In fact, k*µ*(1 - µ) can be µ*D/[2*(1 - µ)] or (1 - µ)*D/(2*µ) if I am not wrong. You can remove the number 2 for doing less calculations.
I was wrong... it looked suspicious to me when I wrote it (this is why I added 'if I am not wrong' because I was not totally sure) but I had not got pencil and paper with me at that moment. The correct thing is that k*µ*(1 - µ) is µ*D/2 or (1 - µ)*D/2, depending if µ > 0.5 or µ < 0.5, respectively. As I said before, the number 2 can be discarded of calculations.

I thought a little more this morning trying to simplify the calculations even more. I came up with a trick that avoids to take care if µ < 0.5 or µ > 0.5:

Code: Select all

a = 0.5 + |µ - 0.5| >= 0.5 &#40;the other option is a' = 0.5 - |µ - 0.5| =< 0.5&#41;.
a = max.&#40;µ, 1 - µ&#41;; a' = min.&#40;µ, 1 - µ&#41;.

&#40;Factor of comparison&#41; = c = a*D &#40;the other option is c' = &#40;a')*D&#41;.

One must be consistent and use c or c' with all the engines and not mix c and c'. Please note that I got rid of the number 2 because it is only a constant.
I manage to avoid thinking about µ < 0.5 or µ > 0.5 with the use of a (or a'). Of course you can use 2a, a/2, etc., but I prefer to avoid constants with the aim of simplifying the calculations. I think that this way (where the arbitrary factor µ*(1 - µ) is included) is very simple to calculate, avoiding all the intermediate results that were useful for explaining my proposal:

Code: Select all

µ_i&#58; score of the i-th engine.
D_i&#58; draw ratio of the i-th engine.

c_i = &#40;0.5 + |µ_i - 0.5|)*D_i
&#40;c')_i = &#40;0.5 - |µ_i - 0.5|)*D_i

Do not forget to use only c_i or &#40;c')_i and avoid to calculate some c_i and some &#40;c')_i in the same Round Robin tournament.
Again, do not mix c_i and &#40;c')_i in comparisons between different Round Robin tournaments.
My method could not work very well but at least is fast and could give a rough idea. I hope no typos in this post.

Regards from Spain.

Ajedrecista.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: My numeric method for determine draw trends of each engi

Post by Don »

I'm trying a test where Houdini is handicapped to the point that it is clearly weaker, then I will try the opposite - idea is to see if the numbers are roughly equivalent.

Don
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: My numeric method for determine draw trends of each engi

Post by Don »

Don wrote:I'm trying a test where Houdini is handicapped to the point that it is clearly weaker, then I will try the opposite - idea is to see if the numbers are roughly equivalent.

Don
Clarification: The idea is to see if the numbers produced by the formula Jesús proposes makes any sense.
Capital punishment would be more effective as a preventive measure if it were administered prior to the crime.