Outside Passed Pawns

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Outside Passed Pawns

Postby Grant Osborne » 08 Aug 2007, 13:14

Hello everyone

Doing a Google search on "outside passed pawn" I find the following:-

Outside Passed Pawn
Definition
A passed pawn that is near the edge of the board and far away from other pawns.

I could determine if white had an outside passed pawn by first condensing all the pawns down to 8 bits with a bit of magic then look up a pre-computed table[8][256] :-

Code: Select all
square = lsb(WhitePassedPawns);
   rankOccupancy = (int) ((AllPawns * 0x0101010101010101) >> 56);
   outsidePassed = table[COL(square)][rankOccupancy];

But this is not strictly accurate... is it?
If white had a passed pawn on a5 far and away from other pawns except for a black pawn on b4, the above code would not find the outside passed pawn. So maybe I should mask off any black pawns that are behind the passed pawn :-

Code: Select all
square = lsb(WhitePassedPawns);
   temp = (pawnMask[ROW(square)] & BlackPawns) | WhitePawns;
   rankOccupancy = (int) ((temp * 0x0101010101010101) >> 56);
   outsidePassed = table[COL(square)][rankOccupancy];

What if white only had one pawn? This code would then treat white's only pawn as being outside passed, which is not possible. So maybe I should check that white has at least 2 pawns :-

Code: Select all
if (WhitePawns & WhitePawns - 1) {
      square = lsb(WhitePassedPawns);
      temp = (pawnMask[ROW(square)] & BlackPawns) | WhitePawns;
      rankOccupancy = (int) ((temp * 0x0101010101010101) >> 56);
      outsidePassed = table[COL(square)][rankOccupancy];
   }
   else
      ousidePassed = FALSE;

The above definition of outside passed pawns seems ambiguous to me and I am not clear as to the best way of coding it. Any help would be appreciated.

Thanks
Grant
User avatar
Grant Osborne
 
Posts: 69
Joined: 16 Jun 2006, 14:05

Re: Outside Passed Pawns

Postby Gerd Isenberg » 08 Aug 2007, 17:28

Hi Grant,

each pawn has according to Kmoch a lee- and a luff-side, a back-span and a front-span. The lee-side is always the shorter side and is "zero" for rook-pawns.

What about following definition:

A passer with the shortest lee-side is the outpost passer if there are friendly pawns on the other wing.

Thus if the passer is on a-d there must be pawns on e-h and vice versa. The shorter the lee-side, the stronger the outpost passer.
The longer the max of all luff-sides of all other friendly pawns on the other wing, the stronger the outpost passer as well...

Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: Outside Passed Pawns

Postby Pradu » 08 Aug 2007, 18:28

Grant Osborne wrote:Hello everyone

Doing a Google search on "outside passed pawn" I find the following:-

Outside Passed Pawn
Definition
A passed pawn that is near the edge of the board and far away from other pawns.


I could determine if white had an outside passed pawn by first condensing all the pawns down to 8 bits with a bit of magic then look up a pre-computed table[8][256] :-

Code: Select all
square = lsb(WhitePassedPawns);
   rankOccupancy = (int) ((AllPawns * 0x0101010101010101) >> 56);
   outsidePassed = table[COL(square)][rankOccupancy];

But this is not strictly accurate... is it?
If white had a passed pawn on a5 far and away from other pawns except for a black pawn on b4, the above code would not find the outside passed pawn. So maybe I should mask off any black pawns that are behind the passed pawn :-

Code: Select all
square = lsb(WhitePassedPawns);
   temp = (pawnMask[ROW(square)] & BlackPawns) | WhitePawns;
   rankOccupancy = (int) ((temp * 0x0101010101010101) >> 56);
   outsidePassed = table[COL(square)][rankOccupancy];

What if white only had one pawn? This code would then treat white's only pawn as being outside passed, which is not possible. So maybe I should check that white has at least 2 pawns :-

Code: Select all
if (WhitePawns & WhitePawns - 1) {
      square = lsb(WhitePassedPawns);
      temp = (pawnMask[ROW(square)] & BlackPawns) | WhitePawns;
      rankOccupancy = (int) ((temp * 0x0101010101010101) >> 56);
      outsidePassed = table[COL(square)][rankOccupancy];
   }
   else
      ousidePassed = FALSE;

The above definition of outside passed pawns seems ambiguous to me and I am not clear as to the best way of coding it. Any help would be appreciated.

Thanks
Grant


I agree; the definition seems too ambiguous. Let's take this one (I hope it is ok): An outside passed pawn is pawn that is on file A or file B or file G or file H. The fact that it is a passer automatically makes it far away from other opponent pawns. If you want to determine if you have an outside passer I guess you could just & the passer bitboard with files A,B,G, and H; lets call this bitboard OP (outside passer). If you want to determine the number of outside passed pawns you could use your population count subroutine on OP. If you want to use a piece square table values for the location of each outside passed pawn, you could do a loop with a bitscan. If you want to do it without the loop or bitscan you could use a magic hashing scheme. For this you have 12-bits on either side with restrictions on the arrangement of the possible 8-bits that could be "active". Then, knowing your possible input keys, I guess you'd use whatever method you use to generate your magic key. The minimum database index size if you do it all at once would be approximatly (log(8*24+7*23+6*22+5*21+4*20+3*19+2*18+17))/(log 2) = 10-bits. The maximum would be 24-bits. However, I doubt magic would be faster here than a loop because there are few outside passers usually in a game. Just a quick note ... I don't think (temp * 0x0101010101010101) will work if you have doubled pawns because of the carry. Perhaps the fillUp and fillDown routines would work better (but slower :\)

EDIT: Just read Gerd's post ... seems I misunderstood what an outside passer is...
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: Outside Passed Pawns

Postby Gerd Isenberg » 08 Aug 2007, 19:35

I think even on center files you may have outpost passers - but of course they are more likely (and stronger) on rook- or knight files. I think a minimum file-distance of three (or seldomly two?) is required from the outside passer to the most distant friendly pawn, likely on the other wing. File-distances 4..7 are even better.

5k2/8/6p1/7p/3P3P/8/6K1/8 w - -
5k2/8/7p/6p1/3P2P1/8/6K1/8 w - -

Opponent pawn structure, usually a majority on the other wing should ideally be a rammed or backward pawn chain without advanced candidates or good levers, so that no pawn may advance successfully without king support - and the king of the passer side may enter to flood the base while the opponent king has to take care of the outpost.

Of course you are right with using filldown instead of mul 0x0101... due to multiple pawns per file. But you need front- and back spans anyway if you deal with that pawn stuff.

Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: Outside Passed Pawns

Postby Grant Osborne » 08 Aug 2007, 20:19

O.K. so allow for a minimum file distance of 3 (or possibly 2) between the passed pawn on one wing (file a-e or d-h) and other friendly pawns on the other wing. mul ox0101... obviously does not work here so substitute a fillDown routine.

But what about opponent pawns? Does the definition of a friendly outside passer depend on the opponent having the majority of his pawns on the opposite wing or can we just dispense with enemy pawns altogether? Or maybe my suggestion of masking off enemy pawns that are behind the outside passer is sufficient?

Grant
User avatar
Grant Osborne
 
Posts: 69
Joined: 16 Jun 2006, 14:05

Re: Outside Passed Pawns

Postby Gerd Isenberg » 08 Aug 2007, 21:40

Grant Osborne wrote:O.K. so allow for a minimum file distance of 3 (or possibly 2) between the passed pawn on one wing (file a-e or d-h) and other friendly pawns on the other wing.
Grant

No, the minimum distance to the most file-distant friendly pawn on the other wing (or even center). Here the distance is 7 and 3 in the second diagram:
4k3/8/5p1p/6p1/P5P1/5P1P/8/4K3 w - -
4k3/8/5p1p/6p1/3P2P1/5P2/8/4K3 w - -
The idea is to get the most distant pawn on the other wing a passer. It becomes more likely outside the square of the opponent king aka the outpost passer.
Grant Osborne wrote:But what about opponent pawns? Does the definition of a friendly outside passer depend on the opponent having the majority of his pawns on the opposite wing or can we just dispense with enemy pawns altogether? Or maybe my suggestion of masking off enemy pawns that are behind the outside passer is sufficient?

Grant

I like to keep all kind of sets for a while, starting with fillups and downs of pawns of both colors and their attacks. It makes sense to keep disjoint as well as some often used combined sets - to calculate from general to specialized, conditional sets with rather singular properties. Some exclude, others not, some are subsets of others. A brief enumeration: open pawns (don't intersect front-spans of opponent pawns), passers (subset of open - they don't intersect front-spans of opponent pawns as well their attacks), doubled (pawns behind, pawns before), tripled, rams, levers, duos, isolanis, half-isolanis, hanging open pawns (the hanging duo), backward (hidden or "real" if open), advanced backward , defended, not defendable, ilands, groups, majorities, minorities, chains, double chains, base and top of chains, "weak"-pawns, lever-possibilities (e.g. against the base of a chain), (advanced) candidates, guards and/helper pawns, passers or candidates out of opponent king square. Finally you get one or more sets (for different degrees like backward ram, ram, backward) of immobile pawns. Even if you have some mobile pawns left, which safely may push without a lever, but are rammed or backward afterwards, they may enter the club of immobiles.

If all opponent pawns are immobile in that sense, the outpost passer becomes very strong - but one probably has to prove whether the king may reach the base and is not hindered by own immobile pawns and fixed or rammed opposite pawn attacks. If those conditions fit, the number of pawns don't cares, whether it is a "backward majority" (likely with equal material) or not.

Otherwise with mobile pawns things become more complicated and several features interfere as usual - a good measure is the "best" front-span of passers and candidates. Huge rank-differences are almost decisive.

Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: Outside Passed Pawns

Postby Pradu » 08 Aug 2007, 21:55

Gerd Isenberg wrote:I like to keep all kind of sets for a while, starting with fillups and downs of pawns of both colors and their attacks. It makes sense to keep disjoint as well as some often used combined sets - to calculate from general to specialized, conditional sets with rather singular properties. Some exclude, others not, some are subsets of others. A brief enumeration: open pawns (don't intersect front-spans of opponent pawns), passers (subset of open - they don't intersect front-spans of opponent pawns as well their attacks), doubled (pawns behind, pawns before), tripled, rams, levers, duos, isolanis, half-isolanis, hanging open pawns (the hanging duo), backward (hidden or "real" if open), advanced backward , defended, not defendable, ilands, groups, majorities, minorities, chains, double chains, base and top of chains, "weak"-pawns, lever-possibilities (e.g. against the base of a chain), (advanced) candidates, guards and/helper pawns, passers or candidates out of opponent king square. Finally you get one or more sets (for different degrees like backward ram, ram, backward) of immobile pawns. Even if you have some mobile pawns left, which safely may push without a lever, but are rammed or backward afterwards, they may enter the club of immobiles.

If all opponent pawns are immobile in that sense, the outpost passer becomes very strong - but one probably has to prove whether the king may reach the base and is not hindered by own immobile pawns and fixed or rammed opposite pawn attacks. If those conditions fit, the number of pawns don't cares, whether it is a "backward majority" (likely with equal material) or not.

Otherwise with mobile pawns things become more complicated and several features interfere as usual - a good measure is the "best" front-span of passers and candidates. Huge rank-differences are almost decisive.

Gerd
Wow! Your pawn eval looks really good. I tried looking up on Google some of the terms you used before by Kmoch like front-span, isolanis and duos but could find hardly any websites. I guess the book with all of these pawn subsets and terms defined would be Pawn Power in Chess by Hans Kmoch?

EDIT: managed to find a partial glossary :mrgreen:
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: Outside Passed Pawns

Postby Gerd Isenberg » 08 Aug 2007, 22:12

Pradu wrote:Wow! Your pawn eval looks really good. I tried looking up on Google some of the terms you used before by Kmoch like lee-side, front-span, isolanis and duos but could find hardly any websites. I guess the book with all of these pawn subsets and terms defined would be Pawn Power in Chess by Hans Kmoch?


Yes, Die Kunst der Bauernführung. A english/german glossary of Kmoch terms would be great ;-)

I my current 32-bit eval I have only partly implemented all that stuff and I am trying to do it better now with a cleaner design, more efficiently but some huge tables, indexed by enumarated pawn features. I fear my pawn-hash entries will become quite huge ;-)
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: Outside Passed Pawns

Postby bob » 09 Aug 2007, 06:15

I think what you want is that the outside passer needs to be at least one file removed from the pawns on the other side. When you think about it, this is enough in most positions. You want to establish a dominant king position, and the easiest way is to push your outside passer until your opponent is forced to chase it down and capture it, leaving your king closer. with pawns on a,b,c files, a passer on the e,f,g or h files would be an outside passer. This is pretty easy to do with bitboards and 8-bit masks for which files have a passed pawn on them for each side. You can also catch double-outside-passed pawns (where you have a passer on both wings with the main pawn mass in the center. This is even stronger. And then when you have two passed pawns, the farther separated they are, the better. The list goes on and on...
User avatar
bob
 
Posts: 156
Joined: 10 May 2006, 17:59

Re: Outside Passed Pawns

Postby Grant Osborne » 09 Aug 2007, 10:22

Gerd, thanks for your answer but for my more simplistic pawn evaluation I first need to establish that I have an outside passed pawn, and am now wondering how much of a part opponent pawns play in it's determination - if you see what I mean?

Bob wrote:
I think what you want is that the outside passer needs to be at least one file removed from the pawns on the other side.


Here again there is a vagueness - "pawns on the other side" does not tell me whether you mean friendly pawns, enemy pawns or both.

8/8/3kppp1/Pp6/4P1P1/2PK1P2/8/8 w - -

In this position, to my mind, white has an outside passed pawn even though there is a pawn on the b-file. However, if you remove the enemy pawns (or mask off enemy pawns behind the passer) it is then clear that white's passer is indeed "at least one file removed from the pawns on the other side"

Grant
User avatar
Grant Osborne
 
Posts: 69
Joined: 16 Jun 2006, 14:05

Re: Outside Passed Pawns

Postby bob » 09 Aug 2007, 19:43

Grant Osborne wrote:Gerd, thanks for your answer but for my more simplistic pawn evaluation I first need to establish that I have an outside passed pawn, and am now wondering how much of a part opponent pawns play in it's determination - if you see what I mean?

Bob wrote:
I think what you want is that the outside passer needs to be at least one file removed from the pawns on the other side.


Here again there is a vagueness - "pawns on the other side" does not tell me whether you mean friendly pawns, enemy pawns or both.

8/8/3kppp1/Pp6/4P1P1/2PK1P2/8/8 w - -

In this position, to my mind, white has an outside passed pawn even though there is a pawn on the b-file. However, if you remove the enemy pawns (or mask off enemy pawns behind the passer) it is then clear that white's passer is indeed "at least one file removed from the pawns on the other side"

Grant


What I am looking for is to reach a position with your king two files farther removed from the rest of the pawns than mine. If all that is left are my pawns, this is all moot. So typically what we have is I have a passer on (say) the d-file, and then g-h pawns, while you have f-g-h pawns (all is equal). But your king can't defend your pawns nor attack mine until you take care of my passer. That gives my king a chance to penetrate and eat your pawns before you can do anything. It is kind of a trade... I trade my outside passer for several of your remaining pawns and run my own in then...

It really isn't that "vague" when you think about it. The more "distant" the passer, the easier the win.

In your example, nothing has changed. You (white) have a passer that is distant. It isn't as clear as when the b-pawn is not present, but in this position it works exactly the same. Advance your king, and then you eat the b-pawn after forcing black to eat the a-pawn. Now your c-pawn is the distant passer and you repeat the cycle again...
User avatar
bob
 
Posts: 156
Joined: 10 May 2006, 17:59

Re: Outside Passed Pawns

Postby Gerd Isenberg » 09 Aug 2007, 20:23

Grant Osborne wrote:Gerd, thanks for your answer but for my more simplistic pawn evaluation I first need to establish that I have an outside passed pawn, and am now wondering how much of a part opponent pawns play in it's determination - if you see what I mean?

Bob wrote:
I think what you want is that the outside passer needs to be at least one file removed from the pawns on the other side.


Here again there is a vagueness - "pawns on the other side" does not tell me whether you mean friendly pawns, enemy pawns or both.

8/8/3kppp1/Pp6/4P1P1/2PK1P2/8/8 w - -

In this position, to my mind, white has an outside passed pawn even though there is a pawn on the b-file. However, if you remove the enemy pawns (or mask off enemy pawns behind the passer) it is then clear that white's passer is indeed "at least one file removed from the pawns on the other side"

Grant

Ok, here black has one open, half-free pawn on b5, but a white guard on c3. b5 is not really backward in the strict sense, since it is more advanced than his backward c3 counterpart - and since some definitions (not Kmoch's) may exclude isolated from being backward pawns. Anyway, b5 suffers from isolated backwardness and becomes member of the (slightly) immobile.

On the king wing the black pawns are mobile but can't force a passer - trios on same files, no open pawn, no candidate or advanced break through formation like black f4,g4,h4 against white f2,g2,h2 in the best case.
Only one lever-possibility with equal number of guards and helpers and two ram-possibilities, both making f6 hidden backward (one helper less).

The important thing is that the white king is near the center and has a shorter path to the critical squares c5, to reach either the targets b5 or d6,e6,f6,g6 than the black king via a7/a8 may reach either b5 or d6...

Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 11 guests