I'am a very bad chess playerRalph Stoesser wrote: You don't have to. Only $ELO makes the world go round...
Nevertheless, from a chess player's point of view this is a very stupid behauviour from SF and possibly many other engines.

Moderator: Ras
I'am a very bad chess playerRalph Stoesser wrote: You don't have to. Only $ELO makes the world go round...
Nevertheless, from a chess player's point of view this is a very stupid behauviour from SF and possibly many other engines.
Passed pawns are very important factor and need a special code. It seems to be impossible to improve it by a general code. Probably a main difference between engines is: how engine handle with the theme “passed pawns” (excluding that all are clonesmcostalba wrote:I don't have any patch to show, sorry. Actually I am not very interested in tweaking for a given position. I consider good a patch that proves to increase strength in a real games test session: I don't care how it behaves in specific positions.Ralph Stoesser wrote:
All the proposed patch attempts do work well with this position. Except the patches from SF team, because, so far, they haven't shown any.![]()
I was watching a game Fire 13 - SF 171 (4 min.+2 sec.). SF had helped Fire to get a side passed pawn (in Bishop endgame!mcostalba wrote: I'am a very bad chess player
After the above moves and ..Kd7 is not so obvious that white wins:lech wrote: SF moved 1…a3 2.b3 Bxc3 3.Bxa3 and in the next moves Fire by a2->a4 got the side passed pawn.
Of course, the way to win is not obvious one. But Fire, thanks to the passed pawn, methodically increased advantage and won. Sorry, I haven’t all the game. I remember only that I tested later this position and Fire proposed 1…Kd7 (P4 3.5G 2hreads). The right side (pawn structure) could be other.mcostalba wrote: After the above moves and ..Kd7 is not so obvious that white wins:
[d] 8/2pk1p1p/3p2p1/1p1P4/6P1/BPb2P2/P3K2P/8 w - - 0 3
I have quickly tried some engine, but result is almost draw with just a small advantage for white...
Code: Select all
int r = int(relative_rank(Us, s) - RANK_2);
int tr = Max(0, r * (r - 1));
Yes, you are right. Thanks Ralph.Ralph Stoesser wrote:Why use Max() here? tr can't become negative.
evaluate.cpp, line 892+893Code: Select all
int r = int(relative_rank(Us, s) - RANK_2); int tr = Max(0, r * (r - 1));
I don't quite follow, relative_rank(Us, s) can be == RANK_2 if the passed pawn is still on the original rank, in which case r == 0.Ralph Stoesser wrote:Why use Max() here? tr can't become negative.
evaluate.cpp, line 892+893Code: Select all
int r = int(relative_rank(Us, s) - RANK_2); int tr = Max(0, r * (r - 1));
Code: Select all
while (b)
{
Square s = pop_1st_bit(&b);
assert(pos.piece_on(s) == piece_of_color_and_type(Us, PAWN));
assert(pos.pawn_is_passed(Us, s));
int r = int(relative_rank(Us, s) - RANK_2);
int tr = Max(1, r * (r - 1));
Not quite sure I am following. Are you worrying about the result of 0 * -1 being negative?Eelco de Groot wrote:
I don't quite follow, relative_rank(Us, s) can be == RANK_2 if the passed pawn is still on the original rank, in which case r == 0.
What did I miss![]()
Ah, I see now, I missed that, thanks Sam, but what if a technically illegal position has a passed pawn on the bottom rank, RANK_1. In that case r really is negative and tr for RANK_1 becomes greater than for RANK_2, which is not what you really want. Not that it often would be a problem but in that case the code does not work with Max either, I agree. Maybe r has to be positive at all times that would be better, so something like tr = r * (r-1) + 1 I had been thinking about that because in my version of the code tr == 1 for both RANK_2 and RANK_3 so that is slightly illogical maybe (but bonuses are made from both tr and r * r so there still is enough difference). Not sure it would be better though. And tr for RANK_1 is still greater than RANK_2 then.BubbaTough wrote:Not quite sure I am following. Are you worrying about the result of 0 * -1 being negative?Eelco de Groot wrote:
I don't quite follow, relative_rank(Us, s) can be == RANK_2 if the passed pawn is still on the original rank, in which case r == 0.
What did I miss![]()
-Sam