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.
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}
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.
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.
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.
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.
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.