Stockfish for Android

Moderators: Elijah, Igbo, timetraveller

Archimedes

Android Engines Top Active Users
Forum Contributions
Points: 42 582,00 
Posts: 2059
Joined: 04/11/2019, 21:13
Status: Offline (Active 3 Hours, 21 Minutes ago)
Medals: 2
Topics: 158
Reputation: 7111
Been thanked: 6477 times

Stockfish for Android

Post by Archimedes »

I must have mixed something up. The patch was taken into account right from the start (I never had to take anything into account when compiling).

In any case, the CECSA script now also supports dot product compilation (executables only runs on newer devices). I will upload the script soon. Everything has a deeper meaning. :smile:
LittleJoe

Top contribute Forum Engines Maker
Forum Contributions
Points: 14 078,00 
Posts: 327
Joined: 17/10/2020, 22:28
Status: Offline (Active 1 Day, 15 Hours, 29 Minutes ago)
Medals: 2
Topics: 5
Reputation: 506
Has thanked: 349 times
Been thanked: 671 times

Stockfish for Android

Post by LittleJoe »

pgo-compiled armv8-dotprod prerelessed binaries of newest Stockfish17dev can always be downloaded here:
https://github.com/official-stockfish/Stockfish/releases

It would be nice if someone with an appropriate Android device could post some speed test results or at least post the name of the Android(!)-device which is able to run these dotprod-binaries.
ConRog

Book Maker
Forum Contributions
Points: 11 599,00 
Posts: 314
Joined: 15/11/2019, 19:53
Status: Offline (Active 7 Hours, 19 Minutes ago)
Medals: 1
Topics: 5
Reputation: 1036
Location: French Polynesia
Has thanked: 1121 times
Been thanked: 968 times

Stockfish for Android

Post by ConRog »

LittleJoe wrote: 12/11/2023, 17:34 pgo-compiled armv8-dotprod prerelessed binaries of newest Stockfish17dev can always be downloaded here:
https://github.com/official-stockfish/Stockfish/releases

It would be nice if someone with an appropriate Android device could post some speed test results or at least post the name of the Android(!)-device which is able to run these dotprod-binaries.
Thank you LittleJoe. I prefer Archimedes compiles because they are not with embedded net.
LittleJoe

Top contribute Forum Engines Maker
Forum Contributions
Points: 14 078,00 
Posts: 327
Joined: 17/10/2020, 22:28
Status: Offline (Active 1 Day, 15 Hours, 29 Minutes ago)
Medals: 2
Topics: 5
Reputation: 506
Has thanked: 349 times
Been thanked: 671 times

Stockfish for Android

Post by LittleJoe »

Ah yes I forgot that they only have embedded builds, I also don't like them.
Anyway, some information about Android devices which support dot-product builds would be appreciated.
Archimedes

Android Engines Top Active Users
Forum Contributions
Points: 42 582,00 
Posts: 2059
Joined: 04/11/2019, 21:13
Status: Offline (Active 3 Hours, 21 Minutes ago)
Medals: 2
Topics: 158
Reputation: 7111
Been thanked: 6477 times

Stockfish for Android

Post by Archimedes »

In the meantime, the clang compiler is probably the better choice. If you want to use the makefile from the CECSA script to manually compile Stockfish under Termux, you only need to enter the following command sequence after copying the makefile into the src directory:

Code: Select all

make net
make profile-build COMP=clang
Kasparov1

Top contribute Forum
Forum Contributions
Points: 19 012,00 
Posts: 217
Joined: 02/10/2020, 10:27
Status: Offline (Active 1 Day, 9 Hours, 26 Minutes ago)
Medals: 1
Topics: 0
Reputation: 671
Has thanked: 182 times
Been thanked: 1164 times

Stockfish for Android

Post by Kasparov1 »

Hello dear Archimedes!Can you please update latest SF for AnDrOiD? thankyou
superbatil
Forum Contributions
Points: 14 010,00 
Posts: 76
Joined: 24/02/2022, 11:23
Status: Offline (Active 1 Week, 2 Days, 17 Hours, 41 Minutes ago)
Topics: 0
Reputation: 17
Has thanked: 1 time
Been thanked: 51 times

Stockfish for Android

Post by superbatil »

Archimedes wrote: 13/11/2023, 8:56 In the meantime, the clang compiler is probably the better choice. If you want to use the makefile from the CECSA script to manually compile Stockfish under Termux, you only need to enter the following command sequence after copying the makefile into the src directory:

Code: Select all

make net
make profile-build COMP=clang
or

Code: Select all

make profile-build ARCH=armv8-dotprod COMP=clang COMPCXX=clang++
superbatil
Forum Contributions
Points: 14 010,00 
Posts: 76
Joined: 24/02/2022, 11:23
Status: Offline (Active 1 Week, 2 Days, 17 Hours, 41 Minutes ago)
Topics: 0
Reputation: 17
Has thanked: 1 time
Been thanked: 51 times

Stockfish for Android

Post by superbatil »

Kasparov1 wrote: 21/11/2023, 19:45 Hello dear Archimedes!Can you please update latest SF for AnDrOiD? thankyou

Code: Select all

https://pixeldrain.com/u/xqpinhpT
Kasparov1

Top contribute Forum
Forum Contributions
Points: 19 012,00 
Posts: 217
Joined: 02/10/2020, 10:27
Status: Offline (Active 1 Day, 9 Hours, 26 Minutes ago)
Medals: 1
Topics: 0
Reputation: 671
Has thanked: 182 times
Been thanked: 1164 times

Stockfish for Android

Post by Kasparov1 »

New SF Version as 4th December!!! slt
Archimedes

Android Engines Top Active Users
Forum Contributions
Points: 42 582,00 
Posts: 2059
Joined: 04/11/2019, 21:13
Status: Offline (Active 3 Hours, 21 Minutes ago)
Medals: 2
Topics: 158
Reputation: 7111
Been thanked: 6477 times

Stockfish for Android

Post by Archimedes »

LittleJoe drew my attention to a repository that has been around for a while.

https://github.com/termux-user-repository/tur

In this repository you can find the latest GCC compilers (latest version is 13.2.0).

After installing the repository, you only need

Code: Select all

pkg install gcc-13
and

Code: Select all

pkg install gcc-default-13
Termux may need to be restarted before the last command.

Compared to the latest version of Clang (17.0.6), this provides a significant speed boost of around 5.4% for the PGO compiles. And that's a lot. As I found out, the outputs seem to be compatible with API level 23 (Android 6). If someone tells me how I can set an API level of 21, then I'll do it.

I have just uploaded the latest versions of Stockfish again and also updated the installation script cecsa.sh accordingly.

LittleJoe, thanks again for the tip. smile3
Archimedes

Android Engines Top Active Users
Forum Contributions
Points: 42 582,00 
Posts: 2059
Joined: 04/11/2019, 21:13
Status: Offline (Active 3 Hours, 21 Minutes ago)
Medals: 2
Topics: 158
Reputation: 7111
Been thanked: 6477 times

Stockfish for Android

Post by Archimedes »

The latest GCC version of Stockfish is therefore around 7.8 % faster than the official Stockfish version (compiled with Clang 9.0.9).
LittleJoe

Top contribute Forum Engines Maker
Forum Contributions
Points: 14 078,00 
Posts: 327
Joined: 17/10/2020, 22:28
Status: Offline (Active 1 Day, 15 Hours, 29 Minutes ago)
Medals: 2
Topics: 5
Reputation: 506
Has thanked: 349 times
Been thanked: 671 times

Stockfish for Android

Post by LittleJoe »

Archimedes wrote: 11/12/2023, 23:11 The latest GCC version of Stockfish is therefore around 7.8 % faster than the official Stockfish version (compiled with Clang 9.0.9).
That's about 15 Elo which is a lot in these high Elo regions. But the SFdevs don't care much about Android and they certainly can't compile each Android dev-build manually with Termux on an Android device, which gives by far the builds with the best nps-values. So they have to use for their GitHub-Actions workflows a very old NDK (which obviously uses clang 9). Newer NDKs don't support anymore the NDK-toolchains (which were never officially supported by Google).
Kasparov1

Top contribute Forum
Forum Contributions
Points: 19 012,00 
Posts: 217
Joined: 02/10/2020, 10:27
Status: Offline (Active 1 Day, 9 Hours, 26 Minutes ago)
Medals: 1
Topics: 0
Reputation: 671
Has thanked: 182 times
Been thanked: 1164 times

Stockfish for Android

Post by Kasparov1 »

Hello dear Archimedes.Happy new year full of blessings.Can you please compile latest SF 01012024 for Android? thankyou
Lotus340
Forum Contributions
Points: 11 741,00 
Posts: 70
Joined: 16/03/2022, 13:56
Status: Offline (Active 3 Days, 23 Hours, 47 Minutes ago)
Topics: 6
Reputation: 42
Has thanked: 38 times
Been thanked: 86 times

Small nets rule!

Post by Lotus340 »

I'm coming to the conclusion that the large Stockfish nets - at least on Android phones - are no longer of any value.

This week I downloaded the latest Stockfish with its default net, as compiled by Archimedes (nn-b1e55edbea57.nnue, 64mb). Then I tested it against the latest small net to be found on Joachim's Stockfish NPS page (nn-9067e33176e8.nnue, 6.62 mb). The link for this is at the end of this post.

Both nets are from December, so are roughly equal in terms of ongoing development. The match was 100 games at 1 sec/move. I put together an opening suite of various randomised 4-ply, 6-ply and 8-ply openings, and threw in a dozen gambit lines as well to get as much variety as possible.

The results are clearly in favour of the smaller net, which won with 38 wins, 12 losses and 50 draws. In other words, a more than 3:1 win/loss ratio.

What we see here is a fascinating clash between more knowledge (in the form of a very large net) and faster speed. My conclusion is that faster speed often gives the biggest advantage. The small net, which is almost one-tenth the size of the large one, averaged 6-7 times more nodes per second, and this made all the difference.

So I hope there is more development of such small nets because they provide the best performance on a phone, without any doubt. The 9067 net is now the default net on my phone.

https://github.com/Joachim26/StockfishNPS/releases/tag/Win_modern_and_armv8_dev_release
Last edited by Lotus340 on 02/01/2024, 13:39, edited 2 times in total.
Kasparov1

Top contribute Forum
Forum Contributions
Points: 19 012,00 
Posts: 217
Joined: 02/10/2020, 10:27
Status: Offline (Active 1 Day, 9 Hours, 26 Minutes ago)
Medals: 1
Topics: 0
Reputation: 671
Has thanked: 182 times
Been thanked: 1164 times

Stockfish for Android

Post by Kasparov1 »

Wow + 92 elo!! At LTC probably bigger net will take over...But at VVSTC makes sense.If that is the case why SF use dual net in future?
Post Reply

Return to “Mobile Chess Software, Engines”