McBrain v9.9 / McCain v2 Release

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

Moderators: hgm, Rebel, chrisw

User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

McBrain v9.9 / McCain v2 Release

Post by MikeB »

A duo release based on the current developmental Stockfish derivative SugaR code by Marco Zerbinati.

Details and downloads can be found here:

https://github.com/MichaelB7/Stockfish/releases/tag/9.9

Enjoy!
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: McBrain v9.9 / McCain v2 Release

Post by MikeB »

MikeB wrote: Tue Sep 04, 2018 4:40 am A duo release based on the current developmental Stockfish derivative SugaR code by Marco Zerbinati.

Details and downloads can be found here:

https://github.com/MichaelB7/Stockfish/releases/tag/9.9

Enjoy!
For my macOS friends, I also added Stockfish compiles of the version that will play in TCEC 13, Bench nodes: 460964.
https://github.com/MichaelB7/Stockfish/ ... 609645.zip
Bmi2 and modern, clang and gcc versions, MacPorts and Apple finally got their act together and PGO is now fixed with gcc and clang for bmi2 and modern exe's.

The fastest SF I have compiled in a while:

Code: Select all

bench (iMac 2015/bmi2)
===========================
Total time (ms) : 1807
Nodes searched  : 4609645
Nodes/second    :  2550993

bench 64 4 20 (iMac 2015/bmi2)
===========================
Total time (ms)  : 17973
Nodes searched  : 165458320
Nodes/second    : 9205937

bench (MacPro 2010/modern)
===========================
Total time (ms) : 2362
Nodes searched  : 4609645
Nodes/second    : 1951585

bench 64 12 20 (MacPro 2010/modern)
===========================
Total time (ms) : 16030
Nodes searched  : 332451059
Nodes/second    : 20739304
Image
User avatar
Marek Soszynski
Posts: 581
Joined: Wed May 10, 2006 7:28 pm
Location: Birmingham, England

Re: McBrain v9.9 / McCain v2 Release

Post by Marek Soszynski »

I realise that McCain is named in tribute, but how is it different from McBrain?
Marek Soszynski
User avatar
Eelco de Groot
Posts: 4561
Joined: Sun Mar 12, 2006 2:40 am
Full name:   

Re: McBrain v9.9 / McCain v2 Release

Post by Eelco de Groot »

Marek Soszynski wrote: Thu Sep 06, 2018 7:51 am I realise that McCain is named in tribute, but how is it different from McBrain?
I did not do a real comparison, also there is only one sourcecode for both versions. If you want explanation as well I can not help you :) The only difference I found with a quick look is here in evaluate.cpp (and switches in the makefile that would compile this code in two versions):

Code: Select all

#ifdef Maverick
	// Compute the initiative bonus for the attacking side
	int complexity =   8 * pe->pawn_asymmetry()
					+ 12 * pos.count<PAWN>()
	  				+ 12 * outflanking
					+ 32 * pawnsOnBothFlanks
	  				+ 48 * !pos.non_pawn_material()
	  				- 132;
#else
    // Compute the initiative bonus for the attacking side
    int complexity =   8 * pe->pawn_asymmetry()
                    + 12 * pos.count<PAWN>()
                    + 12 * outflanking
	  	    + 16 * pawnsOnBothFlanks
                    + 48 * !pos.non_pawn_material()
                    - 116;
#endif
    // Now apply the bonus: note that we find the attacking side by extracting
    // the sign of the endgame value, and that we carefully cap the bonus so
// that the endgame score will never change sign after the bonus.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: McBrain v9.9 / McCain v2 Release

Post by MikeB »

Marek Soszynski wrote: Thu Sep 06, 2018 7:51 am I realise that McCain is named in tribute, but how is it different from McBrain?
I compressed the piece values in types.h to play more in a “Maverick” style - McCain was known as a maverick ( unconventional ) politician - often crossed the party line on different issues - most often for the rights of the disadvantaged.

I believe there was one other minor tweak. For the raspberry Pi edition , which uses a an “eng” file for different play levels - most of the play levels are based on Naval ranks - McCain served in the Navy as a fighter pilot and also attended the Naval Academy. Some of the very weak levels are named after different people involved with the Trump Administration with the level “Trump” being the weakest possible opponent I could possibly make. 😊
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: McBrain v9.9 / McCain v2 Release

Post by MikeB »

Eelco de Groot wrote: Thu Sep 06, 2018 10:27 pm
Marek Soszynski wrote: Thu Sep 06, 2018 7:51 am I realise that McCain is named in tribute, but how is it different from McBrain?
I did not do a real comparison, also there is only one sourcecode for both versions. If you want explanation as well I can not help you :) The only difference I found with a quick look is here in evaluate.cpp (and switches in the makefile that would compile this code in two versions):

Code: Select all

#ifdef Maverick
	// Compute the initiative bonus for the attacking side
	int complexity =   8 * pe->pawn_asymmetry()
					+ 12 * pos.count<PAWN>()
	  				+ 12 * outflanking
					+ 32 * pawnsOnBothFlanks
	  				+ 48 * !pos.non_pawn_material()
	  				- 132;
#else
    // Compute the initiative bonus for the attacking side
    int complexity =   8 * pe->pawn_asymmetry()
                    + 12 * pos.count<PAWN>()
                    + 12 * outflanking
	  	    + 16 * pawnsOnBothFlanks
                    + 48 * !pos.non_pawn_material()
                    - 116;
#endif
    // Now apply the bonus: note that we find the attacking side by extracting
    // the sign of the endgame value, and that we carefully cap the bonus so
// that the endgame score will never change sign after the bonus.
also there is a #ifdef Maverick in pawns.cpp line 382, increasing the value of safety

Code: Select all

 #ifdef Maverick
    Value safety = (shift<Down>(theirPawns) & (FileABB | FileHBB) & BlockRanks & ksq) ?
	Value(448) : Value(6);
#else
	Value safety = (shift<Down>(theirPawns) & (FileABB | FileHBB) & BlockRanks & ksq) ?
	Value(374) : Value(5);
#endif
and types.h line 174 compressing the piece values , but compressing the piece values more for the major pieces relative to minor pieces and pawns, it also has a side effect of giving the evaluation function more weighting (since piece values are less) - the point being with the maverick changes, it will attack a tad more aggressively and sacrificially when the position warrants it - the changes only cost maybe 5 elo vs the normal McBrain - but in many positions it sees things a little differently ... the changes are significant enough that it is a notable difference when a human plays against it - but for engine play it is a weaker engine ... (edit: my comment relates to one of the weaker levels - playing it full strength , human will get crushed as normal)

Code: Select all

#ifdef Maverick //MichaelB7
enum Value : int {
	VALUE_ZERO      = 0,
	VALUE_DRAW      = 0,
	VALUE_KNOWN_WIN = 10000,
	VALUE_MATE      = 32000,
	VALUE_INFINITE  = 32001,
	VALUE_NONE      = 32002,
	
	VALUE_MATE_IN_MAX_PLY  =  VALUE_MATE - 2 * MAX_PLY,
	VALUE_MATED_IN_MAX_PLY = -VALUE_MATE + 2 * MAX_PLY,
	
	PawnValueMg   = 142*10/11,   PawnValueEg   = 207*10/11,
	KnightValueMg = 784*9/10,   KnightValueEg = 868*9/10,
	BishopValueMg = 828*9/10,   BishopValueEg = 916*9/10,
	RookValueMg   = 1286*8/9,  RookValueEg   = 1378*8/9,
	QueenValueMg  = 2547*7/8,  QueenValueEg  = 2698*7/8,
	
	MidgameLimit  = 15258, EndgameLimit  = 3915
};
#else 
enum Value : int {
  VALUE_ZERO      = 0,
  VALUE_DRAW      = 0,
  VALUE_KNOWN_WIN = 10000,
  VALUE_MATE      = 32000,
  VALUE_INFINITE  = 32001,
  VALUE_NONE      = 32002,

  VALUE_MATE_IN_MAX_PLY  =  VALUE_MATE - 2 * MAX_PLY,
  VALUE_MATED_IN_MAX_PLY = -VALUE_MATE + 2 * MAX_PLY,

  PawnValueMg   = 142,   PawnValueEg   = 207,
  KnightValueMg = 784,   KnightValueEg = 868,
  BishopValueMg = 828,   BishopValueEg = 916,
  RookValueMg   = 1286,  RookValueEg   = 1378,
  QueenValueMg  = 2547,  QueenValueEg  = 2698,

  MidgameLimit  = 15258, EndgameLimit  = 3915
};
#endif
Image
Paloma
Posts: 1167
Joined: Thu Dec 25, 2008 9:07 pm
Full name: Herbert L

Re: McBrain v9.9 / McCain v2 Release

Post by Paloma »

On my machine error message libwinpthread-1.dll appears. :shock:

(J.Stanback compile)

Never had befor such error message with previuos McBrain's.

Win 7 Pro x64 , have other received the same messages ?
Vinvin
Posts: 5228
Joined: Thu Mar 09, 2006 9:40 am
Full name: Vincent Lejeune

Re: McBrain v9.9 / McCain v2 Release

Post by Vinvin »

Same for me :evil:
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: McBrain v9.9 / McCain v2 Release

Post by MikeB »

Paloma wrote: Sat Sep 08, 2018 3:21 pm On my machine error message libwinpthread-1.dll appears. :shock:

(J.Stanback compile)

Never had befor such error message with previuos McBrain's.

Win 7 Pro x64 , have other received the same messages ?
Hopefully this helps:

https://github.com/MichaelB7/Stockfish/ ... read-1.dll

I'm not familiar with the particulars on why this would be needed.
Image
jstanback
Posts: 130
Joined: Fri Jun 17, 2016 4:14 pm
Location: Colorado, USA
Full name: John Stanback

Re: McBrain v9.9 / McCain v2 Release

Post by jstanback »

I think the Makefile didn't include the -static option so didn't link some libraries. But I'm on vacation now and can't send recompiled exe's to Michael for about a week or so....

John