SugaR XPrO 1.3

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

Re: SugaR XPrO 1.3

Post by kranium »

Modern Times wrote:
SzG wrote:Is there some added value to the latest SF development version or are they paractically the same?
I wonder what the code changes are. I guess Stockfish code is quite large, so 99% of the code is probably the same. Would be interesting to know.

Hi guys,
I had some time, and a nice diff tool that can identify changes real easy...here's a quick synopsis.

Sugar has the following code that newest SF-dev version does not currently contain:

Features:
Large Pages
Persistent Hash
Cerebellum and
Ownbook (polyglot .bin) book

Eval:
knight and bishop outpost slightly revalued
const Score WeakUnopposedPawn = S( 5, 25) added
code for UCI evaluation weights

Endgame functions:
Draw detection with 2 or more bishops of the same color and no pawns
Fortress detection
KPKN function
KPKB function
KQKN function
KQKB function

Search:
Tactical Mode
added code for Contempt and OwnBook
1 ply 'tweak' to seldepth

UCI Options:
o["Tactical Mode"] << Option(false);
o["Debug Log File"] << Option("", on_logger);
o["Contempt Factor"] << Option(0, -100, 100);
o["OwnBook"] << Option(false);
o["Threads"] << Option(n, 1, 512, on_threads);
o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size);
o["Clear Hash"] << Option(on_clear_hash);
o["Clean Search"] << Option(false);
o["Ponder"] << Option(false);
//Add evaluation weights.
o["Material (Midgame)"] << Option(100, 0, 500, on_eval);
o["Material (Endgame)"] << Option(100, 0, 500, on_eval);
o["Imbalance (Midgame)"] << Option(100, 0, 500, on_eval);
o["Imbalance (Endgame)"] << Option(100, 0, 500, on_eval);
o["Pawn Structure (Midgame)"] << Option(100, 0, 500, on_eval);
o["Pawn Structure (Endgame)"] << Option(100, 0, 500, on_eval);
o["Mobility (Midgame)"] << Option(100, 0, 500, on_eval);
o["Mobility (Endgame)"] << Option(100, 0, 500, on_eval);
o["Passed Pawns (Midgame)"] << Option(100, 0, 500, on_eval);
o["Passed Pawns (Endgame)"] << Option(100, 0, 500, on_eval);
o["King Safety (Midgame)"] << Option(100, 0, 500, on_eval);
o["King Safety (Endgame)"] << Option(100, 0, 500, on_eval);
o["Threats (Midgame)"] << Option(100, 0, 500, on_eval);
o["Threats (Endgame)"] << Option(100, 0, 500, on_eval);
o["Space"] << Option(100, 0, 500, on_eval);
o["MultiPV"] << Option(1, 1, 500);
o["Skill Level"] << Option(20, 0, 20);
o["NeverClearHash"] << Option(false);
o["HashFile"] << Option("SugaR_hash.hsh", on_HashFile);
o["SaveHashtoFile"] << Option(SaveHashtoFile);
o["LoadHashfromFile"] << Option(LoadHashfromFile);
o["LoadEpdToHash"] << Option(LoadEpdToHash);
o["Best Book Move"] << Option(false);
o["Book File"] << Option("NULL");
o["Move Overhead"] << Option(100, 0, 5000);
o["nodestime"] << Option(0, 0, 10000);
o["UCI_Chess960"] << Option(false);
o["SyzygyPath"] << Option("<empty>", on_tb_path);
o["Use Syzygy"] << Option(true);
o["Large Pages"] << Option(true, on_large_pages);
//Cerebellum Book Library
o["Cerebellum Library"] << Option();
o["Book Move2 Probability"] << Option(0, 0, 100, on_book_move2_prob);
o["BookPath"] << Option("<Cerebellum_Light.bin>", on_brainbook_path);

Hope this is of some help,
Norm
Last edited by kranium on Fri Sep 29, 2017 12:41 am, edited 1 time in total.
User avatar
Graham Banks
Posts: 41468
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: SugaR XPrO 1.3

Post by Graham Banks »

Thanks Norm. :)
gbanksnz at gmail.com
Modern Times
Posts: 3550
Joined: Thu Jun 07, 2012 11:02 pm

Re: SugaR XPrO 1.3

Post by Modern Times »

kranium wrote: Hi guys,
I had some time, and a nice diff tool that can identify changes real easy...here's a quick synopsis.
Very useful, thanks. In terms of lines of code, how many are different and how many lines in total ?
User avatar
Guenther
Posts: 4610
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: SugaR XPrO 1.3

Post by Guenther »

kranium wrote:
Modern Times wrote:
SzG wrote:Is there some added value to the latest SF development version or are they paractically the same?
I wonder what the code changes are. I guess Stockfish code is quite large, so 99% of the code is probably the same. Would be interesting to know.

Hi guys,
I had some time, and a nice diff tool that can identify changes real easy...here's a quick synopsis.

Sugar has the following code that newest SF-dev version does not currently contain:

Features:
Large Pages
Persistent Hash
Cerebellum and
Ownbook (polyglot .bin) book

Eval:
knight and bishop outpost slightly revalued
const Score WeakUnopposedPawn = S( 5, 25) added
code for UCI evaluation weights

Endgame functions:
Draw detection with 2 or more bishops of the same color and no pawns
Fortress detection
KPKN function
KPKB function
KQKN function
KQKB function

Search:
Tactical Mode
added code for Contempt and OwnBook
1 ply 'tweak' to seldepth

UCI Options:
o["Tactical Mode"] << Option(false);
o["Debug Log File"] << Option("", on_logger);
o["Contempt Factor"] << Option(0, -100, 100);
o["OwnBook"] << Option(false);
o["Threads"] << Option(n, 1, 512, on_threads);
o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size);
o["Clear Hash"] << Option(on_clear_hash);
o["Clean Search"] << Option(false);
o["Ponder"] << Option(false);
//Add evaluation weights.
o["Material (Midgame)"] << Option(100, 0, 500, on_eval);
o["Material (Endgame)"] << Option(100, 0, 500, on_eval);
o["Imbalance (Midgame)"] << Option(100, 0, 500, on_eval);
o["Imbalance (Endgame)"] << Option(100, 0, 500, on_eval);
o["Pawn Structure (Midgame)"] << Option(100, 0, 500, on_eval);
o["Pawn Structure (Endgame)"] << Option(100, 0, 500, on_eval);
o["Mobility (Midgame)"] << Option(100, 0, 500, on_eval);
o["Mobility (Endgame)"] << Option(100, 0, 500, on_eval);
o["Passed Pawns (Midgame)"] << Option(100, 0, 500, on_eval);
o["Passed Pawns (Endgame)"] << Option(100, 0, 500, on_eval);
o["King Safety (Midgame)"] << Option(100, 0, 500, on_eval);
o["King Safety (Endgame)"] << Option(100, 0, 500, on_eval);
o["Threats (Midgame)"] << Option(100, 0, 500, on_eval);
o["Threats (Endgame)"] << Option(100, 0, 500, on_eval);
o["Space"] << Option(100, 0, 500, on_eval);
o["MultiPV"] << Option(1, 1, 500);
o["Skill Level"] << Option(20, 0, 20);
o["NeverClearHash"] << Option(false);
o["HashFile"] << Option("SugaR_hash.hsh", on_HashFile);
o["SaveHashtoFile"] << Option(SaveHashtoFile);
o["LoadHashfromFile"] << Option(LoadHashfromFile);
o["LoadEpdToHash"] << Option(LoadEpdToHash);
o["Best Book Move"] << Option(false);
o["Book File"] << Option("NULL");
o["Move Overhead"] << Option(100, 0, 5000);
o["nodestime"] << Option(0, 0, 10000);
o["UCI_Chess960"] << Option(false);
o["SyzygyPath"] << Option("<empty>", on_tb_path);
o["Use Syzygy"] << Option(true);
o["Large Pages"] << Option(true, on_large_pages);
//Cerebellum Book Library
o["Cerebellum Library"] << Option();
o["Book Move2 Probability"] << Option(0, 0, 100, on_book_move2_prob);
o["BookPath"] << Option("<Cerebellum_Light.bin>", on_brainbook_path);

Hope this is of some help,
Norm
Well that tool cannot know yet if those 'changes' are mostly from older
SF versions, which is mostly the case.
You always get older + newer SF with Sugar and 0,001% random params changed.
https://rwbc-chess.de

trollwatch:
Talkchess nowadays is a joke - it is full of trolls/idiots/people stuck in the pleistocene > 80% of the posts fall into this category...
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: SugaR XPrO 1.3

Post by kranium »

Modern Times wrote:
kranium wrote: Hi guys,
I had some time, and a nice diff tool that can identify changes real easy...here's a quick synopsis.
Very useful, thanks. In terms of lines of code, how many are different and how many lines in total ?
Hi Ray,

cerebellum book comes from Stefan Zipproth's Brainfish of course, it's > 200 lines
polyglot book is by Fabien Letouzey and was implemented in earlier versions of SF > 400 lines
persistent hash is by Jeremy Bernstein's stockfish-TCEC6-PA_GTB and is > 250 lines
large pages code was present in previous versions of SF...I believe.

But examining and counting all the differing lines is fairly tedious, and not really meaningful, so I won't go there.
As everyone knows, Sugar is basically equivalent to recent SF dev, but with many added features and options.
In addition the author has also made some effort to improve eval.

I believe Sugar is often used by power users who want features like Large Pages, Cerebellum book, Persistent Hash, extra UCI options, etc., that SF dev does not include.
for ex: on Playchess game room, where any small advantage might mean an extra win.

In this manner it's become a useful and interesting fork for many.

Norm
corres
Posts: 3657
Joined: Wed Nov 18, 2015 11:41 am
Location: hungary

Re: SugaR XPrO 1.3

Post by corres »

Sugar has no "persistent hash".
It has "hash to file", "file to hash" and "EPD to hash" options.
The last arises from Jeremy`s work of PA-GTB only.
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: SugaR XPrO 1.3

Post by kranium »

corres wrote:Sugar has no "persistent hash".
It has "hash to file", "file to hash" and "EPD to hash" options.
The last arises from Jeremy`s work of PA-GTB only.
Thanks for the clarification...
kranium
Posts: 2129
Joined: Thu May 29, 2008 10:43 am

Re: SugaR XPrO 1.3

Post by kranium »

corres wrote:Sugar has no "persistent hash".
It has "hash to file", "file to hash" and "EPD to hash" options.
The last arises from Jeremy`s work of PA-GTB only.
Hi Robert-

Ok, the rest of Sugar 1.3's 'persistent hash'!? code also appears in Daniel Jose's release:
stockfish_x64_modern_170724_savehash
http://talkchess.com/forum/viewtopic.php?t=64720

stockfish-TCEC6-PA_GTB
http://www.open-chess.org/viewtopic.php?f=7&t=2663
Jeremy called it "permanent hash"

Perhaps you prefer that...
ie for me it's all the same: save/load hash from/to a file.

Norm
Modern Times
Posts: 3550
Joined: Thu Jun 07, 2012 11:02 pm

Re: SugaR XPrO 1.3

Post by Modern Times »

kranium wrote:As everyone knows, Sugar is basically equivalent to recent SF dev, but with many added features and options.
In addition the author has also made some effort to improve eval.

I believe Sugar is often used by power users who want features like Large Pages, Cerebellum book, Persistent Hash, extra UCI options, etc., that SF dev does not include.
for ex: on Playchess game room, where any small advantage might mean an extra win.

In this manner it's become a useful and interesting fork for many.

Norm
Great, thanks for the overview.
corres
Posts: 3657
Joined: Wed Nov 18, 2015 11:41 am
Location: hungary

Re: SugaR XPrO 1.3

Post by corres »

Norman,
Please read Jeremy`s note about "Persistent hash". You can find it Stockfish-TCEC6-PA_GTB.7z \source\ directory. This is the precise description of it.
Zerbinati coded to save hash to file on HDD or SSD and to load this file into hash like Daniel did it.
Jeremy`s work has particulars about taking EPD files into hash. Zerbinati use these codes in Sugar only and no the full "permanent hash" codes.
Note
I think it was good if Zerbinat would give me a description about options of Sugar.
Regards
Robert