Stockfish Code ( Piece Value's)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Stockfish Code ( Piece Value's)

Post by Sven »

lucasart wrote:
NJDenson wrote:I believe the values are not correct
... and what's your supporting evidence ?

believe me marco and joona aren't amateurs, and didn't choose them randomly. they did some very expensive CLOP optimization of piece values and PST.

if you can get a significant elo gain by making your random modifications, i can't wait to see it. but i seriously doubt it...
Hi Lucas,

why not letting him try whether different values give an improvement? Since the piece values have not changed for years I am not sure whether these were actually part of that CLOP optimization you are talking about.

I have the same feeling as you that the current SF values might be very good, but trying to find improvements is not a bad thing ... Nolan wrote he believes some values are not optimal, not they aren't.

Sven
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Stockfish Code ( Piece Value's)

Post by lucasart »

Sven Schüle wrote:
lucasart wrote:
NJDenson wrote:I believe the values are not correct
... and what's your supporting evidence ?

believe me marco and joona aren't amateurs, and didn't choose them randomly. they did some very expensive CLOP optimization of piece values and PST.

if you can get a significant elo gain by making your random modifications, i can't wait to see it. but i seriously doubt it...
Hi Lucas,

why not letting him try whether different values give an improvement? Since the piece values have not changed for years I am not sure whether these were actually part of that CLOP optimization you are talking about.

I have the same feeling as you that the current SF values might be very good, but trying to find improvements is not a bad thing ... Nolan wrote he believes some values are not optimal, not they aren't.

Sven
I guess we'll see :D
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Stockfish Code ( Piece Value's)

Post by zamar »

lucasart wrote:
NJDenson wrote:I believe the values are not correct
... and what's your supporting evidence ?

believe me marco and joona aren't amateurs, and didn't choose them randomly. they did some very expensive CLOP optimization of piece values and PST.

if you can get a significant elo gain by making your random modifications, i can't wait to see it. but i seriously doubt it...
1. You are right that those values are tuned and that it's very difficult to improve them.

2. But Marco & I are computer chess amateurs. We are not professionals and probably never going to be.

3. We didn't use CLOP, but a Stochastic method to tune the most SF constants.
Joona Kiiski
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Stockfish Code ( Piece Value's)

Post by Sven »

zamar wrote:1. You are right that those values are tuned and that it's very difficult to improve them.

2. But Marco & I are computer chess amateurs. We are not professionals and probably never going to be.

3. We didn't use CLOP, but a Stochastic method to tune the most SF constants.
But were those piece values which are now in "types.h" also included in the tuning process? I have checked all older SF sources I have on my harddisk, and all 10 piece values are unchanged since SF1.6, so would that mean that tuning occurred already prior to version 1.6?

In an old Glaurung version from 2007 I found these values in "value.h", so there was at least some change since then:

Code: Select all

const Value PawnValueMidgame = Value(0xCC);
const Value PawnValueEndgame = Value(0x100);
const Value KnightValueMidgame = Value(0x340);
const Value KnightValueEndgame = Value(0x340);
const Value BishopValueMidgame = Value(0x340);
const Value BishopValueEndgame = Value(0x340);
const Value RookValueMidgame = Value(0x505);
const Value RookValueEndgame = Value(0x505);
const Value QueenValueMidgame = Value(0xA00);
const Value QueenValueEndgame = Value(0xA00);
Sven
zamar
Posts: 613
Joined: Sun Jan 18, 2009 7:03 am

Re: Stockfish Code ( Piece Value's)

Post by zamar »

Sven Schüle wrote:
zamar wrote:1. You are right that those values are tuned and that it's very difficult to improve them.

2. But Marco & I are computer chess amateurs. We are not professionals and probably never going to be.

3. We didn't use CLOP, but a Stochastic method to tune the most SF constants.
But were those piece values which are now in "types.h" also included in the tuning process? I have checked all older SF sources I have on my harddisk, and all 10 piece values are unchanged since SF1.6, so would that mean that tuning occurred already prior to version 1.6?

In an old Glaurung version from 2007 I found these values in "value.h", so there was at least some change since then:

Code: Select all

const Value PawnValueMidgame = Value(0xCC);
const Value PawnValueEndgame = Value(0x100);
const Value KnightValueMidgame = Value(0x340);
const Value KnightValueEndgame = Value(0x340);
const Value BishopValueMidgame = Value(0x340);
const Value BishopValueEndgame = Value(0x340);
const Value RookValueMidgame = Value(0x505);
const Value RookValueEndgame = Value(0x505);
const Value QueenValueMidgame = Value(0xA00);
const Value QueenValueEndgame = Value(0xA00);
Sven
Hi Sven! These were the first one we tuned. So it was before 1.6.
Joona Kiiski
NJDenson
Posts: 75
Joined: Tue May 23, 2006 7:01 pm

Re: Stockfish Code ( Piece Value's)

Post by NJDenson »

Well Well a unbeliever, I base my beliefs on many games I played online via playchess. I have one of the fastest system on the server and can see things in a short time control that most can't. I am not a program but like to see if I can make improvements with things many think are impossible.
Just so things dont get mixed up with the Real Stockfish (because so much has changed I am calling this prodject (CrazyChips) a stockfish clone which I am using things that stockfish team has moved on past. If I stumble across something interesting I will pass it on to stockfish team. They have done great work with the code. Never say Never. Check me out on PlayChess with Account ELSHADDAI.
NJDenson
Posts: 75
Joined: Tue May 23, 2006 7:01 pm

Re: Stockfish Code ( Piece Value's)

Post by NJDenson »

Have a game for you guys to check out evals. Win may be because of speed of system. It seems to me the end games are excellent coming from CC/SF. This clone has much more than just my piece value changes. Its a combination of the latest beta file's as well.

Houdini 2.0c Pro x6 (2680) - CrazyChips (Stockfish Clone) [B92]
Rated game, 5m Engine Room, 11.01.2012
[0.23;0.04]

Houdini 2.0c Pro x64 OVER (6 cores): 22.0 plies; 19,094kN/s Intel(R) Core(TM) i7 CPU 980 @ 3.33GHz 4404MHz, Mybook 49.ctg, 128 MB 1.e4 B/0 0 c5 B/0 0 2.Nf3 B/0 0 d6 B/0 0 3.d4 B/0 0 cxd4 B/0 0 4.Nxd4 B/0 0 Nf6 B/0 0 5.Nc3 B/0 0 a6 B/0 0 6.Be2 B/0 0 e5 B/0 0 7.Nb3 B/0 0 Be7 B/0 0 8.0-0 B/0 0 0-0 B/0 0 9.Be3 B/0 0 Be6 B/0 0 10.Qd3 B/0 0 Nbd7 B/0 0 11.Nd5 B/0 0 Bxd5 B/0 0 12.exd5 B/0 0 Rc8 B/0 0 13.Rac1 B/0 0 Ne8 B/0 0 14.Qd2 B/0 0 f5 B/0 0 15.Qb4 B/0 0 Qc7 B/0 0 16.f3 B/0 0 Nef6 B/0 0 17.Qd2 B/0 0 Nh5 B/0 0 18.Bd3 0.23/21 10 g6 (Bh4) B/0 0 19.Kh1 B/0 0 Bf6 B/0 0 20.c3 B/0 0 Bg7 B/0 0 21.Rfe1 B/0 0 Nhf6 B/0 0 22.c4 B/0 0 b6 B/0 0 23.Bf1 B/0 0 a5 0.04/24 28 24.Bg5 (Bf2) 0.08/19 6 24...Nh5 0.00/25 11 25.Qc2 (Qd1) 0.04/20 3 25...Bf6 (Nhf6) -0.44/24 16 26.Bh6 (Bd2) -0.11/21 16 26...Rf7 -0.24/26 24 27.g3 -0.13/23 0 Qd8 -0.32/25 11 28.Nd2 -0.23/21 0 Bg5 -0.40/24 8 29.Bxg5 -0.17/22 0 Qxg5 -0.44/19 0 30.Nb1 -0.15/23 10 Qh6 -0.20/23 0 31.Qg2 -0.15/22 5 f4 (Rd8) -0.28/26 1 32.g4 -0.13/23 4 Ng3+ -0.24/26 2 33.Kg1 -0.13/24 0 Nxf1 -0.24/24 0 34.Qxf1 -0.10/24 7 Nc5 -0.32/26 3 35.Nc3 -0.09/23 10 Qg5 (Qh4) -0.24/27 0 36.Rc2 -0.09/20 5 Kg7 (Re8) -0.24/25 1 37.Rd2 (Rce2) -0.08/21 7 37...Qf6 -0.24/23 10 38.Ree2 (b3) -0.08/20 7 38...Re8 (Re7) -0.40/25 15 39.Qb1 (Qf2) -0.08/22 5 39...Rfe7 -0.40/24 5 40.Ne4 -0.10/23 0 Nxe4 -0.40/23 0 41.Qxe4 (Rxe4) -0.14/22 13 41...a4 -0.48/26 8 42.Rd3 (Rc2) -0.14/22 0 42...Rc8 -0.48/25 8 43.Rc3 (Ra3) -0.14/23 0 43...Ra7 (Rec7) -0.48/27 4 44.Qd3 -0.15/22 5 Qe7 -0.48/26 7 45.Kg2 -0.16/21 0 Qg5 (Rc5) -0.44/25 12 46.Kg1 -0.18/22 6 Rc5 -0.52/24 0 47.Rf2 (Ra3) -0.19/22 16 47...Qe7 (Rb7) -0.52/24 6 48.Kg2 (Rfc2) -0.19/22 6 48...Qb7 -0.48/22 3 49.Rcc2 (Qc2) -0.23/22 11 49...Qd7 -0.60/24 12 50.Rfd2 (Qe4) -0.25/23 2 50...Rb7 -0.60/21 4 51.Qe4 (h4) -0.25/23 0 51...Qe7 (Qc7) -0.68/26 10 52.Qd3 -0.25/21 2 Qg5 (b5) -0.64/25 1 53.Kh1 (Kg1) -0.30/22 3 53...Qh4 -0.76/21 3 54.Qe4 (b4) -0.28/22 0 54...Qd8 -0.60/22 4 55.Kg2 (Rd1) -0.33/22 0 55...Qc8 (Qa8) -0.80/23 3 56.Rc3 (b4) -0.33/21 5 56...Qc7 (Qa8) -0.56/21 6 57.Qd3 (Rdc2) -0.27/21 3 57...Qd7 -0.44/22 5 58.Qc2 -0.26/23 0 Qe8 -0.44/23 5 59.Qc1 (h4) -0.27/22 1 59...Qe7 (Qd8) -0.56/19 2 60.Qd1 (b4) -0.31/20 2 60...b5 (h5) -0.68/21 1 61.cxb5 -0.26/21 4 Rcxb5 -0.72/24 0 62.Qe2 -0.37/21 3 Rb4 -1.05/23 0 63.Kf1 (Rc4) -0.50/20 8 63...e4 -1.25/21 2 64.a3 -0.50/22 0 Rb3 -1.33/23 0 65.Qxe4 (fxe4) -0.50/22 1 65...Qxe4 -1.37/10 0 66.fxe4 -0.44/23 0 Kf6 -1.73/22 0 67.Rcc2 -0.41/23 1 Ke5 -1.69/24 0 68.Kf2 (Rc8) -0.44/22 6 68...R7b6 (R7b5) -1.73/24 1 69.Re2 -0.56/22 2 g5 -1.77/26 0 70.Red2 (Kf1) -0.53/23 1 70...Kxe4 -1.93/24 1 71.Rc7 -0.53/23 0 Rb7 -2.18/24 0 72.Rc8 -0.46/24 0 Rd3 (Rf3+) -2.10/23 0 73.Re8+ -0.52/23 2 Kd4 -2.18/24 0 74.Rc2 -0.59/24 3 h5 (Rbb3) -2.18/22 0 75.gxh5 -0.90/19 2 Rh7 -2.88/22 0 76.Ra8 -0.91/21 1 Rxh5 -3.43/21 0 77.Ke1 -1.00/22 7 Rdh3 (Ke5) -3.51/25 0 78.Rd2+ -1.14/21 3 Ke5 -3.47/26 0 79.Re8+ (Rg8) -1.19/23 0 79...Kf5 -4.08/23 2 80.Rf8+ -1.46/24 7 Kg4 -3.63/27 0 81.Rg2+ -1.75/23 8 Kf3 -5.00/26 0 82.Rf2+ -2.11/21 1 Ke4 -5.01/25 0 83.Re8+ -2.11/22 3 Kd4 -4.84/28 0 84.Re6 -2.23/20 0 Rxh2 -5.01/27 0 85.Rxd6 -2.20/22 1 Rxf2 (g4) -5.33/27 0 86.Kxf2 -3.86/17 0 Rh2+ (g4) -5.37/26 0 87.Kf3 (Kf1) -2.09/19 0 87...Ke5 -5.85/23 0 88.Rd8 -2.09/23 0 Rxb2 -5.57/22 0 89.d6 -2.22/22 0 Rb3+ -6.02/26 0 90.Kf2 -2.29/23 0 g4 (Rxa3) -6.02/25 0 91.d7 -2.50/21 0 Ke6 -6.50/29 0 92.Kg1 (Kg2) -2.50/23 0 92...Rb1+ (Rxa3) -8.04/27 1 93.Kg2 -2.53/23 0 f3+ -12.40/27 0 94.Kg3 -4.08/24 4 Rg1+ -11.01/32 0 95.Kf2 -4.08/24 0 Rg2+ -12.56/27 0 96.Kf1 -4.08/24 0 g3 -7.42/24 0 97.Re8+ (Rg8) -5.39/25 2 97...Kxd7 -15.51/10 0 98.Rg8 (Rf8) -5.94/23 0 98...Ke6 (Kd6) -89.21/10 0 99.Rg5 -8.87/23 4 Kf6 -89.31/34 0 100.Rg8 -10.38/22 2 Kf5 (Ke5) -89.31/32 0 101.Rf8+ -10.42/20 0 Ke4 Mestre das Armas,Houdini 2.0c Pro x64 resigns -84.51/25 1 0-1
User avatar
natasha
Posts: 145
Joined: Tue Jan 25, 2011 3:10 pm

Re: Stockfish Code ( Piece Value's)

Post by natasha »

have you done any engine tests with your mod that you can post results of please :?:
Silent gratitude isn’t very much to anyone.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Stockfish Code ( Piece Value's)

Post by lucasart »

NJDenson wrote:Have a game for you guys to check out evals. Win may be because of speed of system. It seems to me the end games are excellent coming from CC/SF. This clone has much more than just my piece value changes. Its a combination of the latest beta file's as well.

Houdini 2.0c Pro x6 (2680) - CrazyChips (Stockfish Clone) [B92]
Rated game, 5m Engine Room, 11.01.2012
[0.23;0.04]

Houdini 2.0c Pro x64 OVER (6 cores): 22.0 plies; 19,094kN/s Intel(R) Core(TM) i7 CPU 980 @ 3.33GHz 4404MHz, Mybook 49.ctg, 128 MB 1.e4 B/0 0 c5 B/0 0 2.Nf3 B/0 0 d6 B/0 0 3.d4 B/0 0 cxd4 B/0 0 4.Nxd4 B/0 0 Nf6 B/0 0 5.Nc3 B/0 0 a6 B/0 0 6.Be2 B/0 0 e5 B/0 0 7.Nb3 B/0 0 Be7 B/0 0 8.0-0 B/0 0 0-0 B/0 0 9.Be3 B/0 0 Be6 B/0 0 10.Qd3 B/0 0 Nbd7 B/0 0 11.Nd5 B/0 0 Bxd5 B/0 0 12.exd5 B/0 0 Rc8 B/0 0 13.Rac1 B/0 0 Ne8 B/0 0 14.Qd2 B/0 0 f5 B/0 0 15.Qb4 B/0 0 Qc7 B/0 0 16.f3 B/0 0 Nef6 B/0 0 17.Qd2 B/0 0 Nh5 B/0 0 18.Bd3 0.23/21 10 g6 (Bh4) B/0 0 19.Kh1 B/0 0 Bf6 B/0 0 20.c3 B/0 0 Bg7 B/0 0 21.Rfe1 B/0 0 Nhf6 B/0 0 22.c4 B/0 0 b6 B/0 0 23.Bf1 B/0 0 a5 0.04/24 28 24.Bg5 (Bf2) 0.08/19 6 24...Nh5 0.00/25 11 25.Qc2 (Qd1) 0.04/20 3 25...Bf6 (Nhf6) -0.44/24 16 26.Bh6 (Bd2) -0.11/21 16 26...Rf7 -0.24/26 24 27.g3 -0.13/23 0 Qd8 -0.32/25 11 28.Nd2 -0.23/21 0 Bg5 -0.40/24 8 29.Bxg5 -0.17/22 0 Qxg5 -0.44/19 0 30.Nb1 -0.15/23 10 Qh6 -0.20/23 0 31.Qg2 -0.15/22 5 f4 (Rd8) -0.28/26 1 32.g4 -0.13/23 4 Ng3+ -0.24/26 2 33.Kg1 -0.13/24 0 Nxf1 -0.24/24 0 34.Qxf1 -0.10/24 7 Nc5 -0.32/26 3 35.Nc3 -0.09/23 10 Qg5 (Qh4) -0.24/27 0 36.Rc2 -0.09/20 5 Kg7 (Re8) -0.24/25 1 37.Rd2 (Rce2) -0.08/21 7 37...Qf6 -0.24/23 10 38.Ree2 (b3) -0.08/20 7 38...Re8 (Re7) -0.40/25 15 39.Qb1 (Qf2) -0.08/22 5 39...Rfe7 -0.40/24 5 40.Ne4 -0.10/23 0 Nxe4 -0.40/23 0 41.Qxe4 (Rxe4) -0.14/22 13 41...a4 -0.48/26 8 42.Rd3 (Rc2) -0.14/22 0 42...Rc8 -0.48/25 8 43.Rc3 (Ra3) -0.14/23 0 43...Ra7 (Rec7) -0.48/27 4 44.Qd3 -0.15/22 5 Qe7 -0.48/26 7 45.Kg2 -0.16/21 0 Qg5 (Rc5) -0.44/25 12 46.Kg1 -0.18/22 6 Rc5 -0.52/24 0 47.Rf2 (Ra3) -0.19/22 16 47...Qe7 (Rb7) -0.52/24 6 48.Kg2 (Rfc2) -0.19/22 6 48...Qb7 -0.48/22 3 49.Rcc2 (Qc2) -0.23/22 11 49...Qd7 -0.60/24 12 50.Rfd2 (Qe4) -0.25/23 2 50...Rb7 -0.60/21 4 51.Qe4 (h4) -0.25/23 0 51...Qe7 (Qc7) -0.68/26 10 52.Qd3 -0.25/21 2 Qg5 (b5) -0.64/25 1 53.Kh1 (Kg1) -0.30/22 3 53...Qh4 -0.76/21 3 54.Qe4 (b4) -0.28/22 0 54...Qd8 -0.60/22 4 55.Kg2 (Rd1) -0.33/22 0 55...Qc8 (Qa8) -0.80/23 3 56.Rc3 (b4) -0.33/21 5 56...Qc7 (Qa8) -0.56/21 6 57.Qd3 (Rdc2) -0.27/21 3 57...Qd7 -0.44/22 5 58.Qc2 -0.26/23 0 Qe8 -0.44/23 5 59.Qc1 (h4) -0.27/22 1 59...Qe7 (Qd8) -0.56/19 2 60.Qd1 (b4) -0.31/20 2 60...b5 (h5) -0.68/21 1 61.cxb5 -0.26/21 4 Rcxb5 -0.72/24 0 62.Qe2 -0.37/21 3 Rb4 -1.05/23 0 63.Kf1 (Rc4) -0.50/20 8 63...e4 -1.25/21 2 64.a3 -0.50/22 0 Rb3 -1.33/23 0 65.Qxe4 (fxe4) -0.50/22 1 65...Qxe4 -1.37/10 0 66.fxe4 -0.44/23 0 Kf6 -1.73/22 0 67.Rcc2 -0.41/23 1 Ke5 -1.69/24 0 68.Kf2 (Rc8) -0.44/22 6 68...R7b6 (R7b5) -1.73/24 1 69.Re2 -0.56/22 2 g5 -1.77/26 0 70.Red2 (Kf1) -0.53/23 1 70...Kxe4 -1.93/24 1 71.Rc7 -0.53/23 0 Rb7 -2.18/24 0 72.Rc8 -0.46/24 0 Rd3 (Rf3+) -2.10/23 0 73.Re8+ -0.52/23 2 Kd4 -2.18/24 0 74.Rc2 -0.59/24 3 h5 (Rbb3) -2.18/22 0 75.gxh5 -0.90/19 2 Rh7 -2.88/22 0 76.Ra8 -0.91/21 1 Rxh5 -3.43/21 0 77.Ke1 -1.00/22 7 Rdh3 (Ke5) -3.51/25 0 78.Rd2+ -1.14/21 3 Ke5 -3.47/26 0 79.Re8+ (Rg8) -1.19/23 0 79...Kf5 -4.08/23 2 80.Rf8+ -1.46/24 7 Kg4 -3.63/27 0 81.Rg2+ -1.75/23 8 Kf3 -5.00/26 0 82.Rf2+ -2.11/21 1 Ke4 -5.01/25 0 83.Re8+ -2.11/22 3 Kd4 -4.84/28 0 84.Re6 -2.23/20 0 Rxh2 -5.01/27 0 85.Rxd6 -2.20/22 1 Rxf2 (g4) -5.33/27 0 86.Kxf2 -3.86/17 0 Rh2+ (g4) -5.37/26 0 87.Kf3 (Kf1) -2.09/19 0 87...Ke5 -5.85/23 0 88.Rd8 -2.09/23 0 Rxb2 -5.57/22 0 89.d6 -2.22/22 0 Rb3+ -6.02/26 0 90.Kf2 -2.29/23 0 g4 (Rxa3) -6.02/25 0 91.d7 -2.50/21 0 Ke6 -6.50/29 0 92.Kg1 (Kg2) -2.50/23 0 92...Rb1+ (Rxa3) -8.04/27 1 93.Kg2 -2.53/23 0 f3+ -12.40/27 0 94.Kg3 -4.08/24 4 Rg1+ -11.01/32 0 95.Kf2 -4.08/24 0 Rg2+ -12.56/27 0 96.Kf1 -4.08/24 0 g3 -7.42/24 0 97.Re8+ (Rg8) -5.39/25 2 97...Kxd7 -15.51/10 0 98.Rg8 (Rf8) -5.94/23 0 98...Ke6 (Kd6) -89.21/10 0 99.Rg5 -8.87/23 4 Kf6 -89.31/34 0 100.Rg8 -10.38/22 2 Kf5 (Ke5) -89.31/32 0 101.Rf8+ -10.42/20 0 Ke4 Mestre das Armas,Houdini 2.0c Pro x64 resigns -84.51/25 1 0-1
you will probably need 10,000 games to prove an improvement. one game means nothing. I don't think you can get more than 5 elo by tweaking the piece values
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Stockfish Code ( Piece Value's)

Post by Sven »

lucasart wrote:
NJDenson wrote:Have a game for you guys to check out evals.
[...]
you will probably need 10,000 games to prove an improvement. one game means nothing.
+1
lucasart wrote:I don't think you can get more than 5 elo by tweaking the piece values
I agree but 5 Elo points just by changing piece values wouldn't be too bad :-)

Sven