Stockfish+

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

Moderators: hgm, Rebel, chrisw

kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Stockfish+

Post by kranium »

unfortunately, Sugar development has been discontinued, and
the github repositories have been deleted (or made private)

I had a forked the github repository before it's deletion

I've created a fork of Official Stockfish with 4 small changes from Sugar (credit to Marco Zerbinati):
https://github.com/FireFather/stockfish-plus

it adds some features that some may find interesting/useful:

polyglot (.bin) opening book support
load & use up to 2 .bin books simultaneously

system & hardware info on boot
routines for identifying the hardware specs of the system the engine is running on

extended compile info
indicating which CPU extension instruction sets were included when compiled

large page memory notification
simple message is displayed if Large Page memory allocation was successful

https://ibb.co/KmsngfR

the repository is otherwise identical to Official Stockfish
https://github.com/official-stockfish/Stockfish
and will be kept up-to-date (via github merge) with Official Stockfish on a daily basis

includes:
MSVS 2019 project files

PGO optimized binaries
stockfish+_221221_x64_bmi2.exe
stockfish+_221221_x64_avx2.exe

shell scripts and updated Makefile
makesf_bmi2.sh
makesf_avx2.sh

it is highly recommended to use MSYS2 (w/ minGW) to compile Windows binaries yourself,
as they are significantly faster (7-8%) than anything Microsoft Visual Studio can produce.

I ran
16384 ultra-fast (1000ms + 100ms) games vs today's Stockfish dev on an Intel i9-9900K using .bmi2 compiles
16384 ultra-fast (1000ms + 100ms) games vs today's Stockfish dev on an AMD Ryzen 9 3900X using the .avx2 compiles
to test any regression that may have occurred via the added code:

Code: Select all

stockfish_21122211  2741 :  32768 (+5149,=22707,-4912),  50.4 %
vs.                      :  games (    +,     =,    -),   (%) :   Diff,  SD, CFS (%)
stockfish+_221221        :  32768 ( 5149, 22707, 4912),  50.4 :     +3,   1,   97.1
   
# PLAYER                : RATING  ERROR   POINTS  PLAYED    (%)
1 stockfish_21122211    : 2741.3    1.5  16502.5   32768   50.4%
2 stockfish+_221221     : 2738.7    1.5  16265.5   32768   49.6%
ChickenLogic
Posts: 154
Joined: Sun Jan 20, 2019 11:23 am
Full name: kek w

Re: Stockfish+

Post by ChickenLogic »

kranium wrote: Wed Dec 22, 2021 10:04 pm extended compile info
indicating which CPU extension instruction sets were included when compiled

large page memory notification
simple message is displayed if Large Page memory allocation was successful
Both of these are in default Stockfish already or am I mistaken?
./stockfish compiler gives me this

Code: Select all

Stockfish 081221 by the Stockfish developers (see AUTHORS file)

Compiled by g++ (GNUC) 11.1.0 on Linux
Compilation settings include:  64bit BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT
__VERSION__ macro expands to: 11.1.0
Default SF also gave me info about large pages when I was using Windows. On Linux I don't see such messages but there's no reason for it to do so - it never failed me in thousands of hours running Stockfish (for fishtest and for analysis).

Other than that, polyglot book support is obviously helpful.
Lastly, I think that hardware detection and automatically setting correct UCI options should be a GUI feature. This way it only needs to be coded once (well, once per GUI) instead of each engine having to do it separately.
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: Stockfish+

Post by kranium »

ChickenLogic wrote: Wed Dec 22, 2021 10:33 pm
kranium wrote: Wed Dec 22, 2021 10:04 pm extended compile info
indicating which CPU extension instruction sets were included when compiled

large page memory notification
simple message is displayed if Large Page memory allocation was successful
Both of these are in default Stockfish already or am I mistaken?
./stockfish compiler gives me this

Code: Select all

Stockfish 081221 by the Stockfish developers (see AUTHORS file)

Compiled by g++ (GNUC) 11.1.0 on Linux
Compilation settings include:  64bit BMI2 AVX2 SSE41 SSSE3 SSE2 POPCNT
__VERSION__ macro expands to: 11.1.0
Default SF also gave me info about large pages when I was using Windows. On Linux I don't see such messages but there's no reason for it to do so - it never failed me in thousands of hours running Stockfish (for fishtest and for analysis).

Other than that, polyglot book support is obviously helpful.
Lastly, I think that hardware detection and automatically setting correct UCI options should be a GUI feature. This way it only needs to be coded once (well, once per GUI) instead of each engine having to do it separately.
On Windows, this is all I get:

Code: Select all

Stockfish 14.1 by the Stockfish developers (see AUTHORS file)
Stockfish+ includes a whole page of code -> version_helper.h, mainly concerned with identifying details about the particular flavor of Windows the engine is running under.
This obviously is of no benefit to Linux or Mac users.

I've never see a message concerning large page memory...
the user simply isn't notified if allocation was successful or if the program defaulted back to standard memory allocation,
The behavior can't be any different with linux and macOs compiles, the message code is just not there.
(perhaps it did exist in older SF versions? not sure)
Last edited by kranium on Wed Dec 22, 2021 11:43 pm, edited 6 times in total.
Eduard
Posts: 1439
Joined: Sat Oct 27, 2018 12:58 am
Location: Germany
Full name: N.N.

Re: Stockfish+

Post by Eduard »

You can download Sugar AI 2.50 on my homepage (upload on filehorst.de)

https://solista-chess.jimdosite.com/
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: Stockfish+

Post by kranium »

Update:
https://github.com/FireFather/stockfish-plus

this repository is identical to Official Stockfish
https://github.com/official-stockfish/Stockfish
and is kept up-to-date (via github merge) with Official Stockfish on a daily (if needed) basis

it adds some features that some may find interesting/useful:
  • polyglot (.bin) opening book support
    load & use up to 2 .bin books simultaneously

    system & hardware info on boot
    routines for identifying the hardware specs of the system the engine is running on

    extended compile info
    indicating which CPU extension instruction sets were included when compiled

    large page memory notification
    simple message is displayed if Large Page memory allocation was successful

    New
    MCTS/UCT (Monte Carlo Tree Search w/ Upper Confidence Bounds Applied to Trees)
    ...interesting alternative search method for Stockfish
  • minimax evaluation
    no AB rollouts
    full print children UCI info
    it's stable and well tested...
optimized binaries and source code available here:
https://github.com/FireFather/stockfish-plus

https://github.com/snicolet/Stockfish/c ... montecarlo
https://github.com/Kellykinyama12/Montecarlo
https://github.com/MoonstoneLight/SugaR-NN
https://github.com/amchess/BrainLearn
https://github.com/amchess/ShashChess
https://zipproth.de/Brainfish
thanks to snicolet, kellykinyama, mzerbinati, amchess, tzipproth
User avatar
Ozymandias
Posts: 1535
Joined: Sun Oct 25, 2009 2:30 am

Re: Stockfish+

Post by Ozymandias »

It's always nice to have polyglot support.
Eduard
Posts: 1439
Joined: Sat Oct 27, 2018 12:58 am
Location: Germany
Full name: N.N.

Re: Stockfish+

Post by Eduard »

Cool, thanks!! Very interesting engine. Of course I also played with it on the server and am undefeated.

Thanks for the new features!
It's also nice that two BIN books can be loaded.

I still regret the stop by SugaR AI. MZ has the features

Materialistic Evaluation Strategy
and
Positional Evaluation Strategy

in SugaR AI 2.50 implemented. Can that also be implemented in Stockfish +?
Last edited by Eduard on Sun Jan 02, 2022 11:10 am, edited 3 times in total.
purechess
Posts: 82
Joined: Wed Nov 28, 2018 1:28 pm
Full name: Heinrich Pulliter

Re: Stockfish+

Post by purechess »

Ozymandias wrote: Sun Jan 02, 2022 8:22 am It's always nice to have polyglot support.
Use Polyglot adapter and you have that with any engine
Eduard
Posts: 1439
Joined: Sat Oct 27, 2018 12:58 am
Location: Germany
Full name: N.N.

Re: Stockfish+

Post by Eduard »

First Analyses with MCTS on Ryzen 3900X:


[fen]2brrbk1/qp1n1ppp/pnp5/4p3/1PR5/PN1P1NPP/4PPB1/B1Q1R1K1 w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

24.Re4 Qb8 25.d4 f5 26.Rxe5 Nxe5 27.dxe5 Qc7 28.Qc2 Qf7 29.Nbd4 Be7 30.e3 Rf8 31.h4 Kh8 32.Qc1 Nd5 33.Ne2 Rde8 34.Nf4 Nxf4 35.exf4 Be6 36.Nd4 Ra8 37.Bf1 a5 38.Nxe6 Qxe6 39.Bc4 Qg6 40.Bc3 Bxh4 41.Qe3 Rfe8 42.bxa5 Bd8 43.a6 bxa6 44.e6
White is clearly better: +/- (1.39 ++) Depth: 36/47 00:00:32 613MN

24.Re4 Qb8 25.d4 exd4 26.Rxd4 Nd5 27.Nh4 Nc7 28.Nf5 f6 29.Nd6 Bxd6 30.Rxd6 Nd5 31.Bxd5+ cxd5 32.Rxd5 Nf8 33.Rxd8 Rxd8 34.h4 h6 35.Nc5 Qc7 36.Ne4 Qe7 37.Qc4+ Kh7 38.f3 Bf5 39.Kf2 Bxe4 40.Qxe4+ Qxe4 41.fxe4 Rd2 42.e5 f5 43.Ke3 Ra2 44.Kd4 Rxa3 45.Kd5 Rxg3 46.e3 Ng6 47.e6
White is clearly better: +/- (1.46 ++) Depth: 40/59 00:01:18 1457MN, tb=49


[fen]r1b2rk1/pp5p/1n2pp2/3p4/2P2B2/b1P2NPq/P1Q1BP1P/1K1R3R w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

19.Ng1 Qf5 20.Qxf5 exf5 21.Bf3 Bd7 22.Ne2 Ba4 23.Rd4
White is better: +/- (0.91) Depth: 10/15 00:00:00
19.Ng1 Qf5 20.Qxf5 exf5 21.Bf3 Bd7 22.Ne2 Ba4 23.cxd5 Bxd1 24.Rxd1 Rac8 25.d6 Rfd8
White is better: +/- (0.80) Depth: 11/16 00:00:00
19.cxd5 e5 20.Be3 Bf5 21.Bd3 Bxd3 22.Qxd3 Qd7 23.Bxb6 axb6 24.Nd2
White is better: +/- (0.84) Depth: 12/19 00:00:00
(---)
19.g4
White is better: +/- (1.00 ++) Depth: 29/47 00:00:03 65984kN, tb=15
(---)
19.g4 e5 20.Be3 Bxg4 21.Rhg1 Kh8 22.Ng5 fxg5 23.Bxg4 Qh6 24.Be2 Be7 25.h4 Nxc4 26.Bxc4 dxc4 27.hxg5 Qg6 28.Qxg6 hxg6 29.Rd7 Rfe8 30.Kc2 b5 31.Rh1+ Kg8 32.Rh6 Kf7 33.Rb7 a6 34.Rh7+ Ke6 35.Rg7 Bd8 36.Rxg6+ Kf5 37.Rd6 Rf8 38.Rg7 Rc8 39.f3 Ba5 40.Rxa6 Ra8 41.Rxa8 Rxa8 42.Rf7+ Kg6 43.Rf6+ Kg7
White is clearly better: +- (1.96) Depth: 32/51 00:00:08 157MN, tb=1269


[fen]r5rk/1bq1bpp1/1p1ppn1p/pP5P/2P1P3/P1N2P2/1B1Q1P2/1K1R1BR1 w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

19.Qe3 e5 20.f4 Nd7 21.Bd3 Qc5 22.Qxc5 Nxc5 23.fxe5 dxe5 24.Bc2 Rae8 25.f3 Rd8 26.Nd5 Bxd5 27.exd5 Bd6 28.Bc1 Nb7 29.Be3 Bc5 30.Bxc5 Nxc5 31.d6 g6 32.hxg6 fxg6 33.Kb2 Kh7 34.Rd5 h5 35.Rxe5 Rxd6 36.Rxh5+ Kg7 37.Rhg5 Kf7 38.Kc3 Re6 39.f4 Re3+ 40.Kb2 Ne4 41.Bxe4 Rxe4
White is clearly better: +- (1.90 ++) Depth: 36/55 00:00:16 328MN, tb=305
19.Nd5
White is clearly better: +- (2.02 ++) Depth: 36/55 00:00:16 337MN, tb=319
19.Nd5
White is clearly better: +- (2.19 ++) Depth: 36/55 00:00:17 345MN, tb=333
19.Nd5
White is clearly better: +- (2.43 ++) Depth: 36/55 00:00:17 351MN, tb=334
19.Nd5
White has a decisive advantage: +- (2.75 ++) Depth: 36/55 00:00:18 371MN, tb=334
19.Nd5
White has a decisive advantage: +- (3.18 ++) Depth: 36/55 00:00:19 385MN, tb=395

Impressive!
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: Stockfish+

Post by Joerg Oster »

Eduard wrote: Sun Jan 02, 2022 11:22 am First Analyses with MCTS on Ryzen 3900X:


[fen]2brrbk1/qp1n1ppp/pnp5/4p3/1PR5/PN1P1NPP/4PPB1/B1Q1R1K1 w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

24.Re4 Qb8 25.d4 f5 26.Rxe5 Nxe5 27.dxe5 Qc7 28.Qc2 Qf7 29.Nbd4 Be7 30.e3 Rf8 31.h4 Kh8 32.Qc1 Nd5 33.Ne2 Rde8 34.Nf4 Nxf4 35.exf4 Be6 36.Nd4 Ra8 37.Bf1 a5 38.Nxe6 Qxe6 39.Bc4 Qg6 40.Bc3 Bxh4 41.Qe3 Rfe8 42.bxa5 Bd8 43.a6 bxa6 44.e6
White is clearly better: +/- (1.39 ++) Depth: 36/47 00:00:32 613MN

24.Re4 Qb8 25.d4 exd4 26.Rxd4 Nd5 27.Nh4 Nc7 28.Nf5 f6 29.Nd6 Bxd6 30.Rxd6 Nd5 31.Bxd5+ cxd5 32.Rxd5 Nf8 33.Rxd8 Rxd8 34.h4 h6 35.Nc5 Qc7 36.Ne4 Qe7 37.Qc4+ Kh7 38.f3 Bf5 39.Kf2 Bxe4 40.Qxe4+ Qxe4 41.fxe4 Rd2 42.e5 f5 43.Ke3 Ra2 44.Kd4 Rxa3 45.Kd5 Rxg3 46.e3 Ng6 47.e6
White is clearly better: +/- (1.46 ++) Depth: 40/59 00:01:18 1457MN, tb=49


[fen]r1b2rk1/pp5p/1n2pp2/3p4/2P2B2/b1P2NPq/P1Q1BP1P/1K1R3R w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

19.Ng1 Qf5 20.Qxf5 exf5 21.Bf3 Bd7 22.Ne2 Ba4 23.Rd4
White is better: +/- (0.91) Depth: 10/15 00:00:00
19.Ng1 Qf5 20.Qxf5 exf5 21.Bf3 Bd7 22.Ne2 Ba4 23.cxd5 Bxd1 24.Rxd1 Rac8 25.d6 Rfd8
White is better: +/- (0.80) Depth: 11/16 00:00:00
19.cxd5 e5 20.Be3 Bf5 21.Bd3 Bxd3 22.Qxd3 Qd7 23.Bxb6 axb6 24.Nd2
White is better: +/- (0.84) Depth: 12/19 00:00:00
(---)
19.g4
White is better: +/- (1.00 ++) Depth: 29/47 00:00:03 65984kN, tb=15
(---)
19.g4 e5 20.Be3 Bxg4 21.Rhg1 Kh8 22.Ng5 fxg5 23.Bxg4 Qh6 24.Be2 Be7 25.h4 Nxc4 26.Bxc4 dxc4 27.hxg5 Qg6 28.Qxg6 hxg6 29.Rd7 Rfe8 30.Kc2 b5 31.Rh1+ Kg8 32.Rh6 Kf7 33.Rb7 a6 34.Rh7+ Ke6 35.Rg7 Bd8 36.Rxg6+ Kf5 37.Rd6 Rf8 38.Rg7 Rc8 39.f3 Ba5 40.Rxa6 Ra8 41.Rxa8 Rxa8 42.Rf7+ Kg6 43.Rf6+ Kg7
White is clearly better: +- (1.96) Depth: 32/51 00:00:08 157MN, tb=1269


[fen]r5rk/1bq1bpp1/1p1ppn1p/pP5P/2P1P3/P1N2P2/1B1Q1P2/1K1R1BR1 w - - 0 1[/fen]


Analysis by Stockfish+ 020122:

19.Qe3 e5 20.f4 Nd7 21.Bd3 Qc5 22.Qxc5 Nxc5 23.fxe5 dxe5 24.Bc2 Rae8 25.f3 Rd8 26.Nd5 Bxd5 27.exd5 Bd6 28.Bc1 Nb7 29.Be3 Bc5 30.Bxc5 Nxc5 31.d6 g6 32.hxg6 fxg6 33.Kb2 Kh7 34.Rd5 h5 35.Rxe5 Rxd6 36.Rxh5+ Kg7 37.Rhg5 Kf7 38.Kc3 Re6 39.f4 Re3+ 40.Kb2 Ne4 41.Bxe4 Rxe4
White is clearly better: +- (1.90 ++) Depth: 36/55 00:00:16 328MN, tb=305
19.Nd5
White is clearly better: +- (2.02 ++) Depth: 36/55 00:00:16 337MN, tb=319
19.Nd5
White is clearly better: +- (2.19 ++) Depth: 36/55 00:00:17 345MN, tb=333
19.Nd5
White is clearly better: +- (2.43 ++) Depth: 36/55 00:00:17 351MN, tb=334
19.Nd5
White has a decisive advantage: +- (2.75 ++) Depth: 36/55 00:00:18 371MN, tb=334
19.Nd5
White has a decisive advantage: +- (3.18 ++) Depth: 36/55 00:00:19 385MN, tb=395

Impressive!
This looks pretty much like a AB search to me.
Unfortunately, Stockfish+ doesn't compile under Linux out-of-the-box, so I cannot verify.
Jörg Oster