I wonder if the code to detect unstoppable passed pawns in stockfish in endgames is productive for playing strength.
Did the developers test it?
The reason is that it is clear that there are cases of huge evaluation errors
and as a chess player I prefer a program that know nothing about unstoppable pawns and not a program that can give me huge errors in evaluation(because at least in the first case I can have more confidence that a huge score really means winning)
Of course stockfish see that white wins by search in the following diagrams but if this position is a leaf of the tree it may cause stockfish to get a wrong decision(when without the code it ha chances not to make it)
New game - Stockfish 1.8 JA
[d]6k1/p7/P6p/8/1P6/8/8/K7 b - - 0 1
Analysis by Stockfish 1.8 JA:
1...h6-h5
-+ (-6.14) Depth: 1 00:00:00
New game - Stockfish 1.8 JA
[d]7k/p1K5/P6p/8/1P6/8/8/8 b - - 0 1
Analysis by Stockfish 1.8 JA:
1...h6-h5
-+ (-4.96) Depth: 1 00:00:00
[d]7k/ppp5/8/PPP4p/8/8/5P2/K7 w - - 0 1
Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
If this restriction does not work in testing then at least it may be better to reduce the bonus for unstoppable passed pawn in cases that there is an opponent pawn that may promote.
Uri
unstoppable passed pawns in stockfish
Moderator: Ras
-
- Posts: 10895
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
-
- Posts: 613
- Joined: Sun Jan 18, 2009 7:03 am
Re: unstoppable passed pawns in stockfish
Unstoppable pawn code is very old and from Glaurung times. It has some major flaws as you pointed out. On my long TODO list 

Joona Kiiski
-
- Posts: 408
- Joined: Sat Mar 06, 2010 9:28 am
Re: unstoppable passed pawns in stockfish
How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: unstoppable passed pawns in stockfish
I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Namely the code was not accounting for double pawn push correctly.
-
- Posts: 12792
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: unstoppable passed pawns in stockfish
Is the corrected version available?mcostalba wrote:I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Namely the code was not accounting for double pawn push correctly.
Is there a git repository or something of that nature to pull what is always the latest bleeding edge version?
-
- Posts: 613
- Joined: Sun Jan 18, 2009 7:03 am
Re: unstoppable passed pawns in stockfish
This is not a double pawn push issue at all. Look at this position for example:mcostalba wrote: I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.
Namely the code was not accounting for double pawn push correctly.
[d]7k/p7/P7/7p/1P6/8/K7/8 w - - 0 1
Stockfish sees that black has unstoppable passed pawn and he gets a huge bonus. White doesn't get a bonus, but is first to promote!
One idea:Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Loop through opponent's pawns. Find highest relative rank of pawn which is not blocked by enemy pawn. If this pawn is further advanced than unstoppable pawn, give significantly lower unstoppable pawn bonus.
Joona Kiiski
-
- Posts: 408
- Joined: Sat Mar 06, 2010 9:28 am
Re: unstoppable passed pawns in stockfish
In the last position 1.b6 wins for white (pawn breakthrough). Not easy to identify by a non-chess-player.mcostalba wrote:I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Namely the code was not accounting for double pawn push correctly.

But I think it's also not easy to identify by a chess engine without doing search...
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: unstoppable passed pawns in stockfish
Crafty has always evaluated such pawns by giving them a bonus. In crafty, this is called a "hidden passed pawn" where the a pawn is blocked and actually the b-pawn appears to be backward. But due to the advanced square of the A pawn, it promotes very quickly. I probably should go back over all of this stuff again. The problem is that you can't get it right 95% of the time. Whatever you do has to be 100% correct. If a case is not certain, you just don't evaluate it at all. Otherwise, the big search we see today will run all through those holes and create havoc.Ralph Stoesser wrote:In the last position 1.b6 wins for white (pawn breakthrough). Not easy to identify by a non-chess-player.mcostalba wrote:I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Namely the code was not accounting for double pawn push correctly.
But I think it's also not easy to identify by a chess engine without doing search...
-
- Posts: 10895
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
Re: unstoppable passed pawns in stockfish
One condition for a pawn to be unstoppable(without doubt) is that the pawn is more advanced than all the opponent pawns(and if the difference is one rank you need also to have the side to move to be sure that the opponent does not reply promotion by promotion)Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
If this condition does not happen you are not sure or almost sure that the pawn is unstoppable so you may give only a bonus of +1 in the evaluation for the significant probability that the pawn is unstoppable and not a bonus of +5 or +6.
Uri
-
- Posts: 10895
- Joined: Thu Mar 09, 2006 12:37 am
- Location: Tel-Aviv Israel
Re: unstoppable passed pawns in stockfish
Note that I also think that it is better if programs do not evaluate unstoppable passed pawns if they get it correct 95% of the time but my reason is different.bob wrote:Crafty has always evaluated such pawns by giving them a bonus. In crafty, this is called a "hidden passed pawn" where the a pawn is blocked and actually the b-pawn appears to be backward. But due to the advanced square of the A pawn, it promotes very quickly. I probably should go back over all of this stuff again. The problem is that you can't get it right 95% of the time. Whatever you do has to be 100% correct. If a case is not certain, you just don't evaluate it at all. Otherwise, the big search we see today will run all through those holes and create havoc.Ralph Stoesser wrote:In the last position 1.b6 wins for white (pawn breakthrough). Not easy to identify by a non-chess-player.mcostalba wrote:I would think is already coded. In particular the last position is evaluayed wrong due to a bug reported and fixed by Marek some week ago.Ralph Stoesser wrote:How would you code that condition?Uri Blass wrote: Even if the code is productive it may be better to add to the code a condition that a pawn is unstoppable only if there is not an opponent pawn that may promote earlier or at the same time based on the opponent pawn rank.
Namely the code was not accounting for double pawn push correctly.
But I think it's also not easy to identify by a chess engine without doing search...
I do not claim to know that the advantage in games is not bigger than the disadvantage(The only way to know is by testing that I did not do).
I simply want to know that I can trust a big score that I see in pawn endgames(and I feel that I can trust more high scores of programs with no knowledge of unstoppable passed pawns)
I also think that programs without high scores for something that can be wrong can be more aggresive in pruning based on evaluation in the endgame so the improvement in the evaluation can cause a new change in the search to be productive.
Uri