I often get asked what are the longest paths to victory in various endgames.
Below I give some position of the longest, and link to files with fuller data.

This is extractable from the TBs with "./tb_build --stats KPkrp" for instance,
which also gives statistics about what percentage of positions are won, etc.

Note that these (due to the way that the TBs access data) are the longest
loss for White. They also use joint FICS/International rules, so that a side
that is stalemated must win under both sets of rules. For instance, a White
pawn on e2 and a Black king on e3 with white-to-move is a draw.

Two pieces LOSS2.data
maximal loss wNb1 bNa1 6 0 Nn
maximal loss wNb1 bKg1 9 0 Nk
maximal loss wKc3 bRa1 17 0 Kr

Three pieces LOSS3.data
maximal loss wKa2 wPc2 bKa8 15 0 KPk
maximal loss wKb1 bKa5 bRd3 15 0 Kkr
maximal loss wKa1 bQe3 bBh4 16 0 Kqb
maximal loss wKa1 bKd1 bQh1 17 0 Kkq
maximal loss wNb8 bNb3 bPg6 19 0 Nnp
maximal loss wKa1 bBh5 bBc5 22 0 Kbb

Four pieces LOSS4.data
maximal loss wKa1 bKh2 bNc8 bNg2 43 0 Kknn
maximal loss wKa1 bKf2 bQf8 bRc8 44 0 Kkqr
maximal loss wKc1 bKa7 bRf4 bBh4 44 0 Kkrb
maximal loss wKa1 bKe1 bQg5 bNb5 45 0 Kkqn
maximal loss wKa1 bQe3 bNh2 bNf1 46 0 Kqnn
maximal loss wKa1 bQg3 bBg5 bNg4 46 0 Kqbn
maximal loss wKa1 bKh5 bKd1 bNf6 50 0 Kkkn
maximal loss wKd1 bKa3 bBf6 bNe5 71 0 Kkbn

Five pieces LOSS5.data
maximal loss wKa1 bKb5 bRf7 bNh8 bPg6 51 0 Kkrnp
maximal loss wKa2 bKd7 bKa5 bNe6 bPa7 52 0 Kkknp
maximal loss wKa1 bKf4 bNd8 bNb8 bPb7 53 0 Kknnp
maximal loss wKa1 bKb4 bQf7 bNe6 bPb7 54 0 Kkqnp
maximal loss wKa7 bKf3 bQc3 bBb3 bPe7 54 0 Kkqbp
maximal loss wKb1 wNa1 bKc5 bKg1 bRd8 54 0 KNkkr
maximal loss wKc1 wNe2 bKe4 bNc8 bNb8 54 0 KNknn
maximal loss wKa6 bQh3 bBg2 bNa2 bPd5 55 0 Kqbnp
maximal loss wKa7 bQd2 bRc5 bNe8 bPd7 55 0 Kqrnp
maximal loss wKb1 wRa1 bKh8 bKe7 bNg1 55 0 KRkkn
maximal loss wKd1 wNc2 bKe8 bRb5 bNf7 55 0 KNkrn
maximal loss wKa1 bBb4 bNf6 bNb6 bPd7 56 0 Kbnnp
maximal loss wKa1 bKe5 bBg4 bNg6 bPc7 67 0 Kkbnp
maximal loss wKd4 wPc3 bKe1 bRf7 bPc7 78 0 KPkrp

For six pieces, the subset of available TBs is approximately the following.
a) All 5-vs-K with the five having no queens, at most one bishop, and pawn
promotions restricted to KNR. Also, PPPPP vs K is not available.
b) All 4-vs-KK and 4-vs-NK.

These were built using a hacked version of the TB build code that I have
never made publicly available.

Six pieces  LOSS6.data
maximal loss bKd1 bRg2 bNe8 bNe2 wKa7 wKa2 61 0 krnnKK
maximal loss bKd2 bQd1 bNg8 bNh4 wKa8 wKf4 61 0 kqnnKK
maximal loss wKc6 wNh8 bRc3 bBh3 bNa1 bPc4 61 0 KNrbnp
maximal loss wKb8 wNd1 bKd8 bQe8 bNe1 bPe7 62 0 KNkqnp
maximal loss wKa1 bKb8 bRf5 bBe3 bPc7 bPb7 63 0 Kkrbpp
maximal loss wKa3 wNa4 bKg8 bBh4 bNh8 bPd7 63 0 KNkbnp
maximal loss wKc1 wNb8 bBg7 bNg6 bNg5 bPf7 63 0 KNbnnp
maximal loss wKa2 wNh1 bKd8 bRe6 bNc2 bPc7 64 0 KNkrnp
maximal loss bNd4 bNe1 wKh1 wKa1 bKf8 bKb7 65 0 nnKKkk
maximal loss wKa1 bKg6 bNc5 bNf2 bPh7 bPg5 65 0 Kknnpp
maximal loss wKb1 wNa2 bRg7 bNc7 bNg1 bPe7 66 0 KNrnnp
maximal loss wKa5 wNg1 bKg7 bKf5 bQg8 bPc7 67 0 KNkkqp
maximal loss bKb1 bNg2 bNh1 bNd1 wKh7 wKa5 68 0 knnnKK
maximal loss wKa1 wNe1 bKh4 bNf8 bNf6 bPc7 68 0 KNknnp
maximal loss wKa1 bKb6 bRh6 bRf6 bPf7 bPg6 69 0 Kkrrpp
maximal loss wKa1 wNb7 bQh8 bNf6 bNd4 bPe5 70 0 KNqnnp
maximal loss bRc2 bNf8 wKa8 wKf1 bKa5 bKh4 72 0 rnKKkk
maximal loss wKb1 wNa1 bRd7 bNg8 bNh7 bNg4 74 0 KNrnnn
maximal loss wKb1 bBf1 bNb8 bNf6 bPf7 bPe7 76 0 Kbnnpp
maximal loss bKc1 bBd6 bNb1 bNa1 wKh6 wKe1 86 0 kbnnKK
maximal loss wKd1 bNd8 bNb7 bNa6 bNb5 bPe6 89 0 Knnnnp
maximal loss wKa1 bKc8 bBd2 bNc6 bPb7 bPa6 93 0 Kkbnpp

Here is the longest example:

[FEN "2k5/1p6/p1n5/8/8/8/3b4/K7 w - -"]
1. Ka2! Bg5!! 2. Kb2! Bh4 3. Kc1 Be7!! 4. Kd1 Nb8! 5. Kc1 Kc7
6. Kb2 Kd6!! 7. Ka3 Nd7 8. Kb3! Bh4! 9. Kc3! Ke6! 10. Kb3! Ke5!
11. Kc2! Kd5! 12. Kd2! Be7!! 13. Ke3! Kc6!! 14. Kf3! Bf8! 15. Kg4! Nb6!
16. Kg5! Bb4!! 17. Kf6! Ba5!! 18. Kf5! Na4! 19. Kf4 Bb4! 20. Kf5! Ba3
21. Kg6! Bc5! 22. Kf5! Bb4! 23. Kf4! Kd7! 24. Ke3! Ba3! 25. Ke4! Bf8!
26. Kf3 Nb6! 27. Kg4! Bb4! 28. Kf4! Ba3! 29. Ke3! Ke6! 30. Kf3! Bb4
31. Ke2 Be7! 32. Kf3! Ba3! 33. Ke3! Bf8! 34. Kf3! Kd6! 35. Kg3 Kd5!
36. Kg4 Na8! 37. Kg5 Bc5! 38. Kh6! Kd6! 39. Kg6! Nb6! 40. Kg7! Bg1!
41. Kg6! Na4! 42. Kf7! Kc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