lantonov wrote:There is the following about this patch on Stefan's github:
=================================================
Rocky
LOL, you are about to break the record for most dimensions for an array !
Connected[2][2][2][2][RANK_NB];
But I'm not sure about this long chain bonus...
If WHITE have a long chain, normally, BLACK will have one too...
and the bonus cancels out.
---------------------------------------------------------------------------------------
Stefan Geschwentner
@Rocky
if we give an equal bonus for each pawn then mostly yes. But here we use a fraction of connected bonus which increase with rank, so the more advanced chain gets a bigger bonus. And with the last factor of 1/16 only the 5th and 6th rank get actual a significant bonus.
Do not have the time to post specific diagrams now, but I have looked at it closely, and 2 own and enemy longer chains almost never cancel out in practice, unless they are large blocked pawn chains, which happen relatively rare.
So I would say, long own and enemy chains would cancel in about 20% of all cases at most.
Usually, one side has a longer chain, while the other does not, or one side has 2 longer chains, while the other just one, etc. They differ also in terms of ranks in the majority of cases, even if each side has exactly one long chain.
If you would be interested in a breakdown, I have looked a bit at the numbers, in standard human games 3-pawns chains constitute about 70-80% of all cases, followed by 4-pawns chains, seen in about 20% of cases, 5 and 6-pawns chains being extremely rare, taking the rest of the share.
But, this is just standard human chess from top competitions. I guess in computer chess long chains happen even much less frequently, as computers simply do not understand the concept, and that could explain why a patch could perform not well - you simply waste your calculation resources on most positions with no real added value.
So that there are different combinations of long chains: one side having chain of 3 and the other having none, or one side having chain of 4 and the other having none, or one side having chain of 5 and the other having chain of 3, etc.
So that in practice long chains almost never cancel out, except in the case of very long blocked chains, but in such case you would consider pointed chain bonus with even bigger effect.
And yes, I forgot to mention, that the usual state of chain/defended pawns on the board is a chain of 2 - one supporting and one supported pawn, which configuration happens in about 80% of cases.
So that chains of 2 are somewhere 5 times more frequent than long chains.
That might explain why the bonus for a random chain pawn is not redundant with an additional bonus for inner pawns of a longer chain, and also why you would need much more careful tests on longer chains.
Lyudmil, thanks for feeding the discussion.
When you have migrated to C++11, you might push a patch with 1/32 values.
