Can White still castle? #2

For this puzzle I had another go at this theme, with a bit of a different take:

Is it possible to reach this position in such a way that White can still castle?

• How unique can the sequence of last moves be? Commented Jun 24 at 3:10
• @Laska Not all that unique for this puzzle, rot13(gur beqre va juvpu Oynpx zbirq gurve cvrprf vf havdhr sebz gur cebzbgvba bajneq, ohg gurer vf fbzr syrkvovyvgl va gur rknpg cngu gnxra ol gur xvat (naq nyfb Juvgr'f cnja zbirf).) Commented Jun 24 at 12:35

After a careful analysis, it becomes obvious that castling is now

possible.

The main obstacle is the promoted bishop at h7. It can only have entered its square before the g7 pawn moved to g6, so at that point, the black bishop at f8 was still on its starting square. This means the black king was still stuck on e8, and the black rook cannot have been on f8 either. Since all mobile white pieces must have been captured in order to promote the a7 pawn, we can add up all the moves that each black piece must have made after the underpromotion.

It turns out, this number exceeds the number of moves available to white's pawns, because white must have moved the e2 pawn earlier in order to allow the promoting pawn through.

Therefore,

Black must have played a move that moved two pieces at the same time!

Like so:

1. e3 a6
2. Bb5 axb5
3. Na3 Na6
4. Nc4 bxc4
5. Qe2 Nc5
6. Qd3 cxd3
7. Ne2 dxe2
8. Rg1 Nb3
9. Rh1 Nxc1
10. Rg1 Nb3
11. Rh1 Nc5
12. Rg1 Na6
13. Rh1 Nb8
14. Rg1 Nh6
15. Rh1 Nf5
16. Rg1 h5
17. Rf1 exf1=B
18. h3 Bd3
19. h4 Nxh4
20. g3 Bh7
21. f3 g6
22. f4 Bh6
23. f5 O-O!
24. g4 Kg7
25. f6+ Kxf6
26. g5+ Kf5
27. gxh6 Kg4
28. e4 Kf3
29. e5 Kg2
30. e6 Kh1
31. O-O-O+

• Very nice answer, well done! Commented Jun 23 at 20:53
• Maybe worth showing the critical diagram. Cool the way bK must capture advancing pawns. Is there a way to force him to capture wPh? Commented Jun 24 at 14:34
• @Laska Since pretty much everything is "critical", I thought it better to include a link for viewing the solution on Lichess. Added a pic though. :-) The king cannot take the h-pawn with knight h4 in place, it would have to walk through a check in order to not be late. Also, moving the knight to h4 after the king has passed through isn't viable; the knight would have to stand and wait in a spot that blocks a pawn move.
– Bass
Commented Jun 24 at 15:17
• Thanks for adding the diagram. I agree that the subsequent play is tense. The term “critical diagram” is often used for the moment when tempo play commences Commented Jun 24 at 15:32
• For this task, you do not need a full proof game from the starting position. In your game record, 16.5 moves is a "critical position". The solution is everything that happened next. Building a "critical position" is of no interest. Commented Jul 15 at 19:44