Light weight engines

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

chesskobra
Posts: 355
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Light weight engines

Post by chesskobra »

What are some lightweight and strong engines? Of course, lightweight and strong are relative terms, so, for reference, consider Crafty 25.6 (435 kB), Altair 5.0.0 (298 kB), Laser 1.8 beta (245 kB), Komodo 14.1 (1.8 MB). Fruit 2.1 (97 kB). Some other engines may have small executables not including their large neural networks. What are some other engines comparable to any of the above engines? For their sizes the above engines are pretty strong. I wish engine ratings had weight categories.

The recent Stockfish 17 is 78 MB. I have difficulty running it under cutechess (but I don't know if it has anything to do with the size).
gaard
Posts: 463
Joined: Mon Jun 07, 2010 3:13 am
Location: Holland, MI
Full name: Martin W

Re: Light weight engines

Post by gaard »

chesskobra wrote: Sun Sep 22, 2024 10:12 pm What are some lightweight and strong engines? Of course, lightweight and strong are relative terms, so, for reference, consider Crafty 25.6 (435 kB), Altair 5.0.0 (298 kB), Laser 1.8 beta (245 kB), Komodo 14.1 (1.8 MB). Fruit 2.1 (97 kB). Some other engines may have small executables not including their large neural networks. What are some other engines comparable to any of the above engines? For their sizes the above engines are pretty strong. I wish engine ratings had weight categories.

The recent Stockfish 17 is 78 MB. I have difficulty running it under cutechess (but I don't know if it has anything to do with the size).
Compiler switches can dramatically change an executable's size without significantly affecting performance. Maybe LOC would be a better metric for your purposes? Run strip on some of those engines and watch their size shrink by 25% or more while remaining 100% identical functionally.
User avatar
hgm
Posts: 28405
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Light weight engines

Post by hgm »

But I don't think we are talking about differences of 25% here. Even with advanced hand-crafted evaluation engine executables can easily be well below 1 MB, while neural nets often are hundreds of MB.
adnoh
Posts: 76
Joined: Tue Jun 26, 2007 6:31 am
Full name: Charles Wong

Re: Light weight engines

Post by adnoh »

Twsited Logic 20200815? 2864 on CCRL Blitz and the Jim Ablett build I am using is only 84,992 bytes

https://computerchess.org.uk/ccrl/404/c ... 815_64-bit
Viz
Posts: 223
Joined: Tue Apr 09, 2024 6:24 am
Full name: Michael Chaly

Re: Light weight engines

Post by Viz »

If you want the strongest chess engine without big net file you probably want latest stockfish HCE (it even has special tag on github).
Should be reasonably strong and absolutely much stronger than any engine of comparable size - and by a lot.
Guenther
Posts: 4718
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Light weight engines

Post by Guenther »

adnoh wrote: Mon Sep 23, 2024 6:06 pm Twsited Logic 20200815? 2864 on CCRL Blitz and the Jim Ablett build I am using is only 84,992 bytes

https://computerchess.org.uk/ccrl/404/c ... 815_64-bit
The whole thread is quite useless, especially since we have TBs of HD space and GB internet.

BTW guess what, the TwistedLogic version you name is compressed by upx 4.23 ;)
So much about size of binaries as a kind of 'metric' for whatever...

Much better metric would be e.g. LOC as already mentioned by Martin.
https://rwbc-chess.de

[Trolls n'existent pas...]
Jouni
Posts: 3715
Joined: Wed Mar 08, 2006 8:15 pm
Full name: Jouni Uski

Re: Light weight engines

Post by Jouni »

"The whole thread is quite useless, especially since we have TBs of HD space and GB internet." My HD is 256 GB and totally enough. Below 100 GB used :) .
Jouni
tmokonen
Posts: 1363
Joined: Sun Mar 12, 2006 6:46 pm
Location: Kelowna
Full name: Tony Mokonen

Re: Light weight engines

Post by tmokonen »

Personally, I like when programmers try to get as much as possible out of a small package, like the programs that competed in the TCEC 4k competition, or efforts like MicroMax and Toledo Chess.
chesskobra
Posts: 355
Joined: Thu Jul 21, 2022 12:30 am
Full name: Chesskobra

Re: Light weight engines

Post by chesskobra »

I have SF 16, which has both HCE and NNUE options. Can I compile it without the NNUE option?

Here are some sizes: SF17 (78 MB), which I guess includes a huge network, SF16 (40 MB), SF13 (22MB), and ShashChess (78MB), which is weaker than SF17, but equal to SF17 in size! How big will be SF18 or SF20? Will the networks get bigger and bigger?

I also doubt that compiler options or some other tools could magically reduce the executable size significantly. Also, I don't understand why LOC is a better metric than the size of the executable. Of course, I can believe that there are engines with a small LOC count that are strong - all you have to do is write a small piece of code that can create arbitrarily large neural network.
ydebilloez
Posts: 186
Joined: Tue Jun 27, 2017 11:01 pm
Location: Lubumbashi
Full name: Yves De Billoëz

Re: Light weight engines

Post by ydebilloez »

To throw in some elements: My C++ engine weight is about 425KB on mac (and linux dynamic), because dynamic builds are common. On Linux with static linking, it goes up to 2.4MB. The same on windows with the cross compiler is 1.3MB.... All this uncompressed. Older versions were only 160KB. So it all depends on linker options (largely), compiler optimisation settings (for a tiny part), and 8, 32 or 64 bit target (very small impact). The smallest chess program available is less than 1Kb and you get acceptable play below 5KB program sizes.
Yves De Billoëz @ macchess belofte chess
Once owner of a Mephisto I, II, challenger, ... chess computer.