Toga II 3.0 released

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Martin Thoresen
Posts: 1833
Joined: Wed Jun 21, 2006 10:07 pm

Re: Toga II 3.0 released

Post by Martin Thoresen » Mon Mar 25, 2013 12:54 am

jd1 wrote:Thanks Martin!

I'll have a look at it. Could you please do one more thing for me (I don't have a 16 core machine), could you verify it is actually using 16 cores?

Thanks,
Jerry
Jerry,

Yes I have verified that is uses all the cores specified in the info above.
So with 8 cores it's at 50% in task manager, 16 cores at 100% etc.

Best,
Martin

jd1
Posts: 266
Joined: Wed Oct 24, 2012 12:07 am

Re: Toga II 3.0 released

Post by jd1 » Mon Mar 25, 2013 1:58 am

Martin Thoresen wrote:
jd1 wrote:Thanks Martin!

I'll have a look at it. Could you please do one more thing for me (I don't have a 16 core machine), could you verify it is actually using 16 cores?

Thanks,
Jerry
Jerry,

Yes I have verified that is uses all the cores specified in the info above.
So with 8 cores it's at 50% in task manager, 16 cores at 100% etc.

Best,
Martin
Thank you Martin, I will look into it and get back to you.

Best regards,
Jerry

jd1
Posts: 266
Joined: Wed Oct 24, 2012 12:07 am

Re: Toga II 3.0 released

Post by jd1 » Mon Mar 25, 2013 2:05 am

geots wrote:
If you will be patient, I will give you results against 2.02 and Zappa Mexico that you can take to the bank. I mention Zappa after reading Ingo's thread. After looking at CCRLs list- if 3.0 doesn't score better than Zappa Mexico- that would mean you almost have no increase with 3.0. Which I don't buy for a minute.


Best,

george
Thank you very much George, I would be most interested to see your results. From CCRL, Zappa Mexico II is about 20 elo stronger than the old Toga at 40/4 and 40 elo stronger at 40/40. Seeing that Ingo's test has finished with +57 elo (although maybe only 50 elo with Bayeselo), I would expect to beat Zappa Mexico narrowly at either time control. But maybe Zappa is just a bad match-up for Toga ...

Jerry

jd1
Posts: 266
Joined: Wed Oct 24, 2012 12:07 am

Re: Toga II 3.0 released

Post by jd1 » Mon Mar 25, 2013 3:01 am

Eelco de Groot wrote:Yes Jerry you never mentioned any number for an expected elo-gain, that is very wise practice. Jerry I had a question, long time ago I made some code for Toga so that it could mate with Knight and Bishop against King, I know it is absolutely not going to give elos but it was just nice to get it working at the time. I am not sure I posted it on TDDB anywhere but implemented it in Toga CMLX on Rybka forum. Maybe it could be added sometime or maybe for a separate modified version of Toga?

Eelco
Hi Eelco,

Sorry I forgot to reply this earlier. If you could give me a link to the code that would be much appreciated.

Jerry

User avatar
geots
Posts: 4790
Joined: Fri Mar 10, 2006 11:42 pm

Re: Toga II 3.0 released

Post by geots » Mon Mar 25, 2013 4:32 am

jd1 wrote:
geots wrote:
If you will be patient, I will give you results against 2.02 and Zappa Mexico that you can take to the bank. I mention Zappa after reading Ingo's thread. After looking at CCRLs list- if 3.0 doesn't score better than Zappa Mexico- that would mean you almost have no increase with 3.0. Which I don't buy for a minute.


Best,

george
Thank you very much George, I would be most interested to see your results. From CCRL, Zappa Mexico II is about 20 elo stronger than the old Toga at 40/4 and 40 elo stronger at 40/40. Seeing that Ingo's test has finished with +57 elo (although maybe only 50 elo with Bayeselo), I would expect to beat Zappa Mexico narrowly at either time control. But maybe Zappa is just a bad match-up for Toga ...

Jerry




Look, something is not right. It looks like apples are being compared to oranges. Not that it matters that much, unless I end up testing the wrong version. Unless I am wrong, Ingo is running Zappa Mexico 32bit and you are referring in CCRL to Z Mexico 64bit, at least I think you are. Not that I am much interested in his 32bit, but I want to be sure you are referring to Zappa 64bit.???????


george

jd1
Posts: 266
Joined: Wed Oct 24, 2012 12:07 am

Re: Toga II 3.0 released

Post by jd1 » Mon Mar 25, 2013 4:41 am

geots wrote:
jd1 wrote:
geots wrote:
If you will be patient, I will give you results against 2.02 and Zappa Mexico that you can take to the bank. I mention Zappa after reading Ingo's thread. After looking at CCRLs list- if 3.0 doesn't score better than Zappa Mexico- that would mean you almost have no increase with 3.0. Which I don't buy for a minute.


Best,

george
Thank you very much George, I would be most interested to see your results. From CCRL, Zappa Mexico II is about 20 elo stronger than the old Toga at 40/4 and 40 elo stronger at 40/40. Seeing that Ingo's test has finished with +57 elo (although maybe only 50 elo with Bayeselo), I would expect to beat Zappa Mexico narrowly at either time control. But maybe Zappa is just a bad match-up for Toga ...

Jerry




Look, something is not right. It looks like apples are being compared to oranges. Not that it matters that much, unless I end up testing the wrong version. Unless I am wrong, Ingo is running Zappa Mexico 32bit and you are referring in CCRL to Z Mexico 64bit, at least I think you are. Not that I am much interested in his 32bit, but I want to be sure you are referring to Zappa 64bit.???????


george
I think Ingo is running Zappa Mexico II 64-bit?

Jerry

User avatar
geots
Posts: 4790
Joined: Fri Mar 10, 2006 11:42 pm

Re: Toga II 3.0 released

Post by geots » Mon Mar 25, 2013 4:47 am

Ok- my mistake. I guess Ingo is running Z Mexico 64bit. But like I said that is irrelevant. I just want to be sure YOU are referring to 64bit in your thread concerning CCRL ratings I replied to, which I am sure you are. And don't listen to anyone who says 200 games mean nothing and you need over 1000. Stats are what they are, but if under 1000 meant nothing, you could throw out about 50% or more of CCRLs ratings.

I am going to run 200 ag. Zappa Mexico 64 at blitz. That is a good start.



Best,

jd1
Posts: 266
Joined: Wed Oct 24, 2012 12:07 am

Re: Toga II 3.0 released

Post by jd1 » Mon Mar 25, 2013 4:50 am

geots wrote:Ok- my mistake. I guess Ingo is running Z Mexico 64bit. But like I said that is irrelevant. I just want to be sure YOU are referring to 64bit in your thread concerning CCRL ratings I replied to, which I am sure you are. And don't listen to anyone who says 200 games mean nothing and you need over 1000. Stats are what they are, but if under 1000 meant nothing, you could throw out about 50% or more of CCRLs ratings.

I am going to run 200 ag. Zappa Mexico 64 at blitz. That is a good start.



Best,
Thank you! Yes I was referring to the 64 bit version :)

User avatar
geots
Posts: 4790
Joined: Fri Mar 10, 2006 11:42 pm

For CCRL Tester/s- Please Read- Very Important!

Post by geots » Mon Mar 25, 2013 4:54 am

What I need to know is- when you run 40/4 blitz, when you bench your machine, if it comes up elapsed as 26 seconds- would you run it at 40/2, or do you go no lower than 40/3 no matter what comes up? I've got to get this one right.


Thanks very, very much-

george
Last edited by geots on Mon Mar 25, 2013 4:56 am, edited 1 time in total.

User avatar
Eelco de Groot
Posts: 4073
Joined: Sun Mar 12, 2006 1:40 am
Location: Groningen

Re: Toga II 3.0 released

Post by Eelco de Groot » Mon Mar 25, 2013 4:55 am

jd1 wrote:
Eelco de Groot wrote:Yes Jerry you never mentioned any number for an expected elo-gain, that is very wise practice. Jerry I had a question, long time ago I made some code for Toga so that it could mate with Knight and Bishop against King, I know it is absolutely not going to give elos but it was just nice to get it working at the time. I am not sure I posted it on TDDB anywhere but implemented it in Toga CMLX on Rybka forum. Maybe it could be added sometime or maybe for a separate modified version of Toga?

Eelco
Hi Eelco,

Sorry I forgot to reply this earlier. If you could give me a link to the code that would be much appreciated.

Jerry
Hi Jerry,

I remember very little about what exactly the code was or where exactly I put the code in Toga but I could borrow heavily from Glaurung, that I do remember. It was 2008 there was no Stockfish yet around 8-). I only slightly changed the board values from Glaurung that guide the Knight and Bishop in the right direction. Posted the code on Rybkaforum int the thread from Teemu when he was working on Toga CMLX
Thanks for the testing National, it is quite a coincidence that Bishop and Knight vs. King alone came on the board in your games just now :). I would have thought the engame is pretty rare, but that is maybe from the perspective of human games where most players don't want to test their opponents knowledge of this endgame, and least not GMs. There was a discussion on the CSS forum that was the reason for me to look at the code again and it was mentioned there that in his whole career Victor Korchnoj maybe never got the chance to play this endgame, not one game in a database of more than 7000 games! And yet in a small match between two computers the endgame comes on the board after just a few games.

It is a small piece of code and most was already written by Thomas Gaksch, maybe it is an idea to put this small routine in the next CMLX 5e version or in Thomas' latest -6a?- version? I have to admit I would like to borrow some of Teemu's code for Chess960 in time, I don't think I could write such a thing myself, unless I study other programs with FRC code, that of course would help. The way I implemented KBNK is also heavily based on Tord's code in Glaurung although Tord's version is more compact and he wrote a version that computes things just in one piece of code for the needed colour.

Here is my version of the KBNK routine in eval.cpp:

Code: Select all

static const int KBNKingposMatrix[64] = {
      90,    70,    50,    30,    10,   -10,   -30,   -50,
      70,    40,    20,     0,   -20,   -40,   -60,   -30,
      50,    20,   -10,   -30,   -50,   -70,   -40,   -10,
      30,     0,   -30,   -60,   -80,   -50,   -20,    10,
      10,   -20,   -50,   -80,   -60,   -30,     0,    30,
     -10,   -40,   -70,   -50,   -30,   -10,    20,    50,
     -30,   -60,   -40,   -20,     0,    20,    40,    50,
     -50,   -30,   -10,    10,    30,    50,    70,    90,
};

.

static const int KingDistanceBonus[8] = {0, 0, 50, 40, 30, 20, 10, 5};

.
.

// eval()

int eval(board_t * board, int alpha, int beta, int ThreadId) {

   int opening, endgame;
   material_info_t mat_info[1];
   pawn_info_t pawn_info[1];
   int mul[ColourNb];
   int phase;
   int eval;
   int wb, bb;
   int winnerKSQ, loserKSQ;
   int lazy_eval,probe_score; // Thomas

   ASSERT(board!=NULL);
   ASSERT(board_is_legal(board));
   ASSERT(!board_is_check(board)); // exceptions are extremely rare

   // init

   opening = 0;
   endgame = 0;

/*   if &#40;egbb_is_loaded && board->piece_nb <=5 && ABS&#40;SearchBest&#91;0&#93;.value&#41; >= WIN_SCORE&#41; &#123;
    if &#40;probe_bitbases&#40;board, probe_score&#41;)&#123;
      return probe_score;
    &#125;
   &#125; */

   // material

   material_get_info&#40;mat_info,board,ThreadId&#41;;

   opening += mat_info->opening;
   endgame += mat_info->endgame;

   mul&#91;White&#93; = mat_info->mul&#91;White&#93;;
   mul&#91;Black&#93; = mat_info->mul&#91;Black&#93;;

   // PST

   opening += board->opening;
   endgame += board->endgame;

   // pawns

   pawn_get_info&#40;pawn_info,board,ThreadId&#41;;

   opening += pawn_info->opening;
   endgame += pawn_info->endgame;

   // draw

   eval_draw&#40;board,mat_info,pawn_info,mul&#41;;

   if &#40;mat_info->mul&#91;White&#93; < mul&#91;White&#93;) mul&#91;White&#93; = mat_info->mul&#91;White&#93;;
   if &#40;mat_info->mul&#91;Black&#93; < mul&#91;Black&#93;) mul&#91;Black&#93; = mat_info->mul&#91;Black&#93;;

   if &#40;mul&#91;White&#93; == 0 && mul&#91;Black&#93; == 0&#41; return ValueDraw;

    // win

   if &#40;board->piece_nb == 4&#41;&#123; // KBNK?
      if &#40;board->number&#91;WhiteKnight12&#93; == 1 && board->number&#91;WhiteBishop12&#93; == 1&#41;&#123;
         eval = ValueWin;
         wb = board->piece&#91;White&#93;&#91;1&#93;;
         ASSERT&#40;PIECE_IS_BISHOP&#40;board->square&#91;wb&#93;));
         winnerKSQ = KING_POS&#40;board,White&#41;;
         loserKSQ = KING_POS&#40;board,Black&#41;;
         if &#40;SQUARE_COLOUR&#40;wb&#41; == SQUARE_COLOUR&#40;A8&#41;)&#123;
            winnerKSQ = (&#40;winnerKSQ&#41;^0x0F&#41;;
            loserKSQ = (&#40;loserKSQ&#41;^0x0F&#41;;
         &#125;
         eval += KBNKingposMatrix&#91;SquareTo64&#91;loserKSQ&#93;&#93;;
         eval += KBNKingposMatrix&#91;SquareTo64&#91;loserKSQ&#93;&#93;;
         eval += KingDistanceBonus&#91;DISTANCE&#40;KING_POS&#40;board,White&#41;,KING_POS&#40;board,Black&#41;)&#93;;
      &#125;
      else&#123; // KKBN?     
             if &#40;board->number&#91;BlackKnight12&#93; == 1 && board->number&#91;BlackBishop12&#93; == 1&#41;&#123;
                eval = ValueWin;
                 bb = board->piece&#91;Black&#93;&#91;1&#93;;
                 ASSERT&#40;PIECE_IS_BISHOP&#40;board->square&#91;bb&#93;));
                 winnerKSQ = KING_POS&#40;board,Black&#41;;
                 loserKSQ = KING_POS&#40;board,White&#41;;
                 if &#40;SQUARE_COLOUR&#40;bb&#41; == SQUARE_COLOUR&#40;A8&#41;)&#123;
                    winnerKSQ = (&#40;winnerKSQ&#41;^0x0F&#41;;
                    loserKSQ = (&#40;loserKSQ&#41;^0x0F&#41;;
                 &#125;
                 eval += KBNKingposMatrix&#91;SquareTo64&#91;loserKSQ&#93;&#93;;
                 eval += KBNKingposMatrix&#91;SquareTo64&#91;loserKSQ&#93;&#93;;
                 eval += KingDistanceBonus&#91;DISTANCE&#40;KING_POS&#40;board,White&#41;,KING_POS&#40;board,Black&#41;)&#93;;
             &#125;
      &#125;
      if &#40;COLOUR_IS_WHITE&#40;board->turn&#41;)&#123;
         return &#40;eval&#41;;
      &#125;
      else&#123;
             return (-eval&#41;;
      &#125; 
   &#125; // End of KBNK block 
.
.
.
As you can see it is a small piece of code, if the values in the KBNKingposmatrix are doubled you don't need to call the piece square matrix twice but that was just for tuning purposes not changed yet. Maybe some finetuning is possible by using the KBNK pst value of the winning King too, a small bonus for occupying the centre as well as advancing towards the enemy King may work especially if all pieces somehow ended up clustered in the 'wrong' corner where mate is not possible, in that case the white King should just back off a little first with his troops and occupy the centre, at least I think that is the human theory.
I see that Teemu Pudas (Vempele) writes in the same thread that he adapted the code so that would imply it is already in one of the CMLX versions. I did not remember that... He probably placed the code better, my version was placed somewhere as one of of the 'win' recognizers/situations early in eval.cpp but I don't know how Teemu did it.

I will upload that eval.cpp into the Developers Discussions subforum of TDDB I hope you can find it there Jerry.

Eelco
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

Post Reply