Improving SF passer code

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

Moderators: hgm, Rebel, chrisw

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

[d]6k1/1pp5/p4pp1/P3p3/4P3/8/8/6K1 w - - 0 1

Actually, one of the reasons the en passant patch by Vince scored positively even with not perfectly tuned values was that it saw cases like the b7 pawn above, which was penalised in that case.

Things are not very much different for the f6 pawn on the 3rd rank, but of course there the penalty is smaller.

With good will, you might even try to only consider backward connected for the 2nd rank, skipping the 3rd and 4th ranks, this might have bigger chances of success. At the end of the day, it is all a matter of precise implementation.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

Yeah, the first thing I would try in SF would be penalty for backward connected, just on the 2nd rank, maybe half of the usual penalty for the 2nd rank.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

Last time I am posting here; sorry, but just new things come to my mind.

Backward connected penalty for the 2nd rank should be smaller in the endgame, maybe half of mg penalty, in sharp distinction normal backward pawns are scored in the mg and eg, because backward connected penalty, as said, depends on the usual piece placements, and in the eg you have fewer pieces to influence that.

So maybe this makes things a bit more difficult to implement - maybe create a new special array with mg and eg values, or just apply the mg penalty for normal backward pawn on the 2nd rank, divided by 2, skipping the eg penalty.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Backward connected array

Post by Lyudmil Tsvetkov »

OK, here is my connected backward array for the 2nd rank: (I took the original backward values and adjusted them for this special case)

- { S(17, 8), S(25, 12), S(28, 13), S(28, 13),
49 - S(28, 13), S(28, 13), S(25, 12), S(17, 8) },
50 - { S(11, 5), S(16, 7), S(18, 8), S(18, 8),
51 - S(18, 8), S(18, 8), S(16, 7), S(11, 5) } };

I someone able to push a patch with the above values?

Vince?
:D
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Backward rank-based approach array

Post by Lyudmil Tsvetkov »

OK, here are my arrays with rank-based approach for the 2nd, 3rd and 4th ranks respectively:

2nd rank

- { S(33, 46), S(48, 52), S(55, 51), S(55, 51),
49 - S(55, 51), S(55, 51), S(48, 52), S(33, 46) },
50 - { S(23, 32), S(32, 34), S(36, 34), S(36, 34),
51 - S(36, 34), S(36, 34), S(32, 34), S(23, 32) } };

3rd rank

- { S(30, 42), S(43, 46), S(49, 46), S(49, 46),
49 - S(49, 46), S(49, 46), S(43, 46), S(30, 42) },
50 - { S(20, 28), S(29, 31), S(33, 31), S(33, 31),
51 - S(33, 31), S(33, 31), S(29, 31), S(20, 28) } };

4th rank

- { S(27, 37), S(37, 40), S(43, 40), S(43, 40),
49 - S(43, 40), S(43, 40), S(37, 40), S(27, 37) },
50 - { S(18, 25), S(25, 27), S(29, 27), S(29, 27),
51 - S(29, 27), S(29, 27), S(25, 27), S(18, 25) } };


These values are derived from current uniform SF backward penalty.

Is someone able to push a patch with these values?
Would be very grateful.
In the future, I could do something for that person. :)
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

Congratulations to SF for simplifying their backward pawns!

With that, they made their worse eval element even worse.

Until now, SF was considering some 10% of all available backward pawns, at most, and I will be afraid to look at how SF handles backward pawns in the future. :shock:

I understand that it is good for the engine to simpify things in terms of speed, but, one way or another, SF will have to go back to this at some point in time, as you simply can not have a perfect chess engine without having also a refined backward pawns code.

I wonder if someone has tried my suggested arrays for backward pawns in terms of ranks and backward connected, even only locally.

It is true that Eelco pushed some rank-based patch a year ago, that failed, but I am not certain what his values were, and a lot of water has run under the bridge since then. So retrying is not at all stupid.

What concerns the penalty for backward connected pawns, only for the 2nd rank, this has never been tried in SF, and there are initial indications this might actually work.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: A backward proposal for SF

Post by lucasart »

Here's a more interesting example:
[d]8/1pp5/p7/P1P5/8/8/8/8 w - - 0 1
Here, SF will give connected bonus to all 3 black pawns (2 phalanx and 1 supported), and will penalize both white pawns for being isolated. In reality, the two white pawns form an important bind on the b6 square.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

lucasart wrote:Here's a more interesting example:
[d]8/1pp5/p7/P1P5/8/8/8/8 w - - 0 1
Here, SF will give connected bonus to all 3 black pawns (2 phalanx and 1 supported), and will penalize both white pawns for being isolated. In reality, the two white pawns form an important bind on the b6 square.
Now you start to realise.

When will you push a patch with this? :D :)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: A backward proposal for SF

Post by bob »

lucasart wrote:Here's a more interesting example:
[d]8/1pp5/p7/P1P5/8/8/8/8 w - - 0 1
Here, SF will give connected bonus to all 3 black pawns (2 phalanx and 1 supported), and will penalize both white pawns for being isolated. In reality, the two white pawns form an important bind on the b6 square.
More importantly, the b7 pawn is terminally weak, AND on an open file (if there are rooks or queens on the board).
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

bob wrote:
lucasart wrote:Here's a more interesting example:
[d]8/1pp5/p7/P1P5/8/8/8/8 w - - 0 1
Here, SF will give connected bonus to all 3 black pawns (2 phalanx and 1 supported), and will penalize both white pawns for being isolated. In reality, the two white pawns form an important bind on the b6 square.
More importantly, the b7 pawn is terminally weak, AND on an open file (if there are rooks or queens on the board).
It would be weak even if it was not on an open file, as b7 can not advance safely.

What kind of irks me a bit, but not from you, Mr. Hyatt :) , is that people generally think of a backward pawn as a weak pawn simply, a pawn that is an easy target for enemy pieces, but that is only very small portion of what backward pawns are all about.

The main thing about backward pawns is that they can not advance safely, no matter where they are, so in this way they do not take active role into the game. Any own unit, piece or pawn, that does not take an active part into the game, is a liability.