lichess-org/fishnet

FreeBSD support

Cubox opened this issue · 6 comments

Cubox commented

Hi,

I got my fishnet key today, and I was able to start contributing from my FreeBSD server. In doing so, I identified a few issues with the process, due to FreeBSD being not explicitly supported (mainly the precompiled binaries). This is from the "compiling from source" path

Since the binaries are not there in assets, everything will run fine, until fishnet calls the stockfish binary.
From there, every analysis will crash, due to the ELF not executing. This is fixed by taking my own compiled stockfish binary (compiled myself), and replacing the .xz with it.
However, when fishnet wants to use the -mv- variant binary, which I don't have for FreeBSD, the analysis will crash. After checking a few games URL of the crashed evaluations, the server analysis will hang on Lichess, making the user wait (unknown if it'll timeout and when it does, if the system will request another server to do it)

There is also a question about the stockfish binary. What version of stockfish should be used? Is master OK, or should it absolutely be the latest release? I don't want to create errors in the results by using either a version too new or too old... I guess I could use the https://github.com/niklasf/Stockfish/tree/fishnet-master repo for my stockfish binary. But that adds work, since the Stockfish binary I have already was not meant for fishnet
Are you even checking the binary's version to make sure people are not using outdated stockfish versions?

Here are a list of possible ways to get this fixed:

  • Support FreeBSD binaries. This is high work, for low reward, especially if you require reproducible builds.
  • Ban FreeBSD users. This will make me sad, as my server which has been crunching games (around 600 games in a few hours)
  • Detect when users are starting fishnet with an unsupported OS, and let them know they need to provide their own stockfish binaries. You could do this either at configuration and also if you are getting an Engine error: unexpected end of file with the engine sending to stderr ELF binary type "0" not known. (or variants) EDIT: Also tell them which binary exactly will be called, for the featureset
  • Let users flag themselves as being unable to process variants. This would prevent fishnet from sending those games to this instance, which will fail when running the -mv- binary.
  • At least mention this in the README. If you want to enforce having both binaries, make it clear. If not, you need to provide a way to opt-out of -mv- tasks. FreeBSD users will be instructed that if they want to contribute, they need to compile their own Stockfish, with mention of which version (and where to get it from).

I hope this is not making more work than what I'm contributing to Lichess, and even if you ignore it all, I will now compile the mv binary, to avoid any delays for user game analysis.

Hi. I'm not the developer, just a fishnet user and development observer. Would this meet your need ?
https://wiki.freebsd.org/LinuxJails

I believe fishnet is working towards completely reproducible results regardless of the client. Compiling your own stockfish may complicate that goal.

Cubox commented

Thanks for your input,
FreeBSD is capable (with a bit of setup) to run Linux binaries, I'm assuming what you linked takes advantage of that. However it does require some setup, and installing a Linux environment (glibc and al)
Between making Linux ELFs work and compiling my own (FreeBSD) native Stockfish (normal and mv), I'll take compiling my own.

I understand for the reproducible results (and I agree), and this is fixed by compiling the exact same version of Stockfish as fishnet uses. But this needs to be explicitly said in that event

This should have failed at compile time. Fixed via 6cf4b6e.

For proper FreeBSD support, we'd need to be able to automatically build Stockfish binaries. I started with
https://github.com/niklasf/Stockfish/blob/fishnet-master-freebsd/.github/workflows/build.yml (currently failing with https://github.com/niklasf/Stockfish/runs/1866172734?check_suite_focus=true, help appreciated).

If you want to run it in the meantime, please use the fishnet-master and fishnet-mv branches, with a ...-dev version of the fishnet client. Failed variant analysis will be picked up by another client after a timeout, but of course it's still a bad user experience. So please don't run your client before this is fixed or before there is a workaround.

Cubox commented
Cubox commented

Hi @niklasf, thanks for your reply.
I'm glad you want to add FreeBSD to the supported systems :) I'm happy to help with that, I sent quickly a reply, but you will need to use gmake to build stockfish. FreeBSD's make is different from the GNU make Stockfish uses. It should be in the ports.

For myself, for now, I have built the binaries using the fishnet-master and fishnet-mv branches and am running fishnet, without a hitch.

Let me know if the FreeBSD build is giving you more troubles

The latest development version should now properly pick the new FreeBSD binaries.