passed pawn question

Discussion of chess software programming and technical issues.

Moderator: Ras

asanjuan
Posts: 214
Joined: Thu Sep 01, 2011 5:38 pm
Location: Seville, Spain

passed pawn question

Post by asanjuan »

I've been working with the passed pawn detection in Rhetoric, and I found an interesting position.

[d]

The wiki says:
A passed pawn, also called free pawn or passer, is a pawn with no square on its way to queening controlled or occupied by opponent pawns. In case of doubled pawns, it is wrong to score the back twin as passed, even if it meets the above conditions. Therefor, the passer requires his front span disjoint from all other pawns as well from opponent pawn attacks.
So the question is: Is the pawn on a3 a passed pawn or not? Rhetoric says yes in his static eval. What do you think?

Regards.
Alberto.
Still learning how to play chess...
knigths move in "L" shape ¿right?
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: passed pawn question

Post by zullil »

asanjuan wrote:I've been working with the passed pawn detection in Rhetoric, and I found an interesting position.

[d]

The wiki says:
A passed pawn, also called free pawn or passer, is a pawn with no square on its way to queening controlled or occupied by opponent pawns. In case of doubled pawns, it is wrong to score the back twin as passed, even if it meets the above conditions. Therefor, the passer requires his front span disjoint from all other pawns as well from opponent pawn attacks.
So the question is: Is the pawn on a3 a passed pawn or not? Rhetoric says yes in his static eval. What do you think?

Regards.
Alberto.
Is this a Rhetoric-al question? :D
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: passed pawn question

Post by hgm »

I would not call that a passed Pawn. The problem if you do is that the engine will count itself rich in the eval when it is to move, and happily stand pat with a fail high because of the large passer bonus.

But if it would not be actually able to push the Pawn (a2 or axb2), it would be the opponent's turn, and he would play bxa3, and *poof* goes your advantage. You must force the engine to prove that he can secure the Pawn, or you will be letting it act on imagined advantages. There are only two ways to escape the exchange, and they could very easily both be tactically forbidden.
BubbaTough
Posts: 1154
Joined: Fri Jun 23, 2006 5:18 am

Re: passed pawn question

Post by BubbaTough »

Interesting position. As a human I don't think of it as a passed pawn, but I don't see why not to in a chess engine. If you end up testing it both ways in games, I would be interested in hearing what your results are.

-Sam
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: passed pawn question

Post by bob »

asanjuan wrote:I've been working with the passed pawn detection in Rhetoric, and I found an interesting position.

[d]

The wiki says:
A passed pawn, also called free pawn or passer, is a pawn with no square on its way to queening controlled or occupied by opponent pawns. In case of doubled pawns, it is wrong to score the back twin as passed, even if it meets the above conditions. Therefor, the passer requires his front span disjoint from all other pawns as well from opponent pawn attacks.
So the question is: Is the pawn on a3 a passed pawn or not? Rhetoric says yes in his static eval. What do you think?

Regards.
Alberto.
I would say no. Can you safely take on b2? Hard for eval to figure that out. Can you safely push to a2? Ditto. If the b pawn was missing, I would say yes. But I don't currently score a3 as passed in my code.
BubbaTough
Posts: 1154
Joined: Fri Jun 23, 2006 5:18 am

Re: passed pawn question

Post by BubbaTough »

bob wrote: I would say no. Can you safely take on b2? Hard for eval to figure that out. Can you safely push to a2? Ditto. If the b pawn was missing, I would say yes. But I don't currently score a3 as passed in my code.
The pawn is passed in the sense that no pawn is blocking its advance. Generally speaking, most people still count positional features even if the piece generating them is threatened. In this way they allow the qsearch to determine if the pawn capture is relevant. For example, if a rook is on the 7th but is attacked by a bishop, usually the evaluation still gives it the bonus for being on the 7th.

The only real way to test which definition of passed pawn is better is by playing a lot of games. I don't think an answer can be definitively arrived at by logic. After the test games have been played, then one can retroactively justify them to the heart's delight.

-Sam
xmas79
Posts: 286
Joined: Mon Jun 03, 2013 7:05 pm
Location: Italy

Re: passed pawn question

Post by xmas79 »

I would say yes. This is not a quiet position, so an engine should not call eval here. But even if an engine calls eval in this position (as inner node evals), I think it's better to evaluate this as a passed pawn. Pushing to a2 is an easy win, so let's score it high and let (eventually) the q-search reject that idea. a2! easy win:

1. ... a2 (threatening a1Q)
2. Rd1 (white checks are simply non-sense) Re7 (idea Re1+ and excange rooks)
3. Kf1 Re1+!!

My two cents...
Natale.
syzygy
Posts: 5911
Joined: Tue Feb 28, 2012 11:56 pm

Re: passed pawn question

Post by syzygy »

If you can't safely play a2 (or axb2), I would not want to evaluate it as a passed pawn.

If you want to evaluate the pawn as a passed pawn, it seems your evaluation should verify that it is black's turn to move and that black can safely play either a2 or axb2. It seems to me that this is pushing things into the evaluation that can be better left to the search, but maybe it is worth while.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: passed pawn question

Post by bob »

BubbaTough wrote:
bob wrote: I would say no. Can you safely take on b2? Hard for eval to figure that out. Can you safely push to a2? Ditto. If the b pawn was missing, I would say yes. But I don't currently score a3 as passed in my code.
The pawn is passed in the sense that no pawn is blocking its advance. Generally speaking, most people still count positional features even if the piece generating them is threatened. In this way they allow the qsearch to determine if the pawn capture is relevant. For example, if a rook is on the 7th but is attacked by a bishop, usually the evaluation still gives it the bonus for being on the 7th.

The only real way to test which definition of passed pawn is better is by playing a lot of games. I don't think an answer can be definitively arrived at by logic. After the test games have been played, then one can retroactively justify them to the heart's delight.

-Sam
I think a bit of reasoning can help.

For example, you have a pawn majority. Do you count that as a passed pawn or something less? I count it significantly less, because it is a potential passed pawn, and the placement of enemy pieces or king might make realizing that passed pawn impossible. So a bonus for the threat, but not the full passed bonus.

That logic might work here, but large bonuses that are highly volatile are pretty dangerous based on my tuning experience. If the pawn can't safely advance or capture for whatever reason, the next move black can capture it and the bonus evaporates. I'd like to have the search prove it can hold the pawn first, by either actually pushing or taking on b7 and hanging on to it where black can't trade it at any instant with the simple bxa6.

I could probably modify my passed pawn detection code to handle that easily enough and test, but pretty strong intuition says it is most likely going to be a bit worse. More after I complete the test...
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: passed pawn question

Post by bob »

xmas79 wrote:I would say yes. This is not a quiet position, so an engine should not call eval here. But even if an engine calls eval in this position (as inner node evals), I think it's better to evaluate this as a passed pawn. Pushing to a2 is an easy win, so let's score it high and let (eventually) the q-search reject that idea. a2! easy win:

1. ... a2 (threatening a1Q)
2. Rd1 (white checks are simply non-sense) Re7 (idea Re1+ and excange rooks)
3. Kf1 Re1+!!

My two cents...
Natale.
There are many ways to create this exact same pawn configuration, where pushing is not an easy win. For example, an enemy bishop on b1. And put an enemy rook on a1 with your queen on a8 and you also can't play axb7 safely, it would depend on whether after axb2 Rxa8 the opponent still has b1 covered so you can't push. Too much dynamic stuff going on, IMHO...

Evals have lots of error, but I think it better to generally err on the conservative side to avoid a highly volatile eval that makes the tree search unstable with serious horizon effect issues.