understanding android chess engine binary formats

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
adams161
Posts: 490
Joined: Sun May 13, 2007 7:55 pm
Location: Tacoma, WA USA

understanding android chess engine binary formats

Post by adams161 » Tue Feb 19, 2019 10:24 am

Hi,

Mike here the Pulsar engine author and now working on porting my OpeningTree on iOS to Android. OpeningTree on iOS uses Crafty with Robert Hyatts permission to link to the code. On Android I can just open binaries so using Stockfish 10. Now what's confusing is at the Stockfish download site there are 3 binaries in the Android folder but only one works for me on my two tablets: stockfish-10-armv7. But on simulator none of the 3 Stockfish binaries work however this file I got out of the Droidfish assets folder works: stockfish-x86.

I'm wondering if anyone knows what engine files to use when on Android for Stockfish in particular but more generally all of Android as it's natural over time to open more engines than one. Glad to have any help with this even if you don't use Stockfish but know a bit about Android or any contributions on topic in general.

thanks
Mike

Ras
Posts: 1101
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: understanding android chess engine binary formats

Post by Ras » Tue Feb 19, 2019 3:55 pm

Basically, you have Android in 32 bit, that's the armv7 executable. And then in 64 bit, that's the arm64 ones. The arm64-pgo is optimised after profiling, so it is faster than the normal arm64 one, but the arm64-pgo has the drawback of being twice as large. All of them are for ARM CPUs, which are the norm with Android devices.

Newer Android devices have an ARM CPU that can run 64 bit executables. From August 2019, 64 bit support will be mandatory in Google's app store anyway. So ARM 32 bit executables are for old devices. The supplied one will require at least Android 4.1 (from 2012) because this is the oldest Android version that can run position independent code - a feature that Android 5.0 or later requires from executables, or else Android 5.0 or later will not start them.

Android devices with Intel x86 CPUs are rare, but they can also run ARM executables in 32 bit, albeit with 50% performance loss because of the emulation. They cannot run ARM-64 executables. Given that Intel has failed on the smartphone market and then withdrawn, and that AMD has never been there, Android devices with x86 CPUs are irrelevant in terms of market share.

The simulator on the PC runs on an x86 CPU, and if it doesn't emulate a complete ARM CPU, then it's clear why it can only run an x86 executable. In this case, the intended usage is compiling from source and debugging.
Rasmus Althoff
https://www.ct800.net

adams161
Posts: 490
Joined: Sun May 13, 2007 7:55 pm
Location: Tacoma, WA USA

Re: understanding android chess engine binary formats

Post by adams161 » Wed Feb 20, 2019 8:22 am

Thank you for the answer. Makes it easier to understand. I guess the trick is to know when you got 64 bit support.

Post Reply