What is the maximum number of passed pawns in a position? Something I have wondered about recently is the maximum number of passed pawns that is theoretically possible. What is the answer, and the fastest way to achieve that result?
EDIT: record is now 20.0 moves! (See below.)

If we like pawns undoubled...


[title "16 non-doubled passed pawns in 21.0 moves"]
[fen ""]
[startply "42"]

1. g4 h5 2. g5 Rh6 3. gxh6 g5 4. h4 g4 5. b4 e5 6. f4 e4 7. Nf3 exf3 8. e4 f5 9. e5 Qg5 10. Nc3 a5 11. Ne4 fxe4 12. c4 a4 13. Qb3 axb3 14. a4 b5 15. a5 d5 16. c5 Bd6 17. cxd6 c5 18. Ra4 c4 19. d4 Na6 20. hxg5 Nc5 21. dxc5 bxa4 *
   

If we like all our pawns doubled, there's just a small improvement possible...


[title "16 passed pawns (all doubled) in 20.5 moves"]
[fen ""]
[startply "41"]

1. a4 b5 2. a5 d5 3. c4 h5 4. Ra4 bxa4 5. c5 e5 6. g4 Bd6 7. cxd6 c5 8. e4 f5 9. Ne2 h4 10. Ng3 hxg3 11. h4 Rh5 12. gxh5 g5 13. Bc4 dxc4 14. d4 f4 15. Be3 Bf5 16. exf5 fxe3 17. f4 e4 18. d5 Qb6 19. axb6 a5 20. b4 g4 21. b5 *


But best of all, curiously, is if we mix doubled and undoubled...


[title "16 passed pawns in 20.0 moves!"]
[fen ""]
[startply "40"]

1. d4 c5 2. f4 e5 3. f5 d5 4. Bf4 Be6
5. fxe6 exf4 6. e4 f5 7. e5 c4 8. Bd3 Bc5
9. dxc5 cxd3 10. c4 a5 11. b4 a4 12. Qb3 axb3
13. a4 b5 14. a5 h5 15. g4 Rh6 16. g5 d4
17. gxh6 g5 18. h4 g4 19. Ra4 Qg5 20. hxg5 bxa4 *


I don't think this can be beaten, and the other 20-move positions are quite narrowly defined: the captures from a file to h file must be R,Q,B,B,B,B,Q,R/N.