Improving SF passer code

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

Moderators: hgm, Rebel, chrisw

User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: A backward proposal for SF

Post by michiguel »

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.
Maybe SF get it right already...

That extremely soft "bind" is very piece dependent (no need to incorporate the knowledge with the pawns), but the weak white pawn configuration is not. White is overextended and black pieces could dance around white squares, and pawns are easily attacked. You have to be very careful in "overloading" eval with knowledge that could be spurious, just because you think it could be useful in one set of positions.

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

Concerning bishop outposts

Post by Lyudmil Tsvetkov »

Well, watching SF games, SF does not very refined bishop psqt, but it is acceptable.

What needs to be changed however, is bishop outposts.

SF undersetimated bishop outposts on the central d4 and e4 squares, especially the d4 square. I did not chech SF outpost values recently, but it might be the case that SF gives bigger bonus for outposts on the d5 and e5 squares than outposts on the d4 and e4 squares. However, this is exactly the opposite, there is some positional peculiarity about central bishop outposts, that makes the d4 and e4 squares more valuable, as quite often advanced bishops on d5 and e5 would be easier to attack by enemy pieces and with lower mobility, while this would not be the case with d4 and e4 outposts.

So in bishop outposts, d4 and e4 deserve bigger values than d5 and e5, maybe you can just swap those.

Please, note however, that this is just a bishop peculiarity: knight outposts on d5 and e5 are due much more than knight outposts on d4 and e4.

Also, this bishop outpost rule is valid just for the d4,e4,d5 and e5 squares; f4,c4,f5 and c5 bishop outpost squares should be scored the normal way - with bigger values for f5 and c5 than f4 and c4.

I am not certain also if a5 and h5, a6 and h6 squares are not due some small bonus, maybe so after all.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: A backward proposal for SF

Post by Lyudmil Tsvetkov »

michiguel 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.
Maybe SF get it right already...

That extremely soft "bind" is very piece dependent (no need to incorporate the knowledge with the pawns), but the weak white pawn configuration is not. White is overextended and black pieces could dance around white squares, and pawns are easily attacked. You have to be very careful in "overloading" eval with knowledge that could be spurious, just because you think it could be useful in one set of positions.

Miguel
Quite the contrary, numerous game observations, as I am playing SF whenever possible, indicate quite clearly that SF has a very weak backward pawn code, I do not know if the weakest around, but certainly very weak for an engine of that order.

Some backward pawns on the 2nd rank are not noticed at all, which prevents sound positional advances like f7-f5, a7-a5, h7-h5, e7-e5, etc.

This loses games.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Concerning bishop outposts

Post by Lyudmil Tsvetkov »

One caveat is that those are just mg values, in the eg maybe there should not be any observable changes from current SF values.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Buffer pawns

Post by Lyudmil Tsvetkov »

This does not directly concern SF, but just those who like to fiddle with eval ideas. It has somewhat a bearing with backward pawns, but not entirely.

Give bonus, some 3-5-8cps, so small, only for the mg, for any own pawn on the 4th rank, with an enemy pawn on the same rank next to it.
For example, with white pawn on e4 and black pawn on d4, the white e4 pawn receives the bonus; with a white pawn on g4 and black pawn on f4, the g4 pawn receives the bonus; with a white pawn on a4 and black pawn on b4, the a4 pawn receives the bonus, etc.

Such pawns are useful, as they are somewhat limiting the activity/value of the advanced enemy pawn, being side by side. Why this is so, please do not ask me, do not have much time to explain now, but if you like eval suggestions, you might want to try this.

One downside is that such pawns are note very frequent, so you might need a bigger number of games to notice the difference.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Why fianchettoed bishop does not work in SF?

Post by Lyudmil Tsvetkov »

Well, Joerg pushed some patch, giving bonus for kingside fianchettoed bishops, and this did not work.

Why so, if this is a very reasonable term, actually one of the most reasonable around?

Very simple, simply because with the patch Joerg pushed, bishop behind a defended or twice defended pawn, SF initial king safety bonus for all 3 pawns on the 2nd rank in front of the castled king and no enemy pawns on the horizon is discounted automatically, and that obviously creates big problems.

One suggestion would be to try at some point same idea, bonus for bishop on g2 with twice defended pawn on g3 and short castled king, but with considering in such case the full initial king safety bonus, as if the g3 pawn was still on g2.

I read on fishcooking and elsewhere some people kind of doubt if kingside fianchettoed bishop is a sound chess knowledge term. Rest assured, one of the soundest around, quite probably in the top 3 eval terms :) , if Fischer and Kasparov used this technique in most of their games, either with black or white.

I expect considerable elo gain for this in SF, if properly tuned, as SF is almost completely clueless about this, but, as soon as you fianchettoe such a bishop instead of SF, in a couple of moves the engine quickly agrees this is a very good line, almost always superior to other possible lines that do not involve kingside fianchetto.

So SF has a lot to gain here, but who will be able to implement it?

Again, in order for a similar patch to succeed, initial maximal king safety bonus should be considered also in the case of a fianchetto, with pawns on h2,g3,f2 instead of h2,g2,f2.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: A backward proposal for SF

Post by michiguel »

Lyudmil Tsvetkov wrote:
michiguel 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.
Maybe SF get it right already...

That extremely soft "bind" is very piece dependent (no need to incorporate the knowledge with the pawns), but the weak white pawn configuration is not. White is overextended and black pieces could dance around white squares, and pawns are easily attacked. You have to be very careful in "overloading" eval with knowledge that could be spurious, just because you think it could be useful in one set of positions.

Miguel
Quite the contrary, numerous game observations, as I am playing SF whenever possible, indicate quite clearly that SF has a very weak backward pawn code, I do not know if the weakest around, but certainly very weak for an engine of that order.

Some backward pawns on the 2nd rank are not noticed at all, which prevents sound positional advances like f7-f5, a7-a5, h7-h5, e7-e5, etc.

This loses games.
I do not know SF does in other positions, but what it does in the above mentioned one may be ok. b7 is not a the typical backward pawn. The main problem of the backward pawn it is not that it cannot advance, the problem is indirect. Most of the time, it leaves a hole in front of it. That is what it should be penalized. Here, the whole does not exist. The problem is that it cannot play b6 w/o the help of a piece. But, if you have that piece, the problem disappears. So, gambling (any eval term is a gamble) that b7 is bad, has their risks. Is it worth it?

Also, it is moving that specific pawn so important? only if you want to take advantage of a majority. Otherwise, it is not big issue if you do not have one (add a pawn in c2, then you may want to retract the c5 pawn to b4). Again, this may depend if you can build pressure to b7, otherwise, it is not Again, this is a gamble.

"backward" pawn is an ill defined concept that it is only useful for humans, who can subconsciously pick the exceptions with their extraordinary pattern recognition. In modern dynamic chess, the concept of backward has been re-thought. People play with backward pawns w/o caring for them (e.g. Pelikan/Sveshnikov in the sicilian, or the Hedgehog if you extend it to your definition). Why? because there are other aspects that come into play.

Applying human concepts "verbatim" to chess engines is not always advisable, and that is the reason why many people thought "chess knowledge" of the author could be getting in the way. Not because it is bad, but because "micromanaging" is bad. A human may tend to do that, bloating the eval. Human concepts need to be dissected into more general underlying concepts.

It is quite possible to have an engine w/o any literal concept of "backward" pawn, and still the engine will avoid them. But, that will give the engine the ability to go for them when they are not so bad (which happens often).

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

Re: Buffer pawns

Post by Lyudmil Tsvetkov »

[d]6k1/8/8/p7/Pp1PpP2/4P3/1P6/6K1 w - - 0 1

f4 and d4 are nice buffer pawns; a4 is a buffer pawn
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Buffer pawns

Post by Lyudmil Tsvetkov »

Because of inadequate backward code, this has chances even to succeed in SF.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why fianchettoed bishop does not work in SF?

Post by Lyudmil Tsvetkov »

Here is where the problem is hidden:

[d]6k1/8/8/8/8/8/5PPP/6K1 w - - 0 1

SF gives maximal king safety bonus above for f2,g2,h2

[d]6k1/8/8/8/8/6P1/5PBP/6K1 w - - 0 1

but not here, where one of the pawns is already on g3, so this heavily penalises the bishop

As the setup with Bg2 and pawns on h2,g3 and f2 will be thus penalised in comparison to a setup with pawns on h2,g2 and f2, SF will simply avoid such a setup, and any patch along those lines will obviously fail, simply because there will be very few games in the test patch with a fianchettoed bishop, meaning very few wins because of this will be registered, and the patch will fail as only new code is added without measurable effect.

In oredr to fix that, one has to make so, that the initial maximal king safety bonus is also considered in the case of pawns on f2,g3 and h2, when there is a bishop on g2. I suppose this means changing a single line of code.

So, kingside fianchettoe is closely related to king safety. When introducing this term, one should also mind his engine's king safety and pawn shelter code. I wonder if there have been other people trying this idea and who failed, simply because they did not tune king safety/pawn shelter at the same time?

I think that a bonus for kingside fianchettoe with Bg2/g7 and twice defended pawn on g3/g6 should succeed in any reasonably strong engine, if at the same time king safety/pawn shelter is tuned.

I wonder if anyone of the SF team is interested in repeating the experiment, provided they know SF has really very very much to gain from that, both in terms of elo, and in terms of appealing human-like positional play.