anyone using Pawel Koziol's PST ?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

anyone using Pawel Koziol's PST ?

Post by MahmoudUthman »

Pawel Koziol's PST

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5a3 b8c6

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5d4 e5d4 f3d4
What's the evaluation value for the above position preferably with the trace ?
also what is the best move for this position :

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: anyone using Pawel Koziol's PST ?

Post by Sven »

MahmoudUthman wrote:Pawel Koziol's PST

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5a3 b8c6

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5d4 e5d4 f3d4
What's the evaluation value for the above position preferably with the trace ?
also what is the best move for this position :

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 
I don't know exactly what you mean by "with the trace" but here is my analysis. The evaluation is given from white viewpoint based on the PST given in the link above (only middlegame tables, mirrored for black pieces). For material, pawn=100 and knight=325.

Position 1:

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5a3 b8c6
[d]r1bqkbnr/1pp2ppp/p1n5/4p3/3p4/N3PN2/PPPP1PPP/R1BQKB1R w KQkq - 0 6[/d]

Code: Select all

Material: 0

PST:

Na3     -20
Nf3       0
Nc6       0
Ng8      40
Pa2      10
Pd2       5
Pe3      15
Pa6      10
Pd4     -15
Pe5     -25

Total:  +20
Position 2:

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5d4 e5d4 f3d4
[d]rnbqkbnr/1pp2ppp/p7/8/3N4/4P3/PPPP1PPP/R1BQKB1R b KQkq - 0 6[/d]

Code: Select all

Material: 2 pawns vs. knight = 200 - 325 = -125

PST:

Nd4      15
Nb8      40
Ng8      40
Pa2      10
Pd2       5
Pe3      15
Pa6      10

Total: +135 -125 = +10
In fact this is only 10 cp less than without the knight sac, and it is even a slightly positive score for White. Therefore I think that the weights for the knight (e.g. -40 if still on back rank, -20 on a3) may be a bit too high. Furthermore, you can't expect a score that is based on material + PST only to be accurate for all kinds of position. In reality there is more to be considered, one example would be mobility where Black certainly has additional advantages in position 2. Then it is Black's turn, usually you add a tempo bonus for the side to move. Also you need to consider what will happen within the next moves, see my next answer for position 3 below which shows that strong engines see a clear advantage for Black even if the static eval may be around zero in the beginning (for the line without the knight sac). In position 2 SF 7 wants to continue with 6...c5 7.Nf3 Nc6 with a score of about -1.70 from white viewpoint.

Position 3:

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6
[d]rnbqkbnr/1pp2ppp/p7/1N2p3/3p4/4PN2/PPPP1PPP/R1BQKB1R w KQkq - 0 5[/d]
Best move:
SF 7 shows 5.Na3 with a score of about -0.60 (depth 27)
MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

Re: anyone using Pawel Koziol's PST ?

Post by MahmoudUthman »

this is related to my previous thread
after doing what is advised by you and the others there I think that the PST is the cause of the problem :
at depth 2 it prefers b5d4

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5a3 b8c6
Material        |       White   |       Black   |       Total
Pawn            |       800     |       800     |       0
Knight          |       600     |       600     |       0
Bishop          |       600     |       600     |       0
Rook            |       1000    |       1000    |       0
Queen           |       950     |       950     |       0

PST             |       White   |       Black   |       Total
                |       MG EG   |       MG EG   |       MG EG
King            |       10 -24  |       10 -24  |       0 0
Pawn            |       80 0    |       80 9    |       0 -9
Knight          |       -20 -20 |       -40 -30 |       20 10
Bishop          |       -32 -16 |       -32 -16 |       0 0
Rook            |       0 0     |       0 0     |       0 0
Queen           |       -5 -8   |       -5 -8   |       0 0


Total(WhiteView):       20

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5d4 e5d4 f3d4
Material        |       White   |       Black   |       Total
Pawn            |       800     |       600     |       200
Knight          |       300     |       600     |       -300
Bishop          |       600     |       600     |       0
Rook            |       1000    |       1000    |       0
Queen           |       950     |       950     |       0

PST             |       White   |       Black   |       Total
                |       MG EG   |       MG EG   |       MG EG
King            |       10 -24  |       10 -24  |       0 0
Pawn            |       80 0    |       40 6    |       40 -6
Knight          |       15 10   |       -80 -60 |       95 70
Bishop          |       -32 -16 |       -32 -16 |       0 0
Rook            |       0 0     |       0 0     |       0 0
Queen           |       -5 -8   |       -5 -8   |       0 0


Total(WhiteView):       31
another example at different depth "8":

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 b5a3 f8a3 b2a3 b8c6 e3d4 e5d4 d1e2 g8e7 c1b2
Material        |       White   |       Black   |       Total
Pawn            |       700     |       700     |       0
Knight          |       300     |       600     |       -300
Bishop          |       600     |       300     |       300
Rook            |       1000    |       1000    |       0
Queen           |       950     |       950     |       0

PST             |       White   |       Black   |       Total
                |       MG EG   |       MG EG   |       MG EG
King            |       10 -24  |       10 -24  |       0 0
Pawn            |       35 5    |       55 9    |       -20 -4
Knight          |       0 0     |       -10 -5  |       10 5
Bishop          |       -10 -16 |       -16 -8  |       6 -8
Rook            |       0 0     |       0 0     |       0 0
Queen           |       0 0     |       -5 -8   |       5 8


Total(WhiteView):       1

Code: Select all

position startpos moves g1f3 d7d5 b1c3 d5d4 c3b5 e7e5 e2e3 a7a6 f3e5 d4e3 f2e3 d8h4 g2g3 h4e7 d2d4 a6b5 f1b5 b8d7
Material        |       White   |       Black   |       Total
Pawn            |       700     |       500     |       200
Knight          |       300     |       600     |       -300
Bishop          |       600     |       600     |       0
Rook            |       1000    |       1000    |       0
Queen           |       950     |       950     |       0

PST             |       White   |       Black   |       Total
                |       MG EG   |       MG EG   |       MG EG
King            |       10 -24  |       10 -24  |       0 0
Pawn            |       80 4    |       50 3    |       30 1
Knight          |       20 10   |       -50 -35 |       70 45
Bishop          |       -16 -3  |       -32 -16 |       16 13
Rook            |       0 0     |       0 0     |       0 0
Queen           |       -5 -8   |       0 0     |       -5 -8


Total(WhiteView):       8
here's an example output (TT,Null, mobility disabled) :

Code: Select all

info depth 1 score cp 34 EBF 62 nodes 62 time 1 nps 329062 pv b5a3
info depth 2 score cp 31 EBF 3 nodes 223 time 1 nps 297223 pv b5d4
info depth 3 score cp 34 EBF 5 nodes 1154 time 3 nps 193487 pv b5a3
info depth 4 score cp 33 EBF 6 nodes 7680 time 13 nps 1223910 pv f3e5
info depth 5 score cp 21 EBF 6 nodes 46214 time 49 nps 826642 pv b5a3
info depth 6 score cp 12 EBF 5 nodes 255500 time 255 nps 1229970 pv f3e5
info depth 7 score cp 30 EBF 5 nodes 1361865 time 1360 nps 2238347 pv b5a3
info depth 8 score cp 8 EBF 7 nodes 9598295 time 7927 nps 10375945 pv f3e5
info depth 9 score cp 23 EBF 5 nodes 48789876 time 43705 nps 49565813 pv b5a3
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: anyone using Pawel Koziol's PST ?

Post by Sven »

MahmoudUthman wrote:this is related to my previous thread
after doing what is advised by you and the others there I think that the PST is the cause of the problem :
at depth 2 it prefers b5d4
Yes, as I wrote the PST might have too big weights for knights. But I also wrote that you should not expect too much accuracy from a bare material+PST evaluation.

So maybe you are right that actually there might not be a real "bug" that is responsible for the move decision of your engine (giving a knight vs. two pawns). But nevertheless, it is still a bad decision which you might want to correct. Deeper search, better PST weights, later on additional eval features, ... At least your search should find that the position is slightly better for Black after the knight sac. My engine Jumbo agrees with SF 7 in scoring position 2 with the additional moves c5 Nf3 Nc6 as about -1.00 from white viewpoint.

In your evaluation output I see that your material score for a knight is 300. As others have pointed out, a value of about 325 is slightly better than that since it helps to avoid giving a knight for three pawns in many cases. If you are using the PST of Pawel Koziol then it might in general also be better to use the material values that he mentioned in the same context, since PSTs are often adjusted relative to material values. Changing that might already help in your case. Additionally the tempo bonus may play a role as well (~10..15 cp for side to move).
MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

Re: anyone using Pawel Koziol's PST ?

Post by MahmoudUthman »

Sven Schüle wrote:Yes, as I wrote the PST might have too big weights for knights. But I also wrote that you should not expect too much accuracy from a bare material+PST evaluation.

So maybe you are right that actually there might not be a real "bug" that is responsible for the move decision of your engine (giving a knight vs. two pawns). But nevertheless, it is still a bad decision which you might want to correct. Deeper search, better PST weights, later on additional eval features, ... At least your search should find that the position is slightly better for Black after the knight sac. My engine Jumbo agrees with SF 7 in scoring position 2 with the additional moves c5 Nf3 Nc6 as about -1.00 from white viewpoint.

In your evaluation output I see that your material score for a knight is 300. As others have pointed out, a value of about 325 is slightly better than that since it helps to avoid giving a knight for three pawns in many cases. If you are using the PST of Pawel Koziol then it might in general also be better to use the material values that he mentioned in the same context, since PSTs are often adjusted relative to material values. Changing that might already help in your case. Additionally the tempo bonus may play a role as well (~10..15 cp for side to move).
Sorry I used the wrong version , I already changed the material values , it outputs the right result as long as the mobility and other features aren't turned on , so I wanted to make sure that it wasn't a bug , before correcting it and moving on .