I'd like to discuss an idea of mine, which had been ignored in a different topic, either because it's too obvious, too stupid, or (hopefully) simply irrelevant to that particular topic (I was talking about perft, and my algorithm was wrong; you need to account for the delayed promotion at every subsequent step rather than just the leaf).
During promotion we normally split the search in four. What if we delay the promotion until the promoted piece moves? Until then, the piece would be a superposition of NRBQ, and could simply be recorded as a pawn on the last rank (with adjustments to the material score).
There appears to be potential for significant improvement in search performance. What are the downsides, if any?
Lazy promotions
Moderator: Ras
-
- Posts: 181
- Joined: Sun Dec 08, 2019 8:16 pm
- Full name: Dmitry Shechtman
-
- Posts: 2695
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Lazy promotions
It can deliver check right after promotion even without moving, so that would be a problem because that has impact on the moves the opponent has in his next turn. There are even positions where promoting to knight and giving a fork check is the best move.
I don't even see the improvement in search performance because most of the time, promotion to queen is what will win anyway, and that line will be searched first. Besides, underpromotion is usually only done in main search, but not in QS where most of the nodes are generated.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 181
- Joined: Sun Dec 08, 2019 8:16 pm
- Full name: Dmitry Shechtman
Re: Lazy promotions
I didn't mean a superimposed piece should be ignored, but rather considered as all four possibilities at once, in both move generation and attack detection.
Why is that? Are captures resulting in promotions that rare?Besides, underpromotion is usually only done in main search, but not in QS where most of the nodes are generated.
-
- Posts: 2695
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Lazy promotions
So how would you consider the opponent's king being in check and not in check at the same time e.g. with promotion to queen and knight at the same time?
Or, how would you consider the opponent to be stalemate and not stalemate at the same time? Because there are positions where you have to underpromote to rook to avoid stalemate. If you super-impose all the attack squares, you'll get stalemate because the super-imposition includes all queen attack squares.
QS doesn't only search captures, but also promotions that are non-captures. What is rare is that promotion to something other than queen is the best option, that's why it's usually not done in QS and only in main search.Why is that? Are captures resulting in promotions that rare?Besides, underpromotion is usually only done in main search, but not in QS where most of the nodes are generated.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 28350
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Lazy promotions
No, but it is rare that promotion to other than Q is the best move. Basically the same reason as why one prones 'bad captures' in QS. Just because these have SEE < 0 doesn't mean they cannot be good (e.g. an N x protected P capture could have discovered a Bishop attack on a Queen). It is just statistically unlikely. The under-promotion might SEE-wise look good, as even a Knight is still worth more than a Pawn, but it destroys the possibility to promote to Queen on the next move.
As to ignoring the piece, what checking abilities would you assign to it? Suppose I promote on c8, where I cannot be taken, and the black King is on a7... If I am allowed to make an arbitrary promotion choice only at the start of my next move, I will always be able to capture his King. If he stays on a7 I pick a Knight, and capture him. If he moves I pick a Queen and capture him. Seems he is checkmated! But in real life I have to pick one of the two immediately, and there is no mate.
[Edit] written before I saw Ras' posting.
As to ignoring the piece, what checking abilities would you assign to it? Suppose I promote on c8, where I cannot be taken, and the black King is on a7... If I am allowed to make an arbitrary promotion choice only at the start of my next move, I will always be able to capture his King. If he stays on a7 I pick a Knight, and capture him. If he moves I pick a Queen and capture him. Seems he is checkmated! But in real life I have to pick one of the two immediately, and there is no mate.
[Edit] written before I saw Ras' posting.
-
- Posts: 181
- Joined: Sun Dec 08, 2019 8:16 pm
- Full name: Dmitry Shechtman
Re: Lazy promotions
Easy, it would become Schroedinger's King

There would be different branches in the search tree for different moves by that piece, so the same should apply for different check/checkmate/stalemate outcomes.
Thanks for clarifying that. I'm a newbie, as you may have guessed, so please forgive my ignorance.QS doesn't only search captures, but also promotions that are non-captures. What is rare is that promotion to something other than queen is the best option, that's why it's usually not done in QS and only in main search.
-
- Posts: 2695
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Lazy promotions
The point aren't moves by that piece, it's already the moves the opponent has before that piece even moves. See also HGM's answer for detecting false mates because of the super-imposition. I think it would just make the code more complicated and error-prone while not offering benefits, but you can of course implement that and benchmark it.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 181
- Joined: Sun Dec 08, 2019 8:16 pm
- Full name: Dmitry Shechtman
Re: Lazy promotions
I was considering calling it "Quantum Chess", but that's already taken:
https://chess24.com/en/read/news/quantum-chess
https://chess24.com/en/read/news/quantum-chess
-
- Posts: 3196
- Joined: Fri May 26, 2006 3:00 am
- Location: WY, USA
- Full name: Michael Sherwin
Re: Lazy promotions
leanchess wrote: ↑Mon Apr 13, 2020 2:24 pm I was considering calling it "Quantum Chess", but that's already taken:
https://chess24.com/en/read/news/quantum-chess
Rarely will that ever happen. Once the four moves are placed in the move list the moves have to be sorted. So even if the queen does not cause a cutoff the other promotions can be given a lesser initial value so they are sorted last. By then you really need to look at them anyway. However, by then you are into LMR which makes them use up an insignificant amount of time.During promotion we normally split the search in four
You could name it Astrobleme! Because that is what you want its opponents to be when the game is over.

If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Lazy promotions
Lazy promotions aren't even possible with the current rules of chess. If you delay your promotion and then put the piece down on the next move, you're doing a piece drop. It exists in shogi for example (but I don't know if you can do it with promotions; I don't play shogi). You're changing the game.leanchess wrote: ↑Mon Apr 13, 2020 9:38 am I'd like to discuss an idea of mine, which had been ignored in a different topic, either because it's too obvious, too stupid, or (hopefully) simply irrelevant to that particular topic...
During promotion we normally split the search in four...
What are the downsides, if any?
Why would you split the search in four? You just add each promotion to your move list:
Code: Select all
let promotion_rank = (if side == WHITE { RANK_8 } else { RANK_1 }) as u8;
let promotion = (piece == PAWN) && board::square_on_rank(to_square, promotion_rank);
....
....
if !promotion {
let m = Move {
data: move_data | ((PNONE as u64) << Shift::Promotion as u64),
};
list.push(m);
} else {
for piece in PROMOTION_PIECES.iter() {
let m = Move {
data: move_data | ((*piece as u64) << Shift::Promotion as u64),
};
list.push(m);
}
}