Strictly for entertainment purposes only ...

Discussion of computer chess matches and engine tournaments.

Moderators: hgm, Rebel, chrisw

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

Strictly for entertainment purposes only ...

Post by MikeB »

Strictly for entertainment, McCain will play various engines in Gauntlet format over the next 30 hours . Each run will be about 5 hours and consist of 500 games with tc of 30 second base plus 2 seconds. The output is now combined in one output file - output is every 20 games completed or every 5 minutes.
3000 games in total will be played. I have expanded the opening file by 50 positions to include the most basic common openings ( between 1 to 5 moves) - 50 additional opening positions in total. (source: https://en.wikipedia.org/wiki/Chess_opening)

All games played to the bitter end, 6 men syzygy on SSD ( no adjudications or resignations).

Current Results:
https://www.dropbox.com/s/rz0ftfl3wk4pf ... a.txt?dl=1

Gamesin PGN format:
https://www.dropbox.com/s/vaqzsfxx4fx8u ... s.pgn?dl=1

Look for a McCain X3 release in early May.

CURRENT:

Code: Select all

180 of 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Threads: 1
Hash: 256
Date: 04/26/19 : 01:56:03
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3101   0.0   28   28   180   90.5  50.3   30   29  121  16.7  67.2  3099 
   2 Stockfish 042019    3099   2.2   28   28   180   89.5  49.7   29   30  121  16.1  67.2  3101 
---------------------------------------------------------------------------------------------------------
 
Date: 04/26/19 : 01:57:09
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3102   0.0   29   29   181   91.5  50.6   31   29  121  17.1  66.9  3098 
   2 Stockfish 042019    3098   4.0   29   29   181   89.5  49.4   29   31  121  16.0  66.9  3102 
---------------------------------------------------------------------------------------------------------
 
Date: 04/26/19 : 02:02:10
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3102   0.0   27   27   188   95.0  50.5   31   29  128  16.5  68.1  3098 
   2 Stockfish 042019    3098   3.9   27   27   188   93.0  49.5   29   31  128  15.4  68.1  3102 
---------------------------------------------------------------------------------------------------------
Image
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: Strictly for entertainment purposes only ...

Post by jp »

How is McCain related to SF? What are the main differences?
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Strictly for entertainment purposes only ...

Post by MikeB »

jp wrote: Fri Apr 26, 2019 10:49 am How is McCain related to SF? What are the main differences?
McCain was forked from Stockfish as a separate branch and is updated periodically with the SF patches.

https://github.com/MichaelB7/Stockfish/tree/McCain

Each and if every difference is documents in the code with "ifdef Maverick" in the source. Have also tried to attribute the source of the change as well. Most of the differences are in the search function An example of one of the difference is the the LMR function table in the "search:init" function.

This is McCain's

Code: Select all

#ifdef Maverick   // MichaelB7
	for (int imp = 0; imp <= 1; ++imp)
		for (int d = 1; d < 32; ++d)
			for (int mc = 1; mc < 80; ++mc) // record in a "real" game is 79 moves,
				// in a search of one million games, found one posiiton with 78 possible moves.
				// more weight on depth for LMR reductions than move count
				// (from Crafty) MichaelB7
				{
					int red = int(log( d * 1.87 ) * log( mc * .95 )) / 2;
					Reductions[imp][d][mc] = red;
					// Increase reduction for non-PV nodes when eval is not improving
					if (!imp && red > 1)
						Reductions[imp][d][mc]++;
				}
This is Stockfish

Code: Select all

#else  
  for (int i = 1; i < MAX_MOVES; ++i)
      Reductions[i] = int(1024 * std::log(i) / std::sqrt(1.95));
#endif
As an example, I recently merged CorChess code by Ivan Ivec into McCain, such as the use of two delta's - delta1 and delta2.
The source is directly attributed to Ivan in the code:

Code: Select all

#ifdef Maverick
  bestValue = delta1 = delta2 = alpha = -VALUE_INFINITE; //corchess by Ivan Ivec
#else
  bestValue = delta = alpha = -VALUE_INFINITE;
#endif
It also includes Gunther Demetz's SF "zugzwang solver" patch from last fall. Although, it not pass the strict requirements o make it into regular SF, I felt the patch was certainly worthy of of inclusion in McCain. 1/4 of the "ifdef Maverick" statements in search.cpp are directly related to Demetz's "zugzwang solver" patch.

Below is the largest block code for the "zugzwang solver" patch from last fall written by Gunther.

Code: Select all

#ifdef Maverick //Gunther Demetz zugzwangSolver
		    if  ( depth % 2 == 1 ){
				thisThread->nmpColor = us;
				Pawns::Entry* pe;
				if (  !inCheck
					&& thisThread->zugzwangMates < 1000000
                    && (pe = Pawns::probe(pos)) != nullptr
                    && popcount(pe->passedPawns[us])
                    && popcount(pe->passedPawns[us]) <= 2
                    && popcount(pos.pieces(us)) <= 7
                    && popcount(pos.pieces())   <= 12
                    && MoveList<LEGAL, KING>(pos).size() < 1)
				{
					bool oneOpponentPasser = popcount(pe->passedPawns[~us]) == 1 &&
						!(pos.pieces() & forward_file_bb(~us, lsb(pe->passedPawns[~us])));
					Bitboard passed = pe->passedPawns[us] & ~pos.blockers_for_king(us) &  ~pos.blockers_for_king(~us);
					while (passed)
					{
						Square s = pop_lsb(&passed);
						Square promo = make_square(file_of(s), us == WHITE ? RANK_8 : RANK_1);
						if ((pos.pieces() & between_bb(promo, s)) || promo == pos.square<KING>(us)) // king can't move
							continue; // passer blocked
						Move directPromotion = make_move(s, promo);
						bool killPromo =  (pos.pieces(~us) & promo) || !pos.see_ge(directPromotion); // opponent controls promotion-square
						if (!killPromo && !oneOpponentPasser)
							continue;
						
						StateInfo s1,s2,s3;
						Square p2, p3 = SQ_NONE;
						if (oneOpponentPasser && !killPromo)
						{
							Rank r1 = relative_rank(~us, rank_of(lsb(pe->passedPawns[~us])));
							Rank r2 = relative_rank( us, rank_of(s));
							if (r2 > r1)
								continue; // if our passed is more advanced we will promote earlier and probably defend with success
							if (pawn_attack_span(us, s) & pos.pieces(~us, PAWN))
							{   // pseudo passed pawn: will be passed after levers
								p2 = lsb(pawn_attack_span(us, s) & pos.pieces(~us, PAWN));
								Bitboard removeLevers = forward_file_bb(~us, p2) & pos.pieces( us, PAWN);
								if (removeLevers)
								{
									p3 = lsb(removeLevers);
									pos.removePawn(p2, s2);
									pos.removePawn(p3, s3);
								}
							}
						}

						thisThread->nmpMinPly = MAX_PLY;
						pos.removePawn(s, s1);
						Move pv1[MAX_PLY+1];
						(ss)->pv = pv1;
						(ss)->pv[0] = MOVE_NONE;
						Depth nd = (oneOpponentPasser && !killPromo) ? depth - R - 2 * ONE_PLY : depth - 4 * ONE_PLY;
						Value v = search<PV>(pos, ss, mated_in(0), VALUE_MATED_IN_MAX_PLY, nd, false);
						
						pos.undo_removePawn(s, us);
						if (p3 != SQ_NONE) // reput the lever pawns
							pos.undo_removePawn(p3, us), pos.undo_removePawn(p2, ~us);
						if (v > mated_in(0) && v < VALUE_MATED_IN_MAX_PLY)

						{
                        //sync_cout << pos << "info mate " << UCI::value(v) << " detected with depth " << nd << " !  at score " << thisThread->rootMoves[0].score << sync_endl;
							thisThread->zugzwangMates++;
							thisThread->nmpMinPly = 0;
                        // Early return here with a low value, this will spotlight this promising variation
							return Value(thisThread->rootMoves[0].score * (thisThread->rootPos.side_to_move() != us ? 1 : -1) - 80);
						}
					} // end processing of passed pawns
				}
			}
#endif
In the search.cpp file, you one will find 47 "ifdef Maverick" statements. In addition , McCain has non functional differences such as "play by Elo" and the ability to use 3 opening books. One will find 24 "ifdef Add_Features" statements in the search.cpp .

In the Makefile this line decides whether it will a build McCain or Stockfish when you run make.

Code: Select all

### Uncomment the line below for McCain, comment in "###" for Stockfish functionality
	VERSION=maverick
Leave it as is to build McCain, comment the line outwith puns signs to build a functionally equilavalent Stockfish engine ( but leaving in the bell and whistles, such as Play by Elo rating and using 3 opening books, etc , There are also few other items such as keyboard shortcuts when using McCain terminal mode.

Some shortcut commands:

Code: Select all

b   = bench
g   = go
i   = infinite
p f = position fen
sd  = search depth
sm = searchmoves
q   = quit
?   = stop ( to stop  A search)
new option set or s = set, see example below

e.g., 
set threads xx = setoption name threads value xx
set hash xxx = setoption name hash value xx
g d 5  = go depth 5
g i = go infinite
g movetime 10000 sm g1f3 - searches only move g1f3 for 10 seconds
And then finally, in concert with working with Al Scally of DGT-Pi fame, we have developed about 20 weakened personalities that can be used with McCain and the DGT board.
Image
jp
Posts: 1470
Joined: Mon Apr 23, 2018 7:54 am

Re: Strictly for entertainment purposes only ...

Post by jp »

MikeB wrote: Fri Apr 26, 2019 2:28 pm McCain was forked from Stockfish as a separate branch and is updated periodically with the SF patches.

https://github.com/MichaelB7/Stockfish/tree/McCain

Each and if every difference is documents in the code with "ifdef Maverick" in the source. Have also tried to attribute the source of the change as well. Most of the differences are in the search function
Thanks for the detailed reply.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Strictly for entertainment purposes only ...

Post by MikeB »

MikeB wrote: Fri Apr 26, 2019 8:03 am Strictly for entertainment, McCain will play various engines in Gauntlet format over the next 30 hours . Each run will be about 5 hours and consist of 500 games with tc of 30 second base plus 2 seconds. The output is now combined in one output file - output is every 20 games completed or every 5 minutes.
3000 games in total will be played. I have expanded the opening file by 50 positions to include the most basic common openings ( between 1 to 5 moves) - 50 additional opening positions in total. (source: https://en.wikipedia.org/wiki/Chess_opening)

All games played to the bitter end, 6 men syzygy on SSD ( no adjudications or resignations).

Current Results:
https://www.dropbox.com/s/rz0ftfl3wk4pf ... a.txt?dl=1

Games in PGN format:
https://www.dropbox.com/s/vaqzsfxx4fx8u ... s.pgn?dl=1

Look for a McCain X3 release in early May.

CURRENT:

Code: Select all

180 of 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Threads: 1
Hash: 256
Date: 04/26/19 : 01:56:03
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3101   0.0   28   28   180   90.5  50.3   30   29  121  16.7  67.2  3099 
   2 Stockfish 042019    3099   2.2   28   28   180   89.5  49.7   29   30  121  16.1  67.2  3101 
---------------------------------------------------------------------------------------------------------
 
Date: 04/26/19 : 01:57:09
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3102   0.0   29   29   181   91.5  50.6   31   29  121  17.1  66.9  3098 
   2 Stockfish 042019    3098   4.0   29   29   181   89.5  49.4   29   31  121  16.0  66.9  3102 
---------------------------------------------------------------------------------------------------------
 
Date: 04/26/19 : 02:02:10
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3102   0.0   27   27   188   95.0  50.5   31   29  128  16.5  68.1  3098 
   2 Stockfish 042019    3098   3.9   27   27   188   93.0  49.5   29   31  128  15.4  68.1  3102 
---------------------------------------------------------------------------------------------------------

Completed Results
500 Games at 30 sec + 2 sec:

Code: Select all

500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/26/19 : 05:25:41
Date: 04/26/19 : 05:00:43
500 game(s) loaded
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 Stockfish 042019    3103   0.0   15   15   500  254.5  50.9   70   61  369  14.0  73.8  3097 
   2 McCain-dev 042319   3097   6.1   15   15   500  245.5  49.1   61   70  369  12.2  73.8  3103 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/26/19 : 10:13:39
Date: 04/26/19 : 09:49:34
500 game(s) loaded
Rank Name                     Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319         3116   0.0   18   18   500  272.5  54.5  116   71  313  23.2  62.6  3084 
   2 S_XPrO 200419 64 POPCNT   3084  31.8   18   18   500  227.5  45.5   71  116  313  14.2  62.6  3116 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/26/19 : 15:02:30
Date: 04/26/19 : 14:28:01
500 game(s) loaded
Rank Name                      Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 CorChess 3.1 200419 64 P   3108   0.0   16   16   500  261.5  52.3   87   64  349  17.4  69.8  3092 
   2 McCain-dev 042319          3092  15.2   16   16   500  238.5  47.7   64   87  349  12.8  69.8  3108 
---------------------------------------------------------------------------------------------------------
500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/26/19 : 19:40:56
Date: 04/26/19 : 18:19:25


500 game(s) loaded
Rank Name                Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319    3169   0.0   15   15   500  356.0  71.2  230   18  252  46.0  50.4  3031 
   2 Komodo 12.3 64-bit   3031 138.8   15   15   500  144.0  28.8   18  230  252   3.6  50.4  3169 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/26/19 : 23:32:21
Date: 04/26/19 : 22:33:39
500 game(s) loaded
Rank Name                   Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319       3161   0.0   15   15   500  342.0  68.4  206   22  272  41.2  54.4  3039 
   2 McBrain 1.0 64 POPCNT   3039 121.3   15   15   500  158.0  31.6   22  206  272   4.4  54.4  3161 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 30 seconds + 2.0000 seconds
Target completion: 04/27/19 : 03:46:37
Date: 04/27/19 : 01:20:13
500 game(s) loaded
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319   3421   0.0   77   77   500  493.5  98.7  489    2    9  97.8   1.8  2779 
   2 Crafty-25.3         2779 642.3   77   77   500    6.5   1.3    2  489    9   0.4   1.8  3421 
---------------------------------------------------------------------------------------------------------
Completed Results
500 Games at 75 sec + 1.5 sec:

Code: Select all

500 rounds and 500 games completed...
Time control: 75 seconds + 1.5000 seconds
Target completion: 04/27/19 : 13:16:57
Date: 04/27/19 : 12:53:09
500 game(s) loaded
Rank Name               Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 Stockfish 042019    3100   0.0   15   15   500  250.5  50.1   65   64  371  13.0  74.2  3100 
   2 McCain-dev 042319   3100   0.4   15   15   500  249.5  49.9   64   65  371  12.8  74.2  3100 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 75 seconds + 1.5000 seconds
Target completion: 04/27/19 : 18:00:31
Date: 04/27/19 : 17:32:47
500 game(s) loaded
Rank Name                     Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319         3111   0.0   18   18   500  266.0  53.2  104   72  324  20.8  64.8  3089 
   2 S_XPrO 200419 64 POPCNT   3089  22.4   18   18   500  234.0  46.8   72  104  324  14.4  64.8  3111 
---------------------------------------------------------------------------------------------------------

500 rounds and 500 games completed...
Time control: 75 seconds + 1.5000 seconds
Target completion: 04/27/19 : 22:40:08
Date: 04/27/19 : 22:03:02
500 game(s) loaded
Rank Name                      Rating   Δ     +    -     #     Σ    Σ%     W    L    D   W%    =%   OppR 
---------------------------------------------------------------------------------------------------------
   1 McCain-dev 042319          3103   0.0   15   15   500  253.5  50.7   67   60  373  13.4  74.6  3097 
   2 CorChess 3.1 200419 64 P   3097   5.2   15   15   500  246.5  49.3   60   67  373  12.0  74.6  3103 
---------------------------------------------------------------------------------------------------------
The final match will be one set of 500 games vs Stockfish 042019 with time control of 120 seconds ( 2 minutes) with increment of 6 seconds
Late Change: Game 5 minutes with 3 second increment

Same links as above:

Current Results:
https://www.dropbox.com/s/rz0ftfl3wk4pf ... a.txt?dl=1

Games in PGN format:
https://www.dropbox.com/s/vaqzsfxx4fx8u ... s.pgn?dl=1

Expect the initials result to be posted in about 1/2 hour, then 20 completed games there after or every 19 minutes and 45 seconds ( the output intervals are calculated by the script based on time controls , # of engines, etc.).

This version " McCain-dev 042319" will be released tomorrow afternoon, my time, EDST, as 'McCain X3" (X3 pronounced as "ten-three") with all flavors of OS -> Windows, Linux and macOS, with compiles the courtesy of our fellow members Dann Corbit, Lucas Monge and John Stanback.
Image
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Strictly for entertainment purposes only ...

Post by MikeB »

The McCain version that had played here was just released:

https://github.com/MichaelB7/Stockfish/releases/tag/X3
Image