Chain, duo, connected

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: Chain, duo, connected

Post by Lyudmil Tsvetkov »

Haikouichthys wrote:
Lyudmil Tsvetkov wrote:
Haikouichthys wrote:
Lyudmil Tsvetkov wrote:
Haikouichthys wrote:
Lyudmil Tsvetkov wrote:Well, a chain pawn is any pawn that is part of a chain, but here we will mainly refer to chain pawns as to defended pawns, as the base/undefended pawn of the chain is much less significant and actually only due a penalty.

Duos are of course, according to Kmoch's definition, 2 own pawns next to each other on the same rank on adjacent files. A duo pawn is one of those pawns.

What concerns connected pawns, here I will refer mainly to SF's definition of connected pawns, however imprecise it might be, that considers both chain/defended pawns and duos as connected pawns, giving the same bonus.

[d]6k1/8/8/8/3P1PP1/2P5/8/6K1 w - - 0 1

above, d4 is a chain/defended pawn

f4 and g4 are a duo as a tandem, and a duo pawn each of them

SF scores both d4, and f4 and g4 in exactly the same way, as connected pawns. In practice, this works fine, as when the pawns move forward, they support each other by alternating more and less advanced duos and chain pawns, so a continuity is ensured.

However, scientifically, there is a distinction in terms of the size of the bonus between the d4 chain/defended pawn and the duo pawns.

The chain/defended pawn on the same square is due around 1/3 higher bonus than the respective duo pawn, so basically the primary concept from where connected pawns derive is the defended/chain pawn, although Mr. Kmoch might think otherwise.
SF does not score d4, f4 and g4 the same way. f4 and g4 have an 'unsupported' penalty and a 'phalanx' bonus. Adding all the bonuses and penalties up, we have:
(Middlegame, endgame)
d4 : (15, 10)
f4, g4: (29, 23)

So SF actually scores the duo pawns a lot higher than the chain/defended pawn.
Thanks Jarrod.

Unsupported is a different thing - c3 is also unsupported.

Could you please remind me what was the precise bonus for phalanx pawns?
Phalanx meaning duo, right?
Duo, yeah. If C[r] is the base bonus for a connected pawn on rank r (before the MG bonus is multiplied by 3 / 2), a phalanx has an extra bonus on top of that of (C[r+1] - C[r])/2. So, C[r] for a rank 4 pawn is 10, C[r] for a rank 5 pawn is 57, so a rank 4 phalanx pawn has the base value 10 + (57 - 10) / 2 = 10 + 47 / 2 = 10 + 23 (integer division truncates the fractional component) = 33. The MG bonus is multiplied by 3 then divided by 2, so the MG bonus is 49. As such, the full bonus for a rank 4 phalanx pawn is (49, 33). I got to (29, 23) from that by subtracting the (20, 10) unsupported penalty.
So, not to calculate extensively, could you please tell me what fraction of the main connected bonus the phalanx bonus represents?
It varies. The approximate value of a phalanx as a percentage of the value of a standard connected pawn (so 100% would mean the phalanx bonus was 0):

Rank 2: 167%.
Rank 3: 87%.
Rank 4: 330%.
Rank 5: 116%.
Rank 6: 140%.
Rank 7: 145%.
Thanks Jarrod.

Man, you can never implement long chains with that - everything will depend on tuning.

My advice for long chains - try to implement some kind of separate bonus for inner chain pawns, or maybe specifically tune the above rank values in the case of inner chain pawns.

Now everything is clear, it was actually clear much much time ago, but this only underscores it - when you have suboptimally tuned values for a specific term, and even badly tuned values in some cases, you could only rely on sheer luck if you want to implement a reasonable related term. Sheer luck, nothing else.

Long chains become gloomier and gloomier for SF, maybe some engines will be more successful.

And I wondered so much why reasonable piece values do not work...
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why long chains do not work?

Post by Lyudmil Tsvetkov »

My very simple suggestion for implementing long chains in SF, maybe some other engine authors will also be interested.

As current available connected bonus points in SF are at least a bit dubious, we will try giving a reasonable ad-hoc bonus in terms of files and ranks.

The bonus will be given for inner pawns of the long chains.

Inner pawns are to be found on files b through g and ranks 3 through 6.

Rank 3 gets 5cps bonus, rank 4 gets 10cps bonus, rank 5 gets 15cps bonus, rank 6 gets 20cps.

In terms of files, b and g files will score 2/3 of c and f files, while c and f files 3/4 of d and e files.

So, thus we will have an array like this for b3-g3-g6-b6 inner pawns:

Code: Select all

5   8  12  12  8  5                    g3 f3 e3 d3 c3 b3
10 15 22 22 15 10                   g4 f4 e4 d4 c4 b4
15 22 33 33 22 15                   g5 f5 e5 d5 c5 b5
20 30 45 45 30 20                   g6 f6 e6 d6 c6 b6 
I bet this simple rule will succeed, no complications at all.

This will be the mg values, eg will score 2/3 of mg values.

Anybody able to push a patch along this lines?
Joerg, where have you gone? :D
Vince? :)

Maybe some other engine authors could also try such an array, interesting what Jose thinks about that.

Man, if there is one feature I would like to see succeeding, that is precisely long chains.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why long chains do not work?

Post by Lyudmil Tsvetkov »

At the worst case scenario, you could try halving the above bonus points.
That might be a bit more reasonable, I do not know.

What is true is that inner pawns of long chains are due just a small bonus, but how small is a matter of testing.

What is without any doubt is that the bonus for the b3-g3-g6-b6 inner pawns should be scored both in terms of ranks, and in terms of files, with centralisation and rank increase.

But the bonus should be small.

Eg again scoring 2/3 of mg, but equal values might also be tested.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why long chains do not work?

Post by Lyudmil Tsvetkov »

[d]6k1/8/8/2P1P3/3P4/2P1P3/8/6K1 w - - 0 1

Of course, one should not forget that a long chain passing through an inner pawn goes both ways - to the left and behind and to the right and in front, as well as to the right and behind and to the left and in front.

Thus, above, the d4 inner pawn should be scored for both the c3-d4-e5 long chain, as well as for the e3-d4-c5 long chain.
Of course, most of the time only one such chain will be available, but you should consider both directions.

I would indeed be very interested in a possible feedback, if someone is able to make even a very small breakthrough with inner pawns, based on the array posted, a similar array or achieved by any other method or array.

If someone has even the slightest success with long chains/inner pawns, please advise.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Apex, chain duo, double duo

Post by Lyudmil Tsvetkov »

Again, someone should definitely try this.

There is a lot to gain from that.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Why long chains do not work?

Post by Lyudmil Tsvetkov »

Below are my 2 suggested arrays for bonus points for inner pawns of long chains.

The second array is with twice lower values, as it is not certain what size of the bonus might work best.

Code: Select all

 5   8  12  12  8  5                    g3 f3 e3 d3 c3 b3 
 10 15 22 22 15 10                   g4 f4 e4 d4 c4 b4 
 15 22 33 33 22 15                   g5 f5 e5 d5 c5 b5 
 20 30 45 45 30 20                   g6 f6 e6 d6 c6 b6 
 

Code: Select all

 2  4   6   6   4   2                     g3 f3 e3 d3 c3 b3 
 5  7  11  11  7  5                     g4 f4 e4 d4 c4 b4 
 7 11 16  16 11  7                    g5 f5 e5 d5 c5 b5 
 10 15 22 22 15 10                   g6 f6 e6 d6 c6 b6 
 
Is somebody able to push one or 2 patches in SF with those arrays, to check how they would perform in relation to using the connected array, that is highly inconsistent, at least what concerns long chain implementation?

You only need to specify what an inner pawn is, you know shift down/shift up, shift left/shift right :) , and then apply the array. Stefan Geschwentner already did this in the past with the connected array, so you might look at his patch.

What a pity Stefan is not around nowadays...

Of course, everything might fail because of tuning problems, but at least we will have some indication as to how long chains perform under different conditions and what should be done for a successful patch.

Mg and eg bonus might be left just the same for a start.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Apex, chain duo, double duo

Post by Lyudmil Tsvetkov »

Taking a position from the Arasan test suite:

[d]3q1r1k/2r2pp1/p6p/1pbppP1N/3pP1PP/3P1Q2/PPP4R/5RK1 w - - 0 1

Leto claims in the next thread that none of the engines tested, Komodo 8/9, SF, Houdini tactical and non-tactical are able to solve this position.

best move: g4-g5

well, you see what happen in terms of eval, currently white has an apex pawn on f5, after playing g4-g5 that apex pawn disappears, but in its place appear 2 chain duo pawns on f5 and g5 respectively. Not just duo pawns, or phalanxes, as SF calls them, but chain duo pawns, which are stronger than mere duo pawns, as f5 and g5 are next to each other, but apart from that f5 is additionally supported by white e4 pawn, while g5 by white h4 pawn.

This makes a big distinction, creating a larger and very compact pawn phalanx of several pawns, that is much stronger than a mere duo. Big distinction in eval here.

So, it is wrong not to consider apex pawns, but also chain duo pawns separately. They all have their particular eval meaning, strictly chess knowledge-based.
Double duos, a pawn adjacent to 2 own pawns on the same rank on adjacent files, are also meaningful, although somewhat weaker. They also should be scored separately in eval.

Again, a pawn having 2 own pawns on adjacent files on the same rank, one rank in fron or one rank behind means that this pawn connectes and creates a larger phalanx of pawns, whether chain or not, and larger phalanxes of pawns are stronger, they have additional value over the mere connected pawns.

The task of a good evaluator is to find those intermediate pawns of a larger pawn phalanx, consisting of at least 3 pawns, that give added value, in distinction to those intermediate pawns of larger phalanx pawn structures that give no added value, or are even a liability.

Apex pawns, chain duos, double duos, inner pawns of long chains and other represent assets.
There are neutral intermediate pawns, like for example a pawn next to another own pawn on the same rank and defending an own pawn. Not necessary to score these.

There are intermediate pawns that are harmful, for example a pawn defending 2 own pawns, which is very weak, as a weak target, upon which depend other pawns.

So you must pick the right elements to evaluate.

Some diagrams for intermediate pawns of larger pawn phalanxes.

[d]6k1/8/8/8/3P4/2P1P3/8/6K1 w - - 0 1
d4 apex pawn; very strong intermediate phalanx pawn

[d]6k1/8/8/8/3PP3/2P5/8/6K1 w - - 0 1
d4 chain duo pawn; considerably strong intermediate phalanx pawn, though weaker than an apex

[d]6k1/8/8/8/2PPP3/8/8/6K1 w - - 0 1
d4 double duo pawn; represents an asset as an intermediate phalanx pawn, but is weaker than chain duo pawn

[d]6k1/8/8/4P3/3P4/2P5/8/6K1 w - - 0 1
d4 inner pawn of a long chain; represents a significant asset as an intermediate phalanx pawn, the strongest of all intermediate phalanx pawns, but its value is hidden in the strength of the long chain as an unit, where other parts of the long chain, especially the spearhead, get their specific bonus points, and therefore the inner pawn itself might get just a small overbonus.

[d]6k1/8/8/4P3/2PP4/8/8/6K1 w - - 0 1
d4 intermediate phalanx pawn, adjacent to one own pawn and defending another own pawn; does not represent an additional asset in any way, but should not be also a liability

[d]6k1/8/8/2P1P3/3P4/8/8/6K1 w - - 0 1
d4 base pawn of a chain, defending 2 own pawns at the same time; represents a liability as an intermediate phalanx pawn, so only a penalty here, but of course the pawns it defends should get their nice bonus points too

etc., etc.

So, as you see, there are many different intermediate phalanx pawns with different chess meaning.

As far as I know, of the above 4 elements, deserving nice bonus points additionally, SF currently scores just one, and I am certain in an insatisfactory way.

How would you like that modern engines play good chess, when they lack in their eval more than 3/4 of all meaningful pawns?
Of course, they play poor chess, only thing that saves them is their tremendous tactical ability.