max number of pseudo legal move

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

max number of pseudo legal move

Post by xr_a_y »

is there a worst position than this one

[d] 3Q4/1Q4Q1/4Q3/2Q4R/Q4Q2/3Q4/1Q4Rp/1K1BBNNk w - - 0 1

218 pseudo legal moves ?
chrisw
Posts: 4313
Joined: Tue Apr 03, 2012 4:28 pm

Re: max number of pseudo legal move

Post by chrisw »

xr_a_y wrote: Sun Jun 09, 2019 5:14 pm is there a worst position than this one

[d] 3Q4/1Q4Q1/4Q3/2Q4R/Q4Q2/3Q4/1Q4Rp/1K1BBNNk w - - 0 1

218 pseudo legal moves ?
I have this comment in chess source:

// max width found so far in testing is 100
#define MAXWIDTH_FULLMOVELIST 128

that would have been counting every pseudo_move_generator count in search, saving the largest, and leaving it overnight or something. I forget.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: max number of pseudo legal move

Post by xr_a_y »

Based on my original message, you are taking some risks ...
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: max number of pseudo legal move

Post by konsolas »

Is that position even reachable from the start?
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: max number of pseudo legal move

Post by xr_a_y »

konsolas wrote: Sun Jun 09, 2019 7:11 pm Is that position even reachable from the start?
That's a good question ! Do we have "solvers" for this kind of thing ?
User avatar
Roland Chastain
Posts: 640
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: max number of pseudo legal move

Post by Roland Chastain »

xr_a_y wrote: Sun Jun 09, 2019 7:14 pm
konsolas wrote: Sun Jun 09, 2019 7:11 pm Is that position even reachable from the start?
That's a good question ! Do we have "solvers" for this kind of thing ?
I have never used it, but if I understand correctly it's the kind of thing that Natch can do.
Qui trop embrasse mal étreint.
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: max number of pseudo legal move

Post by konsolas »

Even so, the proof game for a position like this would be hundreds of moves and almost certainly beyond the capabilities of a brute force search.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: max number of pseudo legal move

Post by xr_a_y »

Reachable or not this is 218 moves. But is Minic, I used to set max moves to 512 ... why not 256 ? I cannot remember ...
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: max number of pseudo legal move

Post by AlvaroBegue »

This is not even hard. I have no experience constructing proof games, and I succeeded after a few minutes:
[pgn][Event "Edited game"] [Site ""] [Date "2019.06.09"] [Round "-"] [White "-"] [Black "-"] [Result "*"] 1. a4 b5 2. axb5 a6 3. bxa6 Bb7 4. axb7 g5 5. bxa8=Q g4 6. h4 Bh6 7. g3 Bg5 8. hxg5 f5 9. Rh6 f4 10. gxf4 g3 11. Rha6 h5 12. f5 c6 13. b4 Qb6 14. b5 Qd4 15. f3 Kf7 16. g6+ Kf6 17. d3 Qf2+ 18. Kd2 Qg2 19. bxc6 Kg5 20. cxd7 Kh4 21. d8=Q Rh7 22. Kc3 Nf6 23. e4 Nc6 24. Ne2 Kh3 25. Rxc6 Kh2 26. gxh7 Kh1 27. h8=Q Kh2 28. Qxf6 Kh1 29. Qfxe7 Kh2 30. f6 Kh1 31. f7 Kh2 32. f8=Q Kh1 33. e5 Kh2 34. Qef6 Kh1 35. e6 Kh2 36. e7 Kh1 37. e8=Q Kh2 38. Kb2 Kh1 39. d4 Kh2 40. d5 Kh1 41. d6 Kh2 42. d7 Kh1 43. Qc7 Kh2 44. d8=Q Kh1 45. f4 Kh2 46. Qfd4 Kh1 47. f5 Kh2 48. f6 Kh1 49. Qfc5 Kh2 50. f7 Kh1 51. f8=Q Kh2 52. Qcb4 Kh1 53. c4 Kh2 54. Rh6 Kh1 55. c5 Kh2 56. c6 h4 57. Qcf4 Kh1 58. c7 Kh2 59. c8=Q Kh1 60. Bd2 Kh2 61. Be1 Kh1 62. Nd2 Kh2 63. Kb1 Kh1 64. Ra2 Kh2 65. Ng1 Kh1 66. Be2 Kh2 67. Qda4 Kh1 68. Qab7 Kh2 69. Qcc5 Kh1 70. Rc2 Kh2 71. Qbb2 Kh1 72. Qd3 Kh2 73. Nc4 Kh1 74. Ne3 Kh2 75. Bd1 Kh1 76. Qe6 Kh2 77. Qfg7 Kh1 78. Rh5 Kh2 79. Nf1+ Kh1 80. Nxg3+ Kh2 81. Nf1+ Kh1 82. Rd2 h3 83. Rxg2 h2 * [/pgn]
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: max number of pseudo legal move

Post by xr_a_y »

AlvaroBegue wrote: Sun Jun 09, 2019 10:14 pm This is not even hard. I have no experience constructing proof games, and I succeeded after a few minutes:
[pgn][Event "Edited game"] [Site ""] [Date "2019.06.09"] [Round "-"] [White "-"] [Black "-"] [Result "*"] 1. a4 b5 2. axb5 a6 3. bxa6 Bb7 4. axb7 g5 5. bxa8=Q g4 6. h4 Bh6 7. g3 Bg5 8. hxg5 f5 9. Rh6 f4 10. gxf4 g3 11. Rha6 h5 12. f5 c6 13. b4 Qb6 14. b5 Qd4 15. f3 Kf7 16. g6+ Kf6 17. d3 Qf2+ 18. Kd2 Qg2 19. bxc6 Kg5 20. cxd7 Kh4 21. d8=Q Rh7 22. Kc3 Nf6 23. e4 Nc6 24. Ne2 Kh3 25. Rxc6 Kh2 26. gxh7 Kh1 27. h8=Q Kh2 28. Qxf6 Kh1 29. Qfxe7 Kh2 30. f6 Kh1 31. f7 Kh2 32. f8=Q Kh1 33. e5 Kh2 34. Qef6 Kh1 35. e6 Kh2 36. e7 Kh1 37. e8=Q Kh2 38. Kb2 Kh1 39. d4 Kh2 40. d5 Kh1 41. d6 Kh2 42. d7 Kh1 43. Qc7 Kh2 44. d8=Q Kh1 45. f4 Kh2 46. Qfd4 Kh1 47. f5 Kh2 48. f6 Kh1 49. Qfc5 Kh2 50. f7 Kh1 51. f8=Q Kh2 52. Qcb4 Kh1 53. c4 Kh2 54. Rh6 Kh1 55. c5 Kh2 56. c6 h4 57. Qcf4 Kh1 58. c7 Kh2 59. c8=Q Kh1 60. Bd2 Kh2 61. Be1 Kh1 62. Nd2 Kh2 63. Kb1 Kh1 64. Ra2 Kh2 65. Ng1 Kh1 66. Be2 Kh2 67. Qda4 Kh1 68. Qab7 Kh2 69. Qcc5 Kh1 70. Rc2 Kh2 71. Qbb2 Kh1 72. Qd3 Kh2 73. Nc4 Kh1 74. Ne3 Kh2 75. Bd1 Kh1 76. Qe6 Kh2 77. Qfg7 Kh1 78. Rh5 Kh2 79. Nf1+ Kh1 80. Nxg3+ Kh2 81. Nf1+ Kh1 82. Rd2 h3 83. Rxg2 h2 * [/pgn]
Great, so 256 is needed. Why did i use 512 before? Still a mistery...