Speed of chess programs on the iPhone/iPod Touch

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Michel »

I never use profile-generated optimization with GCC, simply because it doesn't work for me.
That's strange. I experimented with it with Toga and it seemed to work. But I did not do
any serious testing.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Tord Romstad »

Sven Schüle wrote:That your program runs on the iPhone is IMO accomplished already by using the iPhone gcc executable. So my theory is that "-arch armv6" could be no-op (unknown but not causing a compile error),
No, "-arch armv6" is not a no-op. Without the -arch switch, gcc tries to compile a binary for the platform it is running on. Because the gcc compiler for iPhone cannot produce x86 binaries at all, omitting "-arch armv6" gives an error:

Code: Select all

g++-4.0: installation problem, cannot exec '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/i686-apple-darwin9-g++-4.0.1': No such file or directory
and that "-march=armv6" could result in some code improvements. I may be wrong, but in cases like that I tend to believe in the written manual first.
Adding "-march=armv6" in addition to "-arch armv6" does not give an error, but also doesn't seem to have any effect.
Maybe I still look at the wrong manual?
Where do you see the manual? My installation does not seem to have a man page for the ARM gcc, but only for the normal gcc.

Tord
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Tord Romstad »

Sven Schüle wrote:
Tord Romstad wrote:and am somewhat disappointed by the speed on my first-generation iPod Touch (which uses an ARM CPU running at 450 MHz, if I recall correctly).
According to Wikipedia it runs at 400 MHz.
Just nitpicking a little bit :)
Sven
Nitpicking a little more:

Apparently it's a 667 MHz ARM underclocked to 412 MHz. :)

Tord
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Tord Romstad »

Here are the first six games played by Glaurung on the iPod Touch. The opponent was Chess Genius running on an iPhone, presumably at the same or similar CPU speed. The games are not quite as convincing as the results, but the engine still seems strong enough for a first release. Now I just have to write a GUI and find a good way to dumb down the program...

Tord

Code: Select all

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "1"]
[White "Glaurung 090102"]
[Black "Chess Genius"]
[Result "1-0"]

1. c4 g6 2. Nc3 Bg7 3. g3 d6 4. Bg2 Nh6 5. Nf3 {+0.29/9} c5 6. d4 {+0.35/9}
cxd4 7. Nxd4 {+0.80/8} Ng4 8. O-O {+0.45/8} O-O 9. Nd5 {+0.56/8} Ne5 10. Bg5
{+0.54/8} Nbc6 11. Rc1 {+0.45/8} h6 12. Be3 {-0.03/8} Ng4 13. Be4 {-0.39/9}
Nxe3 14. fxe3 {-0.54/9} Bh3 15. Bg2 {-0.60/8} Bxg2 16. Kxg2 {-0.80/10} e6 17.
Nxc6 {-1.01/10} bxc6 18. Nb4 {-0.94/10} c5 19. Nd3 {-0.78/10} Qb6 20. Qa4
{-0.72/9} Qb7+ 21. Kg1 {-0.74/10} Rab8 22. b3 {-0.80/10} Rfc8 23. Rcd1
{-0.70/9} Rc6 24. Qa5 {-0.74/10} Rb6 25. Nf4 {-0.74/9} Ra6 26. Qd2 {-0.72/11}
Qe4 27. Rf2 {-0.78/9} Rbb6 28. Rdf1 {-0.70/9} Ra3 29. Qd3 {-0.88/9} Qe5 30. Qb1
{-0.92/9} Qc3 31. Nxe6 {+0.78/9} fxe6 32. Qxg6 {+0.17/11} Rb8 33. Rf7 {+1.82/9}
Kh8 34. R1f6 {+2.05/10} Qxe3+ 35. Kf1 {+2.37/12} Qg5 36. Rxg7 {+2.66/12} Qxg6
37. Rfxg6 {+2.76/11} Rxa2 38. Rd7 {+2.78/10} h5 39. Rxe6 {+2.90/10} Kg8 40.
Rexd6 {+3.23/9} Rf8+ 41. Ke1 {+3.52/10} Re8 42. Rd2 {+3.76/9} Ra1+ 43. Kf2
{+3.60/11} Rh1 44. h4 {+3.45/10} Rf8+ 45. Kg2 {+3.88/10} Rhf1 46. e4 {+4.11/9}
Rb1 47. R2d5 {+4.27/10} Rb2+ 48. Kh3 {+4.37/10} Rf7 49. Rg5+ {+4.64/10} Kf8 50.
Rd8+ {+4.94/10} Ke7 51. Rd3 {+4.94/10} Re2 52. Rxh5 {+5.29/10} Rxe4 53. Rxc5
{+5.45/10} Kf8 54. g4 {+5.74/8} Ref4 55. b4 {+5.86/9} Rf1 56. Kg2 {+5.82/7} Rb1
57. b5 {+5.96/8} Rc1 58. Rc8+ {+6.41/9} Kg7 59. g5 {+6.13/8} Kg6 60. Rc6+
{+6.72/8} Kg7 61. h5 {+6.58/8} Rc2+ 62. Kg3 {+7.21/9} Re7 63. c5 {+7.33/9} Kh7
64. Rh6+ {+7.56/8} Kg7 65. Rg6+ {+7.68/9} Kh8 66. Rd5 {+7.70/8} Rc7 67. c6
{+8.19/7} Kh7 68. Rgd6 {+9.23/8} Re7 69. Rd7 {+10.94/9} Rc3+ 70. Kf4 {+16.94/9}
Rg7 71. h6 {+20.45/9} Rxd7 72. cxd7 {+20.45/9} Rc4+ 73. Kf5 {+#8/14} Rc2 74.
d8=Q {+#7/8} Rf2+ 75. Kg4 {+#5/17} Rg2+ 76. Kf3 {+#4/31} Re2 77. Kxe2 {+#3/6}
a6 78. Qe8 {+#2/6} axb5 79. Rd7# {+#1/100} 1-0

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "2"]
[White "Chess Genius"]
[Black "Glaurung 090102"]
[Result "0-1"]

1. e4 e5 2. Bc4 Nf6 3. d3 Nc6 4. Nf3 Bc5 5. c3 d6 6. a4 a6 7. O-O Ba7 8. Bg5
O-O {+0.05/9} 9. Nbd2 h6 {+0.03/9} 10. Bh4 Bd7 {-0.05/9} 11. a5 Qe7 {+0.05/8}
12. Qb3 Rfb8 {+0.11/8} 13. Rfe1 Bg4 {-0.01/9} 14. Kh1 Bc5 {+0.27/8} 15. Re2 g5
{+0.29/8} 16. Bg3 Nh5 {+0.23/9} 17. Ree1 Qf6 {+0.23/8} 18. Rf1 Qg6 {+0.23/7}
19. h3 Bd7 {+0.43/8} 20. Bh2 Nf4 {+0.31/9} 21. Bxf4 gxf4 {+0.19/9} 22. Bd5 Qg7
{+0.07/9} 23. Qc4 Ne7 {+0.19/8} 24. b4 Bb5 {+0.07/9} 25. Qb3 Ba7 {+0.19/9} 26.
Bc4 Bd7 {+0.25/9} 27. Ng1 Kh7 {+0.43/9} 28. Bxf7 Rg8 {+3.62/10} 29. Bxg8+ Rxg8
{+3.62/13} 30. g3 fxg3 {+2.05/9} 31. fxg3 Qxg3 {+2.11/9} 32. Qf7+ Rg7
{+1.50/10} 33. Qf3 Qh4 {+1.82/8} 34. Nc4 Nf5 {+4.62/8} 35. Kh2 Rg3 {+5.45/8}
36. Rf2 Rxf3 {+5.23/9} 37. Rxf3 d5 {+5.60/8} 38. exf5 dxc4 {+7.19/10} 39. dxc4
Bc6 {+7.72/9} 40. Raf1 Qxc4 {+8.43/10} 41. f6 Bxf3 {+9.19/10} 42. Rxf3 Kg8
{+9.25/9} 43. h4 Kf7 {+10.19/8} 44. h5 Qa2+ {+11.03/8} 45. Kh1 Qd5 {+11.78/11}
46. c4 Qxc4 {+12.17/10} 47. Nh3 Qg4 {+12.05/8} 48. Ra3 Qxb4 {+12.94/10} 49. Rg3
Qxa5 {+12.92/9} 50. Kh2 e4 {+13.09/9} 51. Rg7+ Kxf6 {+14.09/9} 52. Rg6+ Kf5
{+14.21/9} 53. Rg8 Qe5+ {+15.03/7} 54. Kg2 Qb2+ {+15.41/9} 55. Kh1 e3
{+16.37/10} 56. Ng1 e2 {+16.60/9} 57. Rf8+ Kg4 {+16.60/10} 58. Nxe2 Qxe2
{+91.63/8} 59. Rf4+ Kxh5 {+17.96/12} 60. Rf5+ Kh4 {+94.46/13} 61. Rf4+ Qg4
{+94.55/13} 62. Rxg4+ Kxg4 {+94.65/15} 63. Kg2 a5 {+94.65/13} 64. Kf1 a4
{+94.65/12} 65. Ke2 a3 {+#8/12} 66. Kd3 a2 {+#7/10} 67. Kc4 a1=Q {+#6/10} 68.
Kb3 Qb1+ {+#5/10} 69. Kc3 c6 {+#4/17} 70. Kd2 Qb2+ {+#3/6} 71. Kd3 b5 {+#2/100}
72. Ke4 Qe2# {+#1/100} 0-1

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "3"]
[White "Glaurung 090102"]
[Black "Chess Genius"]
[Result "1-0"]

1. d4 Nf6 2. c4 e6 3. Nf3 d5 4. Nc3 c6 5. e3 Bd6 6. Bd3 Nbd7 7. O-O O-O 8. e4
dxe4 9. Nxe4 Nxe4 10. Bxe4 Qc7 11. Bc2 h6 12. Qd3 {+1.19/10} Nf6 13. Bd2
{+1.15/10} Rd8 14. Rae1 {+0.98/9} c5 15. Bc3 {+0.54/9} cxd4 16. Bxd4 {+0.19/10}
Bc5 17. Qc3 {+0.33/10} Bxd4 18. Nxd4 {+0.15/11} a6 19. Nf3 {+0.54/10} b6 20.
Ne5 {+0.47/9} Bb7 21. Re2 {+0.43/9} Rac8 22. Qg3 {+0.47/8} Qc5 23. Rfe1
{+0.56/8} Rd4 24. Qh3 {+0.29/8} b5 25. b3 {+0.09/8} bxc4 26. bxc4 {+0.03/9} Rd6
27. Qg3 {+0.47/8} Rdd8 28. Nxf7 {+1.01/9} Kxf7 29. Rxe6 {+1.76/9} Kf8 30. Re7
{+1.82/8} Nh5 31. Qg6 {+2.23/10} Qxe7 32. Rxe7 {+2.23/10} Kxe7 33. Qxh5
{+2.19/9} Kf8 34. Bd3 {+2.39/8} Kg8 35. Qf5 {+2.23/8} Re8 36. f3 {+2.74/8} Re1+
37. Kf2 {+3.35/9} Re7 38. c5 {+3.52/10} Ra8 39. Bc4+ {+3.54/8} Kh8 40. Bb3
{+3.80/10} Rae8 41. Bc2 {+4.82/10} Re2+ 42. Kg3 {+5.09/10} Rxc2 43. Qxc2
{+6.00/8} Bc6 44. Qg6 {+6.27/11} Rc8 45. Qe6 {+6.23/11} Rc7 46. Qd6 {+6.07/10}
Rc8 47. Kf4 {+6.09/10} Bb5 48. a4 {+6.07/9} Bc6 49. a5 {+6.09/10} Bb5 50. Ke5
{+5.86/10} Rc6 51. Qe7 {+6.21/10} Kg8 52. f4 {+6.39/11} Rf6 53. f5 {+6.47/9}
Bc6 54. g3 {+6.37/10} Bf3 55. h3 {+6.49/9} Bc6 56. g4 {+6.52/9} Bf3 57. Qd8+
{+6.45/8} Kf7 58. Qd7+ {+6.43/10} Kf8 59. Qc8+ {+6.50/10} Kf7 60. Kd4
{+6.50/11} Ke7 61. Qc7+ {+6.31/8} Kf8 62. Qd7 {+6.37/10} Kg8 63. Qe8+
{+6.54/10} Kh7 64. Qe3 {+6.54/11} Bc6 65. Qd3 {+6.50/11} Bb5 66. Qe4 {+6.45/10}
Bc6 67. Qe2 {+6.52/11} Bb5 68. Qe7 {+6.45/10} Bc6 69. Qc7 {+6.50/11} Bf3 70.
Qb8 {+6.49/9} Bg2 71. Qb3 {+6.52/10} Bc6 72. Ke5 {+6.49/12} Bb5 73. Qd5
{+6.47/12} Bc6 74. Qd4 {+6.49/10} Bg2 75. Qd3 {+6.74/9} Kg8 76. Qc2 {+6.78/10}
Ba8 77. Qb3+ {+6.92/12} Kh7 78. Qd3 {+6.90/11} Bh1 79. h4 {+7.21/9} Kg8 80. g5
{+8.60/9} Rf8 81. Qc4+ {+8.60/8} Kh7 82. g6+ {+8.98/9} Kh8 83. Qf7 {+#9/13} Rg8
84. f6 {+#6/7} Bd5 85. Kxd5 {+#4/20} Rd8+ 86. Ke4 {+#3/100} Rg8 87. h5
{+#2/100} Re8+ 88. Qxe8# {+#1/6} 1-0

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "4"]
[White "Chess Genius"]
[Black "Glaurung 090102"]
[Result "0-1"]

1. Nf3 Nf6 2. g3 d5 3. c4 e6 4. Bg2 Be7 5. O-O O-O 6. cxd5 exd5 7. Nc3 d4 8.
Nb5 c5 9. Qc2 Bd7 {+1.15/9} 10. Qc4 Nc6 {+1.64/9} 11. b3 a6 {+1.88/9} 12. Na3
Bd6 {+1.70/9} 13. Bb2 b5 {+1.66/8} 14. Qc1 Re8 {+1.64/8} 15. e3 Rc8 {+1.52/7}
16. Nc2 Bf5 {+1.56/7} 17. Re1 Qd7 {+1.82/6} 18. exd4 Rxe1+ {+1.35/9} 19. Ncxe1
cxd4 {+1.70/9} 20. d3 Nd5 {+1.88/7} 21. Qd2 Bb4 {+2.29/8} 22. Qg5 Nc3 {+2.27/8}
23. Nh4 Be6 {+2.03/10} 24. Nhf3 Ne2+ {+2.37/8} 25. Kf1 h6 {+2.45/9} 26. Qh4 Nc3
{+2.37/9} 27. Nc2 Bc5 {+2.33/8} 28. Qf4 Bd5 {+1.76/7} 29. Nfe1 Re8 {+2.76/7}
30. Bxd5 Qxd5 {+2.45/9} 31. Qf3 Qd7 {+2.56/9} 32. Kg2 Ne5 {+3.45/9} 33. Qf4 g5
{+3.62/8} 34. Qd2 Qd5+ {+4.66/10} 35. f3 g4 {+6.01/10} 36. Qf4 gxf3+ {+6.45/8}
37. Kf1 f2 {+9.11/10} 38. Ng2 Nxd3 {+9.54/8} 39. Qg4+ Kh7 {+8.92/9} 40. Bxc3
dxc3 {+8.29/9} 41. a4 Nf4 {+19.15/7} 42. Qf5+ Qxf5 {+#8/8} 43. Nxf4 Qe4 {+#7/9}
44. Ne6 Rxe6 {+#5/9} 45. Ne3 Qh1+ {+#4/10} 46. Kxf2 Bxe3+ {+#3/23} 47. Ke2 Bd4+
{+#2/100} 48. Kd3 Qe4# {+#1/100} 0-1

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "5"]
[White "Glaurung 090102"]
[Black "Chess Genius"]
[Result "1-0"]

1. e4 e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 Bb4 6. Nxc6 bxc6 7. Bd3 d5 8.
exd5 cxd5 9. O-O O-O 10. Bg5 Bxc3 11. bxc3 h6 12. Bh4 Qd6 13. Re1 Bg4 14. Qd2
{+0.07/9} Rfe8 15. Bg3 {+0.37/9} Qb6 16. Be5 {+0.50/9} Nd7 17. Rab1 {+0.70/9}
Qa5 18. Rb5 {+0.56/10} Qxa2 19. Bxc7 {+0.56/10} Nf6 20. Be5 {+1.03/9} Nd7 21.
Bd4 {+1.47/9} a6 22. Rb7 {+1.54/9} Nf8 23. Reb1 {+1.84/9} Bc8 24. R7b6
{+1.60/9} Re6 25. R6b4 {+2.19/8} a5 26. R4b2 {+2.47/10} Qa4 27. Bb5 {+2.27/10}
Qa3 28. c4 {+2.27/10} Rg6 29. Be5 {+1.84/8} Bb7 30. c5 {+1.96/10} d4 31. Bf1
{+1.58/8} Bc6 32. Qxd4 {+1.68/9} Nd7 33. Bd6 {+1.96/9} Rg5 34. Rb3 {+1.88/7}
Qa2 35. h4 {+2.23/8} Rg6 36. Qc4 {+2.27/9} Qa4 37. Qxa4 {+2.13/11} Bxa4 38. Rb7
{+2.41/10} Bxc2 39. Re1 {+2.56/9} Nf8 40. Ree7 {+2.47/8} Rg4 41. Rxf7 {+3.17/8}
Ne6 42. Rfe7 {+2.94/8} Nd4 43. Bc4+ {+2.84/9} Kh7 44. Bd5 {+3.21/9} Nf5 45. Rb2
{+3.92/10} Rd8 46. Rxc2 {+4.17/9} Nxe7 47. Bf3 {+3.82/10} Ra4 48. Bxe7
{+4.56/9} Rdd4 49. c6 {+5.00/10} Rac4 50. Rxc4 {+5.49/12} Rxc4 51. Kf1
{+5.70/11} g6 52. Ke2 {+7.54/11} Rd4 53. c7 {+9.80/10} Rc4 54. Bd6 {+10.17/12}
a4 55. Bd5 {+10.27/11} Rc1 56. Kd3 {+10.88/11} Rxc7 57. Bxc7 {+11.05/12} g5 58.
hxg5 {+11.07/9} hxg5 59. Bc6 {+11.21/9} a3 60. Bd5 {+11.58/10} Kg6 61. Ke4
{+12.11/10} Kf6 62. Bd6 {+12.45/9} Kg6 63. Be7 {+85.02/12} a2 64. Bxa2
{+85.07/13} g4 65. Kf4 {+85.12/12} g3 66. fxg3 {+96.37/11} Kh7 67. Kf5 {+#7/11}
Kg7 68. g4 {+#6/13} Kh6 69. Bf8+ {+#5/14} Kh7 70. Kf6 {+#4/40} Kh8 71. g5
{+#3/100} Kh7 72. g6+ {+#2/100} Kh8 73. Bg7# {+#1/100} 1-0

[Event "?"]
[Site "?"]
[Date "2009.01.02"]
[Round "6"]
[White "Chess Genius"]
[Black "Glaurung 090102"]
[Result "0-1"]

1. e4 c5 2. Nf3 e6 3. d4 cxd4 4. Nxd4 Nc6 5. Nb5 d6 6. c4 Nf6 7. N5c3 Be7 8.
Be2 O-O 9. O-O b6 10. Bf4 Bb7 11. b3 Ne5 {+0.15/9} 12. Qd4 Ned7 {+0.15/8} 13.
Bxd6 Bxd6 {+0.11/11} 14. Qxd6 Bxe4 {+0.03/10} 15. Rd1 Nc5 {-0.19/9} 16. Qg3 Qe7
{+0.19/10} 17. Nxe4 Nfxe4 {+0.50/10} 18. Qf3 Rfd8 {+0.15/10} 19. Nc3 Nxc3
{+0.07/10} 20. Qxc3 Qh4 {+0.07/10} 21. g3 Qe7 {-0.01/10} 22. Bf3 Rac8
{-0.07/11} 23. Rxd8+ Rxd8 {+0.19/12} 24. Rd1 Rxd1+ {+0.09/11} 25. Bxd1 e5
{+0.09/10} 26. Qd2 h6 {+0.15/9} 27. Qd5 e4 {+0.09/9} 28. Bc2 g6 {+0.05/10} 29.
Kf1 Kg7 {+0.03/8} 30. Qd4+ Qf6 {+0.31/11} 31. Qxf6+ Kxf6 {+0.31/13} 32. Ke2 Ke5
{+0.21/12} 33. Ke3 f5 {+0.25/12} 34. b4 Ne6 {+0.80/11} 35. Bb3 g5 {+0.88/10}
36. Kd2 Nd4 {+0.78/10} 37. Bd1 a6 {+0.80/11} 38. Kc3 f4 {+0.68/11} 39. gxf4+
gxf4 {+0.72/13} 40. Bg4 a5 {+0.54/11} 41. bxa5 bxa5 {+0.64/12} 42. a3 Nc6
{+0.72/12} 43. Bd7 Ne7 {+0.66/12} 44. Bg4 Ng8 {+0.43/11} 45. Be2 Nf6 {+1.03/12}
46. f3 e3 {+1.78/13} 47. Bd3 Nd7 {+1.94/14} 48. Be2 Nc5 {+1.82/14} 49. Bd1 Ne6
{+2.11/16} 50. Kd3 Kd6 {+2.17/13} 51. Be2 Kc5 {+2.17/14} 52. Bd1 Nd4 {+1.86/14}
53. a4 Ne6 {+2.17/13} 54. Kc3 Nd4 {+2.45/15} 55. Kd3 h5 {+2.92/17} 56. h4 Nf5
{+2.92/16} 57. Ke4 Ng3+ {+2.90/15} 58. Kxf4 e2 {+4.27/14} 59. Bxe2 Nxe2+
{+4.33/14} 60. Kg5 Nc3 {+5.05/11} 61. Kxh5 Nxa4 {+4.56/12} 62. Kg5 Nb6
{+6.66/12} 63. h5 Nd7 {+7.64/15} 64. h6 Nf8 {+7.64/14} 65. Kf6 a4 {+8.05/13}
66. Kg7 a3 {+8.05/12} 67. Kxf8 a2 {+8.31/12} 68. h7 a1=Q {+8.60/13} 69. Kg8
Qg1+ {+8.50/11} 70. Kf8 Qd4 {+10.33/10} 71. Kg8 Qd8+ {+11.58/10} 72. Kf7 Qh8
{+11.72/10} 73. Kg6 Kxc4 {+11.68/10} 74. f4 Kd5 {+86.81/10} 75. Kh6 Qf6+
{+86.91/11} 76. Kh5 Ke4 {+#7/11} 77. h8=R Kxf4 {+#5/6} 78. Rf8 Qxf8 {+#4/7} 79.
Kg6 Qe7 {+#3/100} 80. Kh6 Kf5 {+#2/100} 81. Kh5 Qg5# {+#1/100} 0-1
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Sven »

Thanks for clarifying, Tord. So my theory was wrong. The reason for my suspicion was that I did not see any manual page describing "-arch armv6" but saw a description only listing other possible parameters for "-arch".

If I understand correctly you *must* pass "-arch <some_ARM_architecture>" to this special cross compiler. I even wonder whether something different than "armv6" can be passed successfully. If "-arch armv6" must always be present then it would probably be better not to make it an option, but I guess this remains a dream ...

What I have downloaded is a tarball "gcc-4.0.1-iphone.tar" that contains an installation of the GCC for iPhone. It is about 24 MB and is dated 2008-03-23 15:34. Part of it is also a man page "gcc.1". Now I think it is very likely that this is indeed the man page of the standard Apple GCC, and that there is no special man page for the iPhone GCC.

So it seems your original question is still open ...

Sven
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Tord Romstad »

Sven Schüle wrote:Thanks for clarifying, Tord. So my theory was wrong. The reason for my suspicion was that I did not see any manual page describing "-arch armv6" but saw a description only listing other possible parameters for "-arch".

If I understand correctly you *must* pass "-arch <some_ARM_architecture>" to this special cross compiler. I even wonder whether something different than "armv6" can be passed successfully.
Perhaps there is an option for generating code for the iPhone simulator included in Apple's SDK. I'm not sure.
If "-arch armv6" must always be present then it would probably be better not to make it an option, but I guess this remains a dream ...
I guess it doesn't matter to most people. There are probably hardly anyone who ever runs the ARM gcc directly from the command line; the IDE takes care of supplying the right switches.
What I have downloaded is a tarball "gcc-4.0.1-iphone.tar" that contains an installation of the GCC for iPhone. It is about 24 MB and is dated 2008-03-23 15:34. Part of it is also a man page "gcc.1". Now I think it is very likely that this is indeed the man page of the standard Apple GCC, and that there is no special man page for the iPhone GCC.

So it seems your original question is still open ...
I am now quite sure everything is OK. The problem is just that bitboards (or at least my bitboard implementation) are very inefficient on the ARM. But in any case, the program seems strong enough, and beats the iPhone chess programs which are available on the market today. Now I just need to finish my GUI...

Tord
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Aleks Peshkov »

Tord Romstad wrote:The problem is just that bitboards (or at least my bitboard implementation) are very inefficient on the ARM.
IMHO the reason is opposite, with the guide of our "bit wizards" (like Gerd Isenberg) chess bitboard stuff is highly tuned for current Intel architecture in many memory/calculation compromises.
Mark
Posts: 216
Joined: Thu Mar 09, 2006 9:54 pm

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Mark »

Tord Romstad wrote:Hi all,

I have managed to compile Glaurung 2.2 (only the UCI engine; no GUI so far) to the iPhone OS, and am somewhat disappointed by the speed on my first-generation iPod Touch (which uses an ARM CPU running at 450 MHz, if I recall correctly). From the opening position, Glaurung searches about 14 Kn/s, which is almost a factor of 100 slower than when running on a single core of my 2.8 GHz Core 2 Duo. Based on benchmarks elsewhere, I expected a slowdown by a factor of only about 40.

Is a factor of 100 normal, or is it likely that something is wrong? I use these compiler switches:

Code: Select all

CXXFLAGS = -O3 -fno-exceptions -fomit-frame-pointer -fno-rtti -fstrict-aliasing -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk/
Tord
Just for info, Richard Lang indicated that Chess Genius on the iPhone runs at about 70,000 nps.

Regarding a GUI, it's too bad that everyone has to create their own.

Mark
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Tord Romstad »

Mark wrote:Just for info, Richard Lang indicated that Chess Genius on the iPhone runs at about 70,000 nps.
Thanks for the info, Mark!

This is another indication that it should be possible to vastly improve on my 14,000 N/s. I am sure Chess Genius is faster than Glaurung on desktop computers as well, but I doubt that it is five times faster (which would put it at around 7 million N/s on a single core of my 2.8 GHz Core 2 Duo). I guess it should be possible to improve Glaurung's speed on the ARM by at least a factor of 2 by optimizing the bitboard code or eliminating the bitboards altogether.

At any rate, even at the current low speed, the strength doesn't look too shabby. I let Glaurung on my iPod Touch play unattended on the ICC for a day this weekend, accepting all challenges from human players (not from computers, as there is little point in playing against programs running on computers more than 100 times faster), with 21 wins, 2 draws, and 0 losses, against players rated from 1100 to 2600. Glaurung's rating actually increased from 2820 to 2831. Of course, most of the opponent weren't very strong, but most potential users of the iPhone program also won't be. A speed of 14,000 N/s will do for a first release, I'll look for ways to improve it later.
Regarding a GUI, it's too bad that everyone has to create their own.
For me, it doesn't make much of a difference: I would have to create my own anyway. I want to write a chess program, not just a small, but important part of one.

I made a lot of progress with the GUI this weekend. With a couple of more similarly productive weekends, I think I'll have something ready for serious testing. :)

Tord
Mark
Posts: 216
Joined: Thu Mar 09, 2006 9:54 pm

Re: Speed of chess programs on the iPhone/iPod Touch

Post by Mark »

Tord- Glad things are going well with the GUI and program. When it makes it to the app store, post a message here so we know it's available for download. I'll be first in line to buy it!

Mark