Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in ttable.c wrt storing of mate scores

6 views
Skip to first unread message

Chua Kong Sian

unread,
May 20, 1994, 12:13:13 AM5/20/94
to
There is a bug in PutInTTable() in ttable.c whereby mate scores are
incorrectly stored. This was fixed in pl68, but reappeared in pl 69
and 70. The patch for it appears below.

Kong Sian


*** /usr/people/kongsian/gnuchess-4.0/src/ttable.c Tue May 10 05:44:23 1994
--- ttable.c Sun May 15 16:17:58 1994
***************
*** 235,242 ****
#endif
if(ptbl->depth > (UCHAR)depth) return false;
/* adjust score so moves to mate is from this ply */
- if (score > 9000) score += ply;
- else if (score < -9000) score -= ply;
ptbl->hashbd = hashbd;
ptbl->depth = (UCHAR) depth;
ptbl->score = score;
--- 235,240 ----
***************
*** 254,260 ****
--- 252,262 ----
ptbl->score = beta + 1;
}
else
+ {
+ if (score > 9000) score += ply;
+ else if (score < -9000) score -= ply;
ptbl->flags = truescore;
+ }

#ifdef HASHSTATS
ttdepthin[ptbl->depth]++;


Chua Kong Sian

unread,
May 20, 1994, 3:21:46 AM5/20/94
to
Please ignore my previous patch. Its not very correct. Here is the
correct patch.

Kong Sian

*** /usr/people/kongsian/gnuchess-4.0/src/ttable.c Tue May 10 05:44:23 1994

--- ttable.c Fri May 20 15:13:45 1994
***************
*** 234,242 ****
HashAdd++;


#endif
if(ptbl->depth > (UCHAR)depth) return false;

- /* adjust score so moves to mate is from this ply */


- if (score > 9000) score += ply;
- else if (score < -9000) score -= ply;
ptbl->hashbd = hashbd;
ptbl->depth = (UCHAR) depth;
ptbl->score = score;

--- 234,239 ----
***************
*** 254,260 ****
--- 251,263 ----


ptbl->score = beta + 1;
}
else
+ {

+ /* adjust score so moves to mate is from this ply */


+ if (score > 9000) score += ply;

+ else if (score < -9000 && score != -9999) score -= ply;
+ ptbl->score = score;

0 new messages