TalkChess.com
Hosted by Your Move Chess & Games

Author Message
H.G.Muller

Joined: 10 Mar 2006
Posts: 12776
Location: Amsterdam

Post subject: Re: End-game evaluation    Posted: Mon Nov 07, 2011 7:28 pm

I wrote some code to automatically identify drawish end-games by retrograde material analysis (for cases where white needs to be discounted):

 Code: #define MAX 1000 #define NTYP 5 int pVal[2*NTYP] = { 1,3,3,5,9, 1,3,3,5,9 }; int maxN[2*NTYP] = { 8,2,2,2,1, 8,2,2,2,1 }; char status[MAX]; char endgame[MAX][2*NTYP] = { // initialized with some elementary draws   {0,0,0,0,0, 0,0,0,0,0}, // KK   {0,1,0,0,0, 0,0,0,0,0}, // KNK   {0,0,1,0,0, 0,0,0,0,0}, // KBK   {0,0,0,1,0, 0,1,0,0,0}, // KRKN   {0,0,0,1,0, 0,0,1,0,0}, // KRKB   {0,2,0,0,0, 0,0,0,0,0}, // KNNK }; int ptr = 6; void Print(char *cur) {    static char pieceID[2*NTYP] = "PNBRQpnbrq";    int i, j;    for(i=NTYP-1; i>=0; i--) for(j=0; j=0; i--)  for(j=0; j= 0 && endgame[i][wp] >= maxN[wp]) continue; // already saturated for this piece type           if(wp >= 0) cur[wp]++, imbalance += pVal[wp]; // add white piece           if(cur[4]+2*cur[3] <= 2 && cur[0] < 3) // with more majors than Q or RR, or more than 2 Pawns, opponent never has easy draw           for(bp=0; bp= maxN[bp+NTYP]) continue; // already saturated          // we now have identified a piece pair (wp,bp) we could add to create predecessor          if(pVal[bp+NTYP] < pVal[wp]) continue; // black piece must at least equal for black to force trade          if(wp==0 && bp==0) continue;           // Pawn trade can in general not be forced          if(imbalance - pVal[bp+NTYP] + cur[0]*3/2 <= 0) continue; // white cannot possibly be ahead          // found predecessor that could be drawish (for white)          cur[bp+NTYP]++;          if(FindStatus(cur) == 0) goto escape; // this predecessor was already found before, no need to do it again          if(wp >= 0 && pVal[bp+NTYP] == pVal[wp]) {       // we added equal pair: white can pick how he trades              for(k=0; k= MAX) printf("table overflow\n"), exit(0);             escape:          cur[bp+NTYP]--;           }           if(wp >= 0) cur[wp]--, imbalance -= pVal[wp]; // remove white piece       }        }    } } main() {    build(); }

I have some doubt as to the validity of the output, in partcular w.r.t. the treatment of the N-pair. One of the assumptions going into the analysis is that you can add a minor, R or Q on each side of a drawish end-game without disturbing the draw. This based on the observation that R+minor vs R and Q+minor vs Q are still draws.

But it might not be true for NN. Does anyone happen to know if KRNNKR and KQNNKQ are still drawish, i.e. if the threat of trading R or Q is a sufficiently powerful defense plan to secure a draw? And how is it with KBNNKB? Can white force N vs B trade and then win KBNK? (With unlike Bishops black can hardly avoid that, I guess.)

So how should I fix this? Never declare an end-game where you are two minors ahead drawish, unless it is really NN and no additional piece material at all? I guess KBNNKR is still a draw (black perpetually harrassing the B for a RxB sac), although you are technically ahead more than a minor (2 minors > R). So perhaps I should put the limit as being above +4. Or is this a special case, and is KRBNNKRRand KQBNNKQR hopelessly lost to black?
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
H.G.Muller Tue Oct 04, 2011 11:44 am
Evert Glebbeek Tue Oct 04, 2011 1:02 pm
H.G.Muller Tue Oct 04, 2011 2:20 pm
Oliver Uwira Tue Oct 04, 2011 1:59 pm
Jon Dart Tue Oct 04, 2011 2:10 pm
Jon Dart Tue Oct 04, 2011 2:13 pm
Kevin Hearn Tue Oct 04, 2011 8:19 pm
Pawel Koziol Wed Oct 05, 2011 10:46 am
H.G.Muller Mon Oct 10, 2011 8:09 am
H.G.Muller Mon Oct 10, 2011 9:00 am
Evert Glebbeek Mon Oct 10, 2011 1:04 pm
Ed Schroder Mon Nov 07, 2011 10:15 pm
H.G.Muller Wed Oct 19, 2011 10:16 am
Michael Hoffmann Wed Oct 19, 2011 11:48 am
H.G.Muller Wed Oct 19, 2011 1:24 pm
Michael Hoffmann Wed Oct 19, 2011 2:53 pm
Volker Annuss Wed Oct 19, 2011 4:53 pm
H.G.Muller Wed Oct 19, 2011 4:54 pm
H.G.Muller Sat Oct 22, 2011 5:29 pm
Re: End-game evaluation H.G.Muller Mon Nov 07, 2011 7:28 pm
Evert Glebbeek Mon Nov 07, 2011 8:33 pm
Evert Glebbeek Mon Nov 07, 2011 9:02 pm
H.G.Muller Mon Nov 07, 2011 9:40 pm
H.G.Muller Tue Nov 08, 2011 11:16 am
Evert Glebbeek Tue Nov 08, 2011 5:50 pm
H.G.Muller Tue Nov 08, 2011 8:16 pm
Evert Glebbeek Tue Nov 08, 2011 8:52 pm
H.G.Muller Tue Nov 08, 2011 10:14 pm
Karlo Bala Jr. Mon Nov 07, 2011 11:59 pm
H.G.Muller Tue Nov 08, 2011 7:30 am
Kevin Hearn Tue Nov 08, 2011 9:58 am
H.G.Muller Tue Nov 08, 2011 12:40 pm
Evert Glebbeek Tue Nov 08, 2011 5:53 pm
Mark Lefler Mon Oct 10, 2011 4:08 pm
H.G.Muller Mon Oct 10, 2011 9:09 pm
H.G.Muller Mon Oct 10, 2011 9:58 pm
H.G.Muller Tue Oct 11, 2011 8:50 am
H.G.Muller Tue Oct 18, 2011 6:36 pm

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum