Can't believe (underpromotion)

Discussion of chess software programming and technical issues.

Moderator: Ras

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

Can't believe (underpromotion)

Post by xmas79 »

NGN - FairyMax
Well... Sometimes it pays: [d]5b2/3P1k2/2q1R3/6R1/7p/4N1p1/5p1p/5K2 w - - 2 81

FairyMax analysis:

Code: Select all

  5	+4.38 	18435  	0:00.01	Kf7 81. Rxc6 h1=Q 82. Ke2 f1=Q 83. Nxf1 Qxc6 
  4	+4.38 	375      	0:00.00	Kf7 
  3	+4.38 	54        	0:00.00	Kf7 
  2	+4.38 	49        	0:00.00	Kf7 
  1	+4.38 	48        	0:00.00	Kf7 
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Can't believe (underpromotion)

Post by stegemma »

Ops!!! Satana until 2.0.11 plays d8=N but since 2.1.12 it plays Rf5 or other strange moves!

Thanks for the position.
Author of Drago, Raffaela, Freccia, Satana, Sabrina.
http://www.linformatica.com
User avatar
hgm
Posts: 28461
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Can't believe (underpromotion)

Post by hgm »

King Slayer now searches all under-promotions, which was the easiest way to make it consider them legal as input move. It remains a good question how to sort them, though. Even when they capture something you might not want to sort them with the good captures.

I guess the following rules for pruning under-promotions would almost never fail:
* Only consider promotion to Knight if it checks
* Only consider promotion to Rook if promotion to Queen returned a draw score.
Dann Corbit
Posts: 12828
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Can't believe (underpromotion)

Post by Dann Corbit »

hgm wrote:King Slayer now searches all under-promotions, which was the easiest way to make it consider them legal as input move. It remains a good question how to sort them, though. Even when they capture something you might not want to sort them with the good captures.

I guess the following rules for pruning under-promotions would almost never fail:
* Only consider promotion to Knight if it checks
Or captures a major piece. Or if you are losing even with promotion to queen.
* Only consider promotion to Rook if promotion to Queen returned a draw score.
Check in this order:
=Queen
=Knight
=Rook
=Bishop
{last two don't matter since both are extremely rare (except silly ones so that you will lose a bishop instead of losing a queen, for example), Knight promotion is way more than the other two underpromotions for obvious reasons}
User avatar
hgm
Posts: 28461
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Can't believe (underpromotion)

Post by hgm »

Dann Corbit wrote:Or captures a major piece.
Could you give a diagram of what you have in mind? What you capture by under-promotion would be the same as what you would capture when you promote to Queen. Promoting to Knight in order to threaten a Rook doesn't seem to make sense, because even when you can gobble it up for free you would have gained R+N, which is less than gaining Q. So only attacks on a Queen remain, but in general he would just withdraw the Queen, and you would be stuck with a Knight.
Dann Corbit
Posts: 12828
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Can't believe (underpromotion)

Post by Dann Corbit »

Obvious cases like this:
3k4/3q1P1q/8/8/8/8/3QP3/4K3 w - -

But it may also be that the =N+r{subtraction of rook, probably by a fork against queen and rook} combination leads to a quick combination win and the =Q does not.

Personally, I think knight underpromotion should always be examined.
Bishop and Rook are rare, but if the engine is used for analysis it is useless without these features.
User avatar
hgm
Posts: 28461
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Can't believe (underpromotion)

Post by hgm »

Dann Corbit wrote:Obvious cases like this:
[d] 3k4/3q1P1q/8/8/8/8/3QP3/4K3 w - -
Not a very convincing example, as 1. f8=N would leave you after 1... Qh1+ 2. Kf2 Qxd2 with one Knight against two Queens, while 1. f8=Q+ would have you left 2Q vs 2Q. But I understand that you are thinking of a fork attack on two Queens. But the presence of two Queens would of course be a rarity in itself. But even when forking two Queens you should expect the Queens to protect each other, so that you would in the end just give your Pawn to make an opponent Queen go away. Which is equivalent to getting a Queen yourself.

You are right, however, in that one can always devise tactical situations where promoting to Knight is the best move. But if it is not a check, giving it the same status as a bad capture is probably deserved.
User avatar
mhull
Posts: 13447
Joined: Wed Mar 08, 2006 9:02 pm
Location: Dallas, Texas
Full name: Matthew Hull

Re: Can't believe (underpromotion)

Post by mhull »

hgm wrote:
Dann Corbit wrote:Obvious cases like this:
[d] 3k4/3q1P1q/8/8/8/8/3QP3/4K3 w - -
Not a very convincing example, as 1. f8=N would leave you after 1... Qh1+ 2. Kf2 Qxd2 with one Knight against two Queens, while 1. f8=Q+ would have you left 2Q vs 2Q. But I understand that you are thinking of a fork attack on two Queens. But the presence of two Queens would of course be a rarity in itself. But even when forking two Queens you should expect the Queens to protect each other, so that you would in the end just give your Pawn to make an opponent Queen go away. Which is equivalent to getting a Queen yourself.

You are right, however, in that one can always devise tactical situations where promoting to Knight is the best move. But if it is not a check, giving it the same status as a bad capture is probably deserved.
What if rays are best in a promoted pawn, but the extra rays of a Queen would induce stalemate, so a bishop or rook is preferred? An extremely rare circumstance of course.
Matthew Hull
User avatar
hgm
Posts: 28461
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Can't believe (underpromotion)

Post by hgm »

This was covered by my second case, when promotion to Queen (after searching) returns a draw score.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: Can't believe (underpromotion)

Post by kbhearn »

if promotion to N threatens a forced mate it could be better than promotion to Q but it'd be a pretty rare situation. A contrived example position where the best move is gxh8=N with no check :

[d] 3rkb1r/3n1pPp/4p3/q2p3Q/3P4/1PpB4/P1P2P1P/1K1R3R w - - 0 1

I think it'd be pretty safe to include underpromotions other than =N+ with the bad captures where they'd be heavily reduced but the engine would still find the right answer eventually. It's really no different than a sacrifice, sometimes it'll be right, but the vast majority of the time it'll be wrong.