Just an untested idea

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Just an untested idea

Post by Rebel »

It's popular to tune your PST's with Texel tuning, I like to offer an alternative, tune existing PST's with the values of your history table after the search is finished. The idea is based on an experiment that at the time gave me 10-15 elo.

Results after 20,000 opening positions after a 10 ply search with an old PST set no longer in use. "cor" (correction) is the computed result of the history table.

White Pawn PST

Code: Select all

     old   cor   new
wpa2  10 +   0 =  10
wpa3  12 +  -3 =   9
wpa4   6 +  -5 =   1
wpa5  10 +   0 =  10
wpa6  14 +   2 =  16
wpa7  36 +   3 =  39
wpb2  10 +   0 =  10
wpb3  12 +  -4 =   8
wpb4  12 +  -3 =   9
wpb5  13 +   2 =  15
wpb6  14 +   2 =  16
wpb7  36 +   2 =  38
wpc2  10 +   0 =  10
wpc3  10 +   0 =  10
wpc4  12 +  -2 =  10
wpc5  13 +  -2 =  11
wpc6  20 +   3 =  23
wpc7  36 +   1 =  37
wpd2   0 +   0 =   0
wpd3  12 +   4 =  16
wpd4  20 +   3 =  23
wpd5  20 +   0 =  20
wpd6  24 +   3 =  27
wpd7  36 +   1 =  37
wpe2   0 +   0 =   0
wpe3  12 +   0 =  12
wpe4  20 +   0 =  20
wpe5  20 +   1 =  21
wpe6  24 +   2 =  26
wpe7  36 +   1 =  37
wpf2  14 +   0 =  14
wpf3  10 +  -3 =   7
wpf4  10 +  -2 =   8
wpf5  18 +   0 =  18
wpf6  20 +   2 =  22
wpf7  36 +   2 =  38
wpg2  55 +   0 =  55
wpg3  55 +  -6 =  49
wpg4  10 +  -6 =   4
wpg5  12 +   3 =  15
wpg6  16 +   0 =  16
wpg7  36 +   0 =  36
wph2  50 +   0 =  50
wph3  50 +  -4 =  46
wph4  10 +  -6 =   4
wph5  12 +   0 =  12
wph6  16 +   3 =  19
wph7  36 +   3 =  39
White Knight PST

Code: Select all

     old   cor   new
wna1   0 +  -2 =  -2
wna2   5 +  -3 =   2
wna3   0 +  -4 =  -4
wna4  10 +  -4 =   6
wna5  10 +  -2 =   8
wna6  10 +  -1 =   9
wna7  10 +  -1 =   9
wna8   0 +  -1 =  -1
wnb1   5 +  -5 =   0
wnb2  20 +  -1 =  19
wnb3  26 +   0 =  26
wnb4  22 +  -2 =  20
wnb5  23 +  -2 =  21
wnb6  28 +   0 =  28
wnb7  24 +   1 =  25
wnb8  10 +  -1 =   9
wnc1  15 +  -4 =  11
wnc2  20 +  -1 =  19
wnc3  26 +   2 =  28
wnc4  28 +   1 =  29
wnc5  36 +   1 =  37
wnc6  40 +   0 =  40
wnc7  26 +   0 =  26
wnc8  20 +  -1 =  19
wnd1  15 +  -3 =  12
wnd2  23 +  -1 =  22
wnd3  30 +   0 =  30
wnd4  30 +  -2 =  28
wnd5  40 +   3 =  43
wnd6  50 +   2 =  52
wnd7  26 +  -1 =  25
wnd8  20 +  -1 =  19
wne1  15 +  -4 =  11
wne2  20 +  -2 =  18
wne3  30 +   1 =  31
wne4  30 +   0 =  30
wne5  40 +   2 =  42
wne6  50 +   1 =  51
wne7  26 +  -1 =  25
wne8  20 +  -2 =  18
wnf1  15 +  -3 =  12
wnf2  20 +   2 =  22
wnf3  26 +   0 =  26
wnf4  28 +   0 =  28
wnf5  36 +   2 =  38
wnf6  40 +   0 =  40
wnf7  26 +   0 =  26
wnf8  20 +  -2 =  18
wng1   0 +  -5 =  -5
wng2  20 +  -2 =  18
wng3  26 +   0 =  26
wng4  22 +  -1 =  21
wng5  23 +  -2 =  21
wng6  28 +  -1 =  27
wng7  24 +   2 =  26
wng8  10 +  -3 =   7
wnh1   0 +  -2 =  -2
wnh2   5 +  -4 =   1
wnh3   0 +  -3 =  -3
wnh4  10 +  -5 =   5
wnh5  10 +  -2 =   8
wnh6  10 +   0 =  10
wnh7  10 +   0 =  10
wnh8   0 +   0 =   0
White Bishop PST

Code: Select all

     old   cor   new
wba1  24 +  -2 =  22
wba2  30 +  -2 =  28
wba3  35 +  -1 =  34
wba4  38 +  -2 =  36
wba5  41 +  -2 =  39
wba6  42 +  -5 =  37
wba7   0 +  -3 =  -3
wba8  10 +  -2 =   8
wbb1  30 +  -3 =  27
wbb2  48 +   3 =  51
wbb3  45 +   0 =  45
wbb4  45 +   0 =  45
wbb5  42 +  -1 =  41
wbb6  48 +  -2 =  46
wbb7  22 +  -1 =  21
wbb8  10 +  -3 =   7
wbc1  24 +  -4 =  20
wbc2  42 +  -1 =  41
wbc3  45 +  -1 =  44
wbc4  42 +  -2 =  40
wbc5  45 +  -2 =  43
wbc6  50 +  -1 =  49
wbc7  24 +  -3 =  21
wbc8  10 +   0 =  10
wbd1  30 +  -3 =  27
wbd2  35 +  -1 =  34
wbd3  42 +   0 =  42
wbd4  48 +  -2 =  46
wbd5  48 +  -1 =  47
wbd6  52 +   0 =  52
wbd7  24 +  -2 =  22
wbd8  10 +  -2 =   8
wbe1  30 +  -2 =  28
wbe2  35 +  -1 =  34
wbe3  42 +   3 =  45
wbe4  48 +  -3 =  45
wbe5  48 +   0 =  48
wbe6  52 +  -2 =  50
wbe7  24 +  -1 =  23
wbe8  10 +  -2 =   8
wbf1  20 +  -4 =  16
wbf2  42 +  -2 =  40
wbf3  45 +  -2 =  43
wbf4  42 +   0 =  42
wbf5  45 +  -2 =  43
wbf6  50 +   0 =  50
wbf7  24 +  -3 =  21
wbf8  10 +  -2 =   8
wbg1  30 +  -4 =  26
wbg2  48 +   3 =  51
wbg3  45 +   1 =  46
wbg4  45 +  -2 =  43
wbg5  42 +   0 =  42
wbg6  48 +  -3 =  45
wbg7  22 +   0 =  22
wbg8  10 +  -2 =   8
wbh1  24 +  -5 =  19
wbh2  30 +  -2 =  28
wbh3  35 +  -6 =  29
wbh4  38 +  -1 =  37
wbh5  41 +  -3 =  38
wbh6  42 +  -4 =  38
wbh7   0 +   0 =   0
wbh8  10 +  -3 =   7
etc.

Changes look sane.
90% of coding is debugging, the other 10% is writing bugs.
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Just an untested idea

Post by AlvaroBegue »

A learning rule usually has the property that, after the parameters have been correctly learned, it should not change them, at least in expectation. I don't think what you are proposing has that feature.

Can you give some intuition for why you think this should work?
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Just an untested idea

Post by Rebel »

AlvaroBegue wrote: Tue Jul 13, 2021 10:07 am A learning rule usually has the property that, after the parameters have been correctly learned, it should not change them, at least in expectation. I don't think what you are proposing has that feature.

Can you give some intuition for why you think this should work?
Because the elo it gave me in the experiment (see the link in the OP). It's also a new way of thinking, the use of the history values after search. Maybe it can be applied for other eval ingredients as well.
90% of coding is debugging, the other 10% is writing bugs.
Pio
Posts: 334
Joined: Sat Feb 25, 2012 10:42 pm
Location: Stockholm

Re: Just an untested idea

Post by Pio »

Rebel wrote: Tue Jul 13, 2021 10:55 am
AlvaroBegue wrote: Tue Jul 13, 2021 10:07 am A learning rule usually has the property that, after the parameters have been correctly learned, it should not change them, at least in expectation. I don't think what you are proposing has that feature.

Can you give some intuition for why you think this should work?
Because the elo it gave me in the experiment (see the link in the OP). It's also a new way of thinking, the use of the history values after search. Maybe it can be applied for other eval ingredients as well.
I think it is a brilliant idea. I think you could go even further than update the PST after each search. I think you can do it within each and every search. The only major problem I can think of is that the search will become unstable and it will be problematic with the history table since the learning will be self fulfilling. You can overcome these problems however by saving two separate values in the TT to also include the search influenced score and only recording the cutoffs that would have been made if the search influenced score would be ignored.

If you do this you should probably reduce the history tables reduction in LMR by half since the evaluation now is adjusted and the search before was optimised for an eval without this.

Good luck, I think you will make something groundbreaking!!!
/Pio
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: Just an untested idea

Post by amanjpro »

The idea reminds me of what Michael Sherwin is doing in RomiChess and Bricabrac.. Is there a significant difference between the two?
User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Re: Just an untested idea

Post by Rebel »

I don't know about Romichess. But it can be useful for other things than PST eval as well.

1. Create a fixed history table for move ordering and LMR, midgame only, the endgame is a bridge too far IMO.

2. I understand (hopefully correct) that Stockfish NNUE is based on king + PST's, maybe the history table can be of use.

After 350,000 middle game positions I get the below values, maybe large negative "cor" numbers <=-7 can be reduced a full ply, others <=-3 half of a ply. Who knows...

Code: Select all

********** wp ***********
     old   cor   new
wpa2  10 +   0 =  10
wpa3  12 +  -8 =   4
wpa4   6 + -10 =  -4
wpa5  10 +   0 =  10
wpa6  14 +   7 =  21
wpa7  36 +   6 =  42
wpb2  10 +   0 =  10
wpb3  12 +  -8 =   4
wpb4  12 +  -7 =   5
wpb5  13 +   1 =  14
wpb6  14 +   5 =  19
wpb7  36 +   6 =  42
wpc2  10 +   0 =  10
wpc3  10 +  -4 =   6
wpc4  12 +  -5 =   7
wpc5  13 +  -2 =  11
wpc6  20 +   7 =  27
wpc7  36 +   6 =  42
wpd2   0 +   0 =   0
wpd3  12 +   5 =  17
wpd4  20 +   5 =  25
wpd5  20 +   0 =  20
wpd6  24 +   7 =  31
wpd7  36 +   6 =  42
wpe2   0 +   0 =   0
wpe3  12 +   0 =  12
wpe4  20 +   1 =  21
wpe5  20 +   2 =  22
wpe6  24 +   7 =  31
wpe7  36 +   6 =  42
wpf2  14 +   0 =  14
wpf3  10 +  -8 =   2
wpf4  10 +  -5 =   5
wpf5  18 +   0 =  18
wpf6  20 +   6 =  26
wpf7  36 +   6 =  42
wpg2  55 +   0 =  55
wpg3  55 + -10 =  45
wpg4  10 + -11 =  -1
wpg5  12 +   2 =  14
wpg6  16 +   1 =  17
wpg7  36 +   4 =  40
wph2  50 +   0 =  50
wph3  50 +  -9 =  41
wph4  10 + -12 =  -2
wph5  12 +   0 =  12
wph6  16 +   7 =  23
wph7  36 +   8 =  44


********** wn ***********
     old   cor   new
wna1   0 +  -8 =  -8
wna2   5 +  -8 =  -3
wna3   0 +  -7 =  -7
wna4  10 +  -7 =   3
wna5  10 +  -5 =   5
wna6  10 +  -4 =   6
wna7  10 +  -3 =   7
wna8   0 +  -5 =  -5
wnb1   5 + -10 =  -5
wnb2  20 +  -5 =  15
wnb3  26 +  -2 =  24
wnb4  22 +  -3 =  19
wnb5  23 +  -4 =  19
wnb6  28 +   0 =  28
wnb7  24 +  -2 =  22
wnb8  10 +  -4 =   6
wnc1  15 +  -8 =   7
wnc2  20 +  -4 =  16
wnc3  26 +   1 =  27
wnc4  28 +   0 =  28
wnc5  36 +   2 =  38
wnc6  40 +   0 =  40
wnc7  26 +   0 =  26
wnc8  20 +  -4 =  16
wnd1  15 +  -7 =   8
wnd2  23 +  -5 =  18
wnd3  30 +   0 =  30
wnd4  30 +  -2 =  28
wnd5  40 +   6 =  46
wnd6  50 +   5 =  55
wnd7  26 +  -4 =  22
wnd8  20 +  -3 =  17
wne1  15 +  -8 =   7
wne2  20 +  -5 =  15
wne3  30 +   2 =  32
wne4  30 +   1 =  31
wne5  40 +   5 =  45
wne6  50 +   4 =  54
wne7  26 +  -1 =  25
wne8  20 +  -4 =  16
wnf1  15 +  -7 =   8
wnf2  20 +   0 =  20
wnf3  26 +   0 =  26
wnf4  28 +   0 =  28
wnf5  36 +   4 =  40
wnf6  40 +   2 =  42
wnf7  26 +  -1 =  25
wnf8  20 +  -4 =  16
wng1   0 +  -9 =  -9
wng2  20 +  -4 =  16
wng3  26 +   0 =  26
wng4  22 +  -3 =  19
wng5  23 +  -4 =  19
wng6  28 +  -2 =  26
wng7  24 +  -1 =  23
wng8  10 +  -5 =   5
wnh1   0 +  -8 =  -8
wnh2   5 +  -9 =  -4
wnh3   0 +  -6 =  -6
wnh4  10 +  -9 =   1
wnh5  10 +  -5 =   5
wnh6  10 +   2 =  12
wnh7  10 +  -3 =   7
wnh8   0 +  -4 =  -4


********** wb ***********
     old   cor   new
wba1  24 +  -8 =  16
wba2  30 +  -7 =  23
wba3  35 +  -5 =  30
wba4  38 +  -6 =  32
wba5  41 +  -3 =  38
wba6  42 +  -9 =  33
wba7   0 +  -7 =  -7
wba8  10 +  -6 =   4
wbb1  30 +  -8 =  22
wbb2  48 +   5 =  53
wbb3  45 +   0 =  45
wbb4  45 +  -2 =  43
wbb5  42 +  -4 =  38
wbb6  48 +  -3 =  45
wbb7  22 +  -4 =  18
wbb8  10 +  -8 =   2
wbc1  24 +  -8 =  16
wbc2  42 +  -4 =  38
wbc3  45 +  -3 =  42
wbc4  42 +  -5 =  37
wbc5  45 +  -5 =  40
wbc6  50 +  -2 =  48
wbc7  24 +  -6 =  18
wbc8  10 +  -5 =   5
wbd1  30 +  -7 =  23
wbd2  35 +  -4 =  31
wbd3  42 +  -1 =  41
wbd4  48 +  -4 =  44
wbd5  48 +  -2 =  46
wbd6  52 +   0 =  52
wbd7  24 +  -5 =  19
wbd8  10 +  -6 =   4
wbe1  30 +  -7 =  23
wbe2  35 +  -4 =  31
wbe3  42 +   2 =  44
wbe4  48 +  -5 =  43
wbe5  48 +  -2 =  46
wbe6  52 +  -4 =  48
wbe7  24 +  -4 =  20
wbe8  10 +  -6 =   4
wbf1  20 +  -8 =  12
wbf2  42 +  -4 =  38
wbf3  45 +  -5 =  40
wbf4  42 +  -3 =  39
wbf5  45 +  -4 =  41
wbf6  50 +  -1 =  49
wbf7  24 +  -5 =  19
wbf8  10 +  -7 =   3
wbg1  30 +  -8 =  22
wbg2  48 +   4 =  52
wbg3  45 +   0 =  45
wbg4  45 +  -4 =  41
wbg5  42 +  -1 =  41
wbg6  48 +  -5 =  43
wbg7  22 +  -4 =  18
wbg8  10 +  -5 =   5
wbh1  24 + -12 =  12
wbh2  30 +  -7 =  23
wbh3  35 +  -9 =  26
wbh4  38 +  -4 =  34
wbh5  41 +  -7 =  34
wbh6  42 +  -8 =  34
wbh7   0 +   0 =   0
wbh8  10 +  -5 =   5


********** wr ***********
     old   cor   new
wra1   0 +  -7 =  -7
wra2   0 +  -9 =  -9
wra3   0 +  -9 =  -9
wra4   0 +  -7 =  -7
wra5   0 +  -7 =  -7
wra6   8 +  -4 =   4
wra7  50 +   6 =  56
wra8  30 +  -4 =  26
wrb1   0 + -10 = -10
wrb2   0 +  -7 =  -7
wrb3   0 +  -6 =  -6
wrb4   0 +  -6 =  -6
wrb5   0 +  -5 =  -5
wrb6   8 +  -3 =   5
wrb7  50 +   5 =  55
wrb8  30 +  -2 =  28
wrc1   4 +  -4 =   0
wrc2   4 +  -7 =  -3
wrc3   4 +  -6 =  -2
wrc4   4 +  -6 =  -2
wrc5   4 +  -5 =  -1
wrc6  12 +  -3 =   9
wrc7  50 +   5 =  55
wrc8  30 +  -2 =  28
wrd1   6 +   0 =   6
wrd2   6 +  -7 =  -1
wrd3   6 +  -8 =  -2
wrd4   6 +  -7 =  -1
wrd5   6 +  -6 =   0
wrd6  20 +  -3 =  17
wrd7  50 +   4 =  54
wrd8  30 +  -1 =  29
wre1   6 +  -4 =   2
wre2   6 +  -8 =  -2
wre3   6 +  -8 =  -2
wre4   6 +  -6 =   0
wre5   6 +  -6 =   0
wre6  20 +  -4 =  16
wre7  50 +   5 =  55
wre8  30 +  -1 =  29
wrf1   4 +  -9 =  -5
wrf2   4 +  -6 =  -2
wrf3   4 +  -7 =  -3
wrf4   4 +  -5 =  -1
wrf5   4 +  -5 =  -1
wrf6  12 +  -4 =   8
wrf7  50 +   5 =  55
wrf8  30 +  -2 =  28
wrg1   0 + -10 = -10
wrg2   0 +  -6 =  -6
wrg3   0 +  -3 =  -3
wrg4   0 +  -4 =  -4
wrg5   0 +  -4 =  -4
wrg6   8 +  -1 =   7
wrg7  50 +   4 =  54
wrg8  30 +  -1 =  29
wrh1   0 +  -6 =  -6
wrh2   0 + -10 = -10
wrh3   0 +  -9 =  -9
wrh4   0 +  -6 =  -6
wrh5   0 +  -6 =  -6
wrh6   8 +  -4 =   4
wrh7  50 +   6 =  56
wrh8  30 +   0 =  30


********** wq ***********
     old   cor   new
wqa1  20 +  -5 =  15
wqa2  32 +  -6 =  26
wqa3  32 +  -4 =  28
wqa4  32 +  -6 =  26
wqa5  32 +  -4 =  28
wqa6  34 +  -5 =  29
wqa7  38 +  -1 =  37
wqa8  38 +  -1 =  37
wqb1  30 +  -8 =  22
wqb2  32 +  -5 =  27
wqb3  34 +  -4 =  30
wqb4  34 +  -5 =  29
wqb5  36 +  -3 =  33
wqb6  42 +  -3 =  39
wqb7  46 +   0 =  46
wqb8  46 +  -3 =  43
wqc1  30 +  -9 =  21
wqc2  36 +  -4 =  32
wqc3  34 +  -5 =  29
wqc4  34 +  -5 =  29
wqc5  34 +  -4 =  30
wqc6  46 +  -1 =  45
wqc7  54 +   0 =  54
wqc8  50 +  -2 =  48
wqd1  30 +  -7 =  23
wqd2  18 +  -6 =  12
wqd3  38 +  -4 =  34
wqd4  34 +  -5 =  29
wqd5  34 +  -5 =  29
wqd6  60 +   0 =  60
wqd7  60 +  -1 =  59
wqd8  54 +  -1 =  53
wqe1  30 +  -9 =  21
wqe2  36 +  -6 =  30
wqe3  38 +  -3 =  35
wqe4  34 +  -5 =  29
wqe5  34 +  -3 =  31
wqe6  60 +   0 =  60
wqe7  60 +   0 =  60
wqe8  54 +   0 =  54
wqf1  30 +  -6 =  24
wqf2  32 +  -4 =  28
wqf3  36 +  -4 =  32
wqf4  38 +  -2 =  36
wqf5  42 +  -3 =  39
wqf6  50 +   1 =  51
wqf7  54 +   1 =  55
wqf8  50 +  -4 =  46
wqg1  30 +  -6 =  24
wqg2  32 +  -5 =  27
wqg3  34 +  -1 =  33
wqg4  36 +  -4 =  32
wqg5  40 +  -1 =  39
wqg6  50 +   0 =  50
wqg7  54 +   1 =  55
wqg8  46 +  -2 =  44
wqh1  20 +  -5 =  15
wqh2  32 +  -5 =  27
wqh3  34 +  -4 =  30
wqh4  36 +  -2 =  34
wqh5  40 +  -1 =  39
wqh6  46 +   3 =  49
wqh7  50 +   0 =  50
wqh8  42 +   1 =  43


********** wk ***********
     old   cor   new
wka1   0 +  -9 =  -9
wka2  12 +  -7 =   5
wka3  12 +  -4 =   8
wka4   8 +   0 =   8
wka5   8 +  -2 =   6
wka6  12 +   0 =  12
wka7  12 +   0 =  12
wka8   0 +   0 =   0
wkb1  12 +   0 =  12
wkb2  20 +  -2 =  18
wkb3  20 +  -1 =  19
wkb4  12 +  -4 =   8
wkb5  12 +   0 =  12
wkb6  20 +   0 =  20
wkb7  20 +   0 =  20
wkb8  12 +   0 =  12
wkc1  16 +   1 =  17
wkc2  20 +  -4 =  16
wkc3  24 +   1 =  25
wkc4  12 +   2 =  14
wkc5  12 +   1 =  13
wkc6  24 +   0 =  24
wkc7  20 +   0 =  20
wkc8  16 +   0 =  16
wkd1  16 +  -7 =   9
wkd2  20 +  -8 =  12
wkd3  24 +   0 =  24
wkd4   4 +   3 =   7
wkd5   4 +   4 =   8
wkd6  24 +   7 =  31
wkd7  20 +   0 =  20
wkd8  16 +   0 =  16
wke1  16 +   3 =  19
wke2  20 +  -7 =  13
wke3  24 +   1 =  25
wke4   4 +   3 =   7
wke5   4 +   5 =   9
wke6  24 +   0 =  24
wke7  20 +   0 =  20
wke8  16 +   0 =  16
wkf1  16 +  -9 =   7
wkf2  20 +  -7 =  13
wkf3  24 +  -2 =  22
wkf4  12 +   0 =  12
wkf5  12 +   3 =  15
wkf6  20 +   2 =  22
wkf7  20 +   0 =  20
wkf8  12 +   0 =  12
wkg1  12 +   5 =  17
wkg2  20 +  -4 =  16
wkg3  20 +  -2 =  18
wkg4  12 +   1 =  13
wkg5  12 +   4 =  16
wkg6  20 +   1 =  21
wkg7  20 +   1 =  21
wkg8  12 +   0 =  12
wkh1   0 + -11 = -11
wkh2  12 +  -8 =   4
wkh3  12 +  -6 =   6
wkh4   8 +  -1 =   7
wkh5   8 +   0 =   8
wkh6  12 +   7 =  19
wkh7  12 +   0 =  12
wkh8   0 +   0 =   0


********** bp ***********
     old   cor   new
bpa1  36 +   5 =  41
bpa2  36 +   6 =  42
bpa3  14 +   6 =  20
bpa4  10 +   0 =  10
bpa5   6 + -10 =  -4
bpa6  12 +  -7 =   5
bpa7  10 +   0 =  10
bpa8   0 +   0 =   0
bpb1  36 +   4 =  40
bpb2  36 +   5 =  41
bpb3  14 +   3 =  17
bpb4  13 +   1 =  14
bpb5  12 +  -6 =   6
bpb6  12 +  -8 =   4
bpb7  10 +   0 =  10
bpb8   0 +   0 =   0
bpc1  36 +   6 =  42
bpc2  36 +   6 =  42
bpc3  20 +   6 =  26
bpc4  13 +  -1 =  12
bpc5  12 +  -2 =  10
bpc6  10 +  -3 =   7
bpc7  10 +   0 =  10
bpc8   0 +   0 =   0
bpd1  36 +   6 =  42
bpd2  36 +   5 =  41
bpd3  24 +   6 =  30
bpd4  20 +   0 =  20
bpd5  20 +   4 =  24
bpd6  12 +   6 =  18
bpd7   0 +   0 =   0
bpd8   0 +   0 =   0
bpe1  36 +   4 =  40
bpe2  36 +   6 =  42
bpe3  24 +   6 =  30
bpe4  20 +   2 =  22
bpe5  20 +   2 =  22
bpe6  12 +  -1 =  11
bpe7   0 +   0 =   0
bpe8   0 +   0 =   0
bpf1  36 +   4 =  40
bpf2  36 +   6 =  42
bpf3  20 +   6 =  26
bpf4  18 +   1 =  19
bpf5  10 +  -5 =   5
bpf6  10 +  -7 =   3
bpf7  14 +   0 =  14
bpf8   0 +   0 =   0
bpg1  36 +   7 =  43
bpg2  36 +   7 =  43
bpg3  16 +   3 =  19
bpg4  12 +   1 =  13
bpg5  10 + -11 =  -1
bpg6  55 + -10 =  45
bpg7  55 +   0 =  55
bpg8   0 +   0 =   0
bph1  36 +   5 =  41
bph2  36 +   6 =  42
bph3  16 +   7 =  23
bph4  12 +  -1 =  11
bph5  10 + -12 =  -2
bph6  50 +  -8 =  42
bph7  50 +   0 =  50
bph8   0 +   0 =   0


********** bn ***********
     old   cor   new
bna1   0 +   0 =   0
bna2  10 +   0 =  10
bna3  10 +  -2 =   8
bna4  10 +  -5 =   5
bna5  10 +  -6 =   4
bna6   0 +  -5 =  -5
bna7   5 +  -8 =  -3
bna8   0 +  -2 =  -2
bnb1  10 +   0 =  10
bnb2  24 +   1 =  25
bnb3  28 +  -2 =  26
bnb4  23 +  -2 =  21
bnb5  22 +  -2 =  20
bnb6  26 +  -2 =  24
bnb7  20 +  -1 =  19
bnb8   5 + -10 =  -5
bnc1  20 +  -3 =  17
bnc2  26 +   0 =  26
bnc3  40 +   0 =  40
bnc4  36 +   3 =  39
bnc5  28 +   0 =  28
bnc6  26 +   0 =  26
bnc7  20 +  -2 =  18
bnc8  15 +  -4 =  11
bnd1  20 +  -3 =  17
bnd2  26 +  -4 =  22
bnd3  50 +   1 =  51
bnd4  40 +   3 =  43
bnd5  30 +  -1 =  29
bnd6  30 +   0 =  30
bnd7  23 +  -4 =  19
bnd8  15 +  -4 =  11
bne1  20 +  -4 =  16
bne2  26 +  -1 =  25
bne3  50 +   0 =  50
bne4  40 +   3 =  43
bne5  30 +   0 =  30
bne6  30 +   2 =  32
bne7  20 +  -4 =  16
bne8  15 +  -7 =   8
bnf1  20 +   1 =  21
bnf2  26 +   0 =  26
bnf3  40 +   0 =  40
bnf4  36 +   2 =  38
bnf5  28 +   0 =  28
bnf6  26 +   0 =  26
bnf7  20 +   0 =  20
bnf8  15 +  -6 =   9
bng1  10 +  -1 =   9
bng2  24 +  -1 =  23
bng3  28 +  -2 =  26
bng4  23 +  -4 =  19
bng5  22 +  -2 =  20
bng6  26 +   1 =  27
bng7  20 +  -2 =  18
bng8   0 +  -8 =  -8
bnh1   0 +  -1 =  -1
bnh2  10 +  -2 =   8
bnh3  10 +   3 =  13
bnh4  10 +  -5 =   5
bnh5  10 +  -8 =   2
bnh6   0 +  -6 =  -6
bnh7   5 +  -8 =  -3
bnh8   0 +  -8 =  -8


********** bb ***********
     old   cor   new
bba1  10 +  -5 =   5
bba2   0 +  -6 =  -6
bba3  42 +  -5 =  37
bba4  41 +  -3 =  38
bba5  38 +  -4 =  34
bba6  35 +  -3 =  32
bba7  30 +  -6 =  24
bba8  24 +  -8 =  16
bbb1  10 +  -7 =   3
bbb2  22 +  -3 =  19
bbb3  48 +  -3 =  45
bbb4  42 +  -2 =  40
bbb5  45 +  -2 =  43
bbb6  45 +   0 =  45
bbb7  48 +   5 =  53
bbb8  30 +  -7 =  23
bbc1  10 +   0 =  10
bbc2  24 +  -5 =  19
bbc3  50 +  -3 =  47
bbc4  45 +  -3 =  42
bbc5  42 +  -4 =  38
bbc6  45 +  -3 =  42
bbc7  42 +  -3 =  39
bbc8  24 +  -7 =  17
bbd1  10 +  -5 =   5
bbd2  24 +  -5 =  19
bbd3  52 +  -2 =  50
bbd4  48 +  -3 =  45
bbd5  48 +  -4 =  44
bbd6  42 +  -2 =  40
bbd7  35 +  -1 =  34
bbd8  30 +  -6 =  24
bbe1  10 +  -6 =   4
bbe2  24 +  -4 =  20
bbe3  52 +  -3 =  49
bbe4  48 +  -2 =  46
bbe5  48 +  -5 =  43
bbe6  42 +   2 =  44
bbe7  35 +  -2 =  33
bbe8  30 +  -6 =  24
bbf1  10 +  -5 =   5
bbf2  24 +  -4 =  20
bbf3  50 +  -3 =  47
bbf4  45 +  -3 =  42
bbf5  42 +  -2 =  40
bbf6  45 +  -5 =  40
bbf7  42 +  -1 =  41
bbf8  20 +  -8 =  12
bbg1  10 +  -6 =   4
bbg2  22 +  -4 =  18
bbg3  48 +  -5 =  43
bbg4  42 +   0 =  42
bbg5  45 +  -2 =  43
bbg6  45 +   2 =  47
bbg7  48 +   4 =  52
bbg8  30 +  -6 =  24
bbh1  10 +  -5 =   5
bbh2   0 +  -1 =  -1
bbh3  42 +  -7 =  35
bbh4  41 +  -5 =  36
bbh5  38 +  -3 =  35
bbh6  35 +  -9 =  26
bbh7  30 +  -6 =  24
bbh8  24 + -10 =  14


********** br ***********
     old   cor   new
bra1  30 +   0 =  30
bra2  50 +   3 =  53
bra3   8 +  -2 =   6
bra4   0 +  -5 =  -5
bra5   0 +  -6 =  -6
bra6   0 +  -7 =  -7
bra7   0 +  -9 =  -9
bra8   0 +  -7 =  -7
brb1  30 +  -3 =  27
brb2  50 +   4 =  54
brb3   8 +  -4 =   4
brb4   0 +  -4 =  -4
brb5   0 +  -6 =  -6
brb6   0 +  -6 =  -6
brb7   0 +  -7 =  -7
brb8   0 + -10 = -10
brc1  30 +  -2 =  28
brc2  50 +   2 =  52
brc3  12 +  -4 =   8
brc4   4 +  -5 =  -1
brc5   4 +  -6 =  -2
brc6   4 +  -7 =  -3
brc7   4 +  -6 =  -2
brc8   4 +  -2 =   2
brd1  30 +  -2 =  28
brd2  50 +   0 =  50
brd3  20 +  -3 =  17
brd4   6 +  -5 =   1
brd5   6 +  -6 =   0
brd6   6 +  -6 =   0
brd7   6 +  -6 =   0
brd8   6 +  -1 =   5
bre1  30 +  -1 =  29
bre2  50 +   0 =  50
bre3  20 +  -4 =  16
bre4   6 +  -5 =   1
bre5   6 +  -6 =   0
bre6   6 +  -7 =  -1
bre7   6 +  -7 =  -1
bre8   6 +  -4 =   2
brf1  30 +  -2 =  28
brf2  50 +   0 =  50
brf3  12 +  -4 =   8
brf4   4 +  -5 =  -1
brf5   4 +  -5 =  -1
brf6   4 +  -7 =  -3
brf7   4 +  -5 =  -1
brf8   4 +  -8 =  -4
brg1  30 +   0 =  30
brg2  50 +   3 =  53
brg3   8 +  -4 =   4
brg4   0 +  -3 =  -3
brg5   0 +  -4 =  -4
brg6   0 +  -2 =  -2
brg7   0 +  -4 =  -4
brg8   0 +  -8 =  -8
brh1  30 +   0 =  30
brh2  50 +   2 =  52
brh3   8 +  -4 =   4
brh4   0 +  -6 =  -6
brh5   0 +  -5 =  -5
brh6   0 +  -9 =  -9
brh7   0 +  -8 =  -8
brh8   0 +  -5 =  -5


********** bq ***********
     old   cor   new
bqa1  38 +   0 =  38
bqa2  38 +  -1 =  37
bqa3  34 +  -4 =  30
bqa4  32 +  -4 =  28
bqa5  32 +  -4 =  28
bqa6  32 +  -4 =  28
bqa7  32 +  -4 =  28
bqa8  20 +  -4 =  16
bqb1  46 +  -3 =  43
bqb2  46 +   2 =  48
bqb3  42 +  -3 =  39
bqb4  36 +  -2 =  34
bqb5  34 +  -5 =  29
bqb6  34 +  -4 =  30
bqb7  32 +  -4 =  28
bqb8  30 +  -8 =  22
bqc1  50 +  -2 =  48
bqc2  54 +   1 =  55
bqc3  46 +  -2 =  44
bqc4  34 +  -3 =  31
bqc5  34 +  -4 =  30
bqc6  34 +  -4 =  30
bqc7  36 +  -3 =  33
bqc8  30 +  -8 =  22
bqd1  54 +  -2 =  52
bqd2  60 +   0 =  60
bqd3  60 +   0 =  60
bqd4  34 +  -3 =  31
bqd5  34 +  -4 =  30
bqd6  38 +  -4 =  34
bqd7  36 +  -6 =  30
bqd8  30 +  -6 =  24
bqe1  54 +  -2 =  52
bqe2  60 +   1 =  61
bqe3  60 +   0 =  60
bqe4  34 +  -3 =  31
bqe5  34 +  -4 =  30
bqe6  38 +  -2 =  36
bqe7  36 +  -5 =  31
bqe8  30 +  -9 =  21
bqf1  50 +  -3 =  47
bqf2  54 +   0 =  54
bqf3  50 +  -1 =  49
bqf4  42 +  -2 =  40
bqf5  38 +  -2 =  36
bqf6  36 +  -4 =  32
bqf7  32 +  -3 =  29
bqf8  30 +  -5 =  25
bqg1  46 +  -4 =  42
bqg2  54 +   0 =  54
bqg3  50 +  -2 =  48
bqg4  40 +   0 =  40
bqg5  36 +  -4 =  32
bqg6  34 +   0 =  34
bqg7  32 +  -2 =  30
bqg8  30 +  -3 =  27
bqh1  42 +   0 =  42
bqh2  50 +  -1 =  49
bqh3  46 +   0 =  46
bqh4  40 +  -1 =  39
bqh5  36 +  -1 =  35
bqh6  34 +  -3 =  31
bqh7  32 +  -4 =  28
bqh8  20 +  -3 =  17


********** bk ***********
     old   cor   new
bka1   0 +   0 =   0
bka2  12 +   0 =  12
bka3  12 +   0 =  12
bka4   8 +   1 =   9
bka5   8 +  -5 =   3
bka6  12 +  -4 =   8
bka7  12 +  -5 =   7
bka8   0 +  -7 =  -7
bkb1  12 +   0 =  12
bkb2  20 +   0 =  20
bkb3  20 +   0 =  20
bkb4  12 +   6 =  18
bkb5  12 +   0 =  12
bkb6  20 +   1 =  21
bkb7  20 +   0 =  20
bkb8  12 +   0 =  12
bkc1  16 +   0 =  16
bkc2  20 +   1 =  21
bkc3  24 +   0 =  24
bkc4  12 +   4 =  16
bkc5  12 +   4 =  16
bkc6  24 +   2 =  26
bkc7  20 +  -2 =  18
bkc8  16 +   2 =  18
bkd1  16 +   0 =  16
bkd2  20 +   0 =  20
bkd3  24 +   4 =  28
bkd4   4 +   3 =   7
bkd5   4 +   3 =   7
bkd6  24 +   1 =  25
bkd7  20 +   0 =  20
bkd8  16 +  -3 =  13
bke1  16 +   0 =  16
bke2  20 +   0 =  20
bke3  24 +   2 =  26
bke4   4 +   4 =   8
bke5   4 +   4 =   8
bke6  24 +   2 =  26
bke7  20 +  -4 =  16
bke8  16 +   3 =  19
bkf1  12 +   0 =  12
bkf2  20 +   0 =  20
bkf3  20 +   3 =  23
bkf4  12 +   4 =  16
bkf5  12 +   2 =  14
bkf6  24 +  -2 =  22
bkf7  20 +  -5 =  15
bkf8  16 +  -6 =  10
bkg1  12 +   0 =  12
bkg2  20 +   0 =  20
bkg3  20 +   0 =  20
bkg4  12 +   3 =  15
bkg5  12 +   0 =  12
bkg6  20 +  -2 =  18
bkg7  20 +  -3 =  17
bkg8  12 +   6 =  18
bkh1   0 +   0 =   0
bkh2  12 +   0 =  12
bkh3  12 +   0 =  12
bkh4   8 +  -3 =   5
bkh5   8 +   0 =   8
bkh6  12 +  -5 =   7
bkh7  12 +  -7 =   5
bkh8   0 + -10 = -10
90% of coding is debugging, the other 10% is writing bugs.
Mike Sherwin
Posts: 860
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Just an untested idea

Post by Mike Sherwin »

amanjpro wrote: Tue Jul 13, 2021 7:39 pm The idea reminds me of what Michael Sherwin is doing in RomiChess and Bricabrac.. Is there a significant difference between the two?
Thank you! This was pioneered by me in RomiChess a long time ago.
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Just an untested idea

Post by AlvaroBegue »

Rebel wrote: Tue Jul 13, 2021 10:55 am
AlvaroBegue wrote: Tue Jul 13, 2021 10:07 am A learning rule usually has the property that, after the parameters have been correctly learned, it should not change them, at least in expectation. I don't think what you are proposing has that feature.

Can you give some intuition for why you think this should work?
Because the elo it gave me in the experiment (see the link in the OP). It's also a new way of thinking, the use of the history values after search. Maybe it can be applied for other eval ingredients as well.
But if your parameters had been set optimally, it would have hurt, right? So all you observed is that your parameters were configured incorrectly in a way in which this update was helpful. But there is no reason to believe that this is likely to be the case for other engines.
amanjpro
Posts: 883
Joined: Sat Mar 13, 2021 1:47 am
Full name: Amanj Sherwany

Re: Just an untested idea

Post by amanjpro »

AlvaroBegue wrote: Mon Jul 19, 2021 5:29 pm
Rebel wrote: Tue Jul 13, 2021 10:55 am
AlvaroBegue wrote: Tue Jul 13, 2021 10:07 am A learning rule usually has the property that, after the parameters have been correctly learned, it should not change them, at least in expectation. I don't think what you are proposing has that feature.

Can you give some intuition for why you think this should work?
Because the elo it gave me in the experiment (see the link in the OP). It's also a new way of thinking, the use of the history values after search. Maybe it can be applied for other eval ingredients as well.
But if your parameters had been set optimally, it would have hurt, right? So all you observed is that your parameters were configured incorrectly in a way in which this update was helpful. But there is no reason to believe that this is likely to be the case for other engines.
I don't think parameters can be set optimally, we set it for the best mean performance. But it might do worse in same cases than a "less optimal" one.
Ed's (as well as Micheal Sherwin's) idea overcome this.

It basically hot-tunes the parameters according to the position as well as the opponent's play style
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Just an untested idea

Post by Ferdy »

Rebel wrote: Mon Jul 12, 2021 9:54 pm It's popular to tune your PST's with Texel tuning, I like to offer an alternative, tune existing PST's with the values of your history table after the search is finished. The idea is based on an experiment that at the time gave me 10-15 elo.

Results after 20,000 opening positions after a 10 ply search with an old PST set no longer in use. "cor" (correction) is the computed result of the history table.

White Pawn PST

Code: Select all

     old   cor   new
wpa2  10 +   0 =  10
wpa3  12 +  -3 =   9
wpa4   6 +  -5 =   1
wpa5  10 +   0 =  10
wpa6  14 +   2 =  16
wpa7  36 +   3 =  39
wpb2  10 +   0 =  10
wpb3  12 +  -4 =   8
wpb4  12 +  -3 =   9
wpb5  13 +   2 =  15
wpb6  14 +   2 =  16
wpb7  36 +   2 =  38
wpc2  10 +   0 =  10
wpc3  10 +   0 =  10
wpc4  12 +  -2 =  10
wpc5  13 +  -2 =  11
wpc6  20 +   3 =  23
wpc7  36 +   1 =  37
wpd2   0 +   0 =   0
wpd3  12 +   4 =  16
wpd4  20 +   3 =  23
wpd5  20 +   0 =  20
wpd6  24 +   3 =  27
wpd7  36 +   1 =  37
wpe2   0 +   0 =   0
wpe3  12 +   0 =  12
wpe4  20 +   0 =  20
wpe5  20 +   1 =  21
wpe6  24 +   2 =  26
wpe7  36 +   1 =  37
wpf2  14 +   0 =  14
wpf3  10 +  -3 =   7
wpf4  10 +  -2 =   8
wpf5  18 +   0 =  18
wpf6  20 +   2 =  22
wpf7  36 +   2 =  38
wpg2  55 +   0 =  55
wpg3  55 +  -6 =  49
wpg4  10 +  -6 =   4
wpg5  12 +   3 =  15
wpg6  16 +   0 =  16
wpg7  36 +   0 =  36
wph2  50 +   0 =  50
wph3  50 +  -4 =  46
wph4  10 +  -6 =   4
wph5  12 +   0 =  12
wph6  16 +   3 =  19
wph7  36 +   3 =  39
White Knight PST

Code: Select all

     old   cor   new
wna1   0 +  -2 =  -2
wna2   5 +  -3 =   2
wna3   0 +  -4 =  -4
wna4  10 +  -4 =   6
wna5  10 +  -2 =   8
wna6  10 +  -1 =   9
wna7  10 +  -1 =   9
wna8   0 +  -1 =  -1
wnb1   5 +  -5 =   0
wnb2  20 +  -1 =  19
wnb3  26 +   0 =  26
wnb4  22 +  -2 =  20
wnb5  23 +  -2 =  21
wnb6  28 +   0 =  28
wnb7  24 +   1 =  25
wnb8  10 +  -1 =   9
wnc1  15 +  -4 =  11
wnc2  20 +  -1 =  19
wnc3  26 +   2 =  28
wnc4  28 +   1 =  29
wnc5  36 +   1 =  37
wnc6  40 +   0 =  40
wnc7  26 +   0 =  26
wnc8  20 +  -1 =  19
wnd1  15 +  -3 =  12
wnd2  23 +  -1 =  22
wnd3  30 +   0 =  30
wnd4  30 +  -2 =  28
wnd5  40 +   3 =  43
wnd6  50 +   2 =  52
wnd7  26 +  -1 =  25
wnd8  20 +  -1 =  19
wne1  15 +  -4 =  11
wne2  20 +  -2 =  18
wne3  30 +   1 =  31
wne4  30 +   0 =  30
wne5  40 +   2 =  42
wne6  50 +   1 =  51
wne7  26 +  -1 =  25
wne8  20 +  -2 =  18
wnf1  15 +  -3 =  12
wnf2  20 +   2 =  22
wnf3  26 +   0 =  26
wnf4  28 +   0 =  28
wnf5  36 +   2 =  38
wnf6  40 +   0 =  40
wnf7  26 +   0 =  26
wnf8  20 +  -2 =  18
wng1   0 +  -5 =  -5
wng2  20 +  -2 =  18
wng3  26 +   0 =  26
wng4  22 +  -1 =  21
wng5  23 +  -2 =  21
wng6  28 +  -1 =  27
wng7  24 +   2 =  26
wng8  10 +  -3 =   7
wnh1   0 +  -2 =  -2
wnh2   5 +  -4 =   1
wnh3   0 +  -3 =  -3
wnh4  10 +  -5 =   5
wnh5  10 +  -2 =   8
wnh6  10 +   0 =  10
wnh7  10 +   0 =  10
wnh8   0 +   0 =   0
White Bishop PST

Code: Select all

     old   cor   new
wba1  24 +  -2 =  22
wba2  30 +  -2 =  28
wba3  35 +  -1 =  34
wba4  38 +  -2 =  36
wba5  41 +  -2 =  39
wba6  42 +  -5 =  37
wba7   0 +  -3 =  -3
wba8  10 +  -2 =   8
wbb1  30 +  -3 =  27
wbb2  48 +   3 =  51
wbb3  45 +   0 =  45
wbb4  45 +   0 =  45
wbb5  42 +  -1 =  41
wbb6  48 +  -2 =  46
wbb7  22 +  -1 =  21
wbb8  10 +  -3 =   7
wbc1  24 +  -4 =  20
wbc2  42 +  -1 =  41
wbc3  45 +  -1 =  44
wbc4  42 +  -2 =  40
wbc5  45 +  -2 =  43
wbc6  50 +  -1 =  49
wbc7  24 +  -3 =  21
wbc8  10 +   0 =  10
wbd1  30 +  -3 =  27
wbd2  35 +  -1 =  34
wbd3  42 +   0 =  42
wbd4  48 +  -2 =  46
wbd5  48 +  -1 =  47
wbd6  52 +   0 =  52
wbd7  24 +  -2 =  22
wbd8  10 +  -2 =   8
wbe1  30 +  -2 =  28
wbe2  35 +  -1 =  34
wbe3  42 +   3 =  45
wbe4  48 +  -3 =  45
wbe5  48 +   0 =  48
wbe6  52 +  -2 =  50
wbe7  24 +  -1 =  23
wbe8  10 +  -2 =   8
wbf1  20 +  -4 =  16
wbf2  42 +  -2 =  40
wbf3  45 +  -2 =  43
wbf4  42 +   0 =  42
wbf5  45 +  -2 =  43
wbf6  50 +   0 =  50
wbf7  24 +  -3 =  21
wbf8  10 +  -2 =   8
wbg1  30 +  -4 =  26
wbg2  48 +   3 =  51
wbg3  45 +   1 =  46
wbg4  45 +  -2 =  43
wbg5  42 +   0 =  42
wbg6  48 +  -3 =  45
wbg7  22 +   0 =  22
wbg8  10 +  -2 =   8
wbh1  24 +  -5 =  19
wbh2  30 +  -2 =  28
wbh3  35 +  -6 =  29
wbh4  38 +  -1 =  37
wbh5  41 +  -3 =  38
wbh6  42 +  -4 =  38
wbh7   0 +   0 =   0
wbh8  10 +  -3 =   7
etc.

Changes look sane.
Nice idea, I thought about using multiple regression and the target variable is the evaluation of the positions and the features are the wpa2, etc. Can also be done with NN using keras for example. It would be interesting to compare if this is further indexed by king-king for example.