🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.chess
Article #5337

Bugs/suggestions for gnuchess 4.0pl64

#5337
From: Chua Kong Sian
Date: Tue, 18 Jan 1994 06:49
195 lines
6060 bytes
Here are a few bugs in gnuchess pl64 that have still not been fixed.

1.      In dspcom.c, GetGame ()

        TimeControl.moves[white] = atol (InPtr);
                                   ^^^^
        should be changed to

        TimeControl.moves[white] = atoi (InPtr);
                                   ^^^^
        4 lines down,

        TimeControl.clock[black] = atoi (InPtr);
                                   ^^^^
        should be changed to

        TimeControl.clock[black] = atol (InPtr);
                                   ^^^^

2.      In search.c, search ()

        j = (node->f << 6) | node->t;
                        ^
        should be changed to

        j = (node->f << 8) | node->t;
                        ^

3.      There is a bug in eval.c, evaluate () whereby a King move to deliver
        check is not recognise.  This shows up if we test gnuchess on the
        following position.

================cut here=========================
White computer Black Human 1 eps 0 # To move White correct h6h7
Castled White false Black false # ep 
TimeControl 0 Operator Time 0
White Clock 6000 Moves 1
Black Clock 6000 Moves 1

0 ..R....K 10 10 10 10 10 10 10 10
1 .P.B...P 10 10 10 10 10 10 10 10
2 P...P..q 10 10 10 10 10 10 10 10
3 ...PQP.. 10 10 10 10 10 10 10 10
4 .p...... 10 10 10 10 10 10 10 10
5 ......rk 10 10 10 10 10 10 10 10
6 ........ 10 10 10 10 10 10 10 10
7 .......r 10 10 10 10 10 10 10 10
  abcdefgh

move  score depth  nodes  time flags capture color
===================cut here===============================

        The sequence of move should be
        1. Qxh7 Kxh7 2. Kg3#.

        Gnuchess reports this line, but return a score of 1.  To fix this,
        in evaluate(), change

        ChkFlag[ply - 1] = ((*InChk) ? Pindex[TOsquare] : 0);

        to

        ChkFlag[ply - 1] = ((*InChk) ? Pindex[TOSquare] + 1 : 0);



There are also other bugs which I do not know how to fix.

1.      There appears to be a bug in the hashtable with respect to mates.
        Consider this position.

==================cut here=================================
White computer Black Human 1 eps 0 # To move Black correct g1f2
Castled White false Black false # ep 
TimeControl 0 Operator Time 0
White Clock 6000 Moves 1
Black Clock 6000 Moves 1

0 ........ 10 10 10 10 10 10 10 10
1 .......P 10 10 10 10 10 10 10 10
2 ......PK 10 10 10 10 10 10 10 10
3 .p....R. 10 10 10 10 10 10 10 10
4 ..p..qbk 10 10 10 10 10 10 10 10
5 r......p 10 10 10 10 10 10 10 10
6 ......R. 10 10 10 10 10 10 10 10
7 ......Q. 10 10 10 10 10 10 10 10
  abcdefgh

move  score depth  nodes  time flags capture color
=================cut here===================================

        Here is what gnuchess gives.


Enter #moves #minutes: 
White 0:00  Black 0:00

 R N B Q K B N R
 P P P P P P P P
 - - - - - - - -
 - - - - - - - -
 - - - - - - - -
 - - - - - - - -
 p p p p p p p p
 r n b q k b n r

Book used 0 of 250000 entries.
Warning can't find book.
Playing without hashfile

Your move is? Enter file name: 


White 1:00  Black 1:00

 - - - - - - - -
 - - - - - - - P
 - - - - - - P K
 - p - - - - R -
 - - p - - q b k
 r - - - - - - p
 - - - - - - R -
 - - - - - - Q -


Your move is? 
Your move is? 
Your move is? 
Move# 1    Target= 6000    Clock: 6000
 2.    712    0     2311   g1f2  a3g3  f2f4  g3g2  f4c4 
 3&    713    0     2313   g1f2  a3g3 
 3.    713    0     3187   g1f2  a3g3 
 4+   1395    0     3750   g1f2  a3g3  f2f4  g3e3 
 4&   9992    0    10651   g1f2  f4g3  g5h5  g4h5  g6g5  h4g4  f2f4  g3f4 
 4&   9992    0    17791   g1e1  a3g3  e1g3  f4g3 
 4.   9992    1    27738   g1e1  a3g3  e1g3  f4g3 
1. ... g1e1
Gen 100923 Node 27738 Tree 364 Eval 705 Rate 27738 EC 0/0 RS hi 0 lo 2 
Hin/Hout/Tcol/Coll/Fin/Fout = 519/88/0/0/0/0
My move is: g1e1

Your move is? 


        Gnuchess finds the correct move g1f2, then changes its mind and
        decides on g1e1, which does not give mate!  Without the hashtable
        gnuchess finds the correct line.

        I have found that if the following lines in search.c, ProbeTTable()
        and PutInTTable () were commented out, gnuchess is able to find the
        correct line.  But I have no idea why.

        In ProbeTTable (), comment out

        if (*score > 9000)
           *score -= ply;
        else if (*score < -9000)
           *score += ply;

        In PutInTTable (), comment out

        if (score > 9000)
           score += ply;
        else if (score < -9000)
           score -= ply;



I also have a couple of suggestions to make.

1.      I've tested both -DHISTORY and -DKILLT and have found that -DKILLT
        gives better results than -DHISTORY, i.e. the search is faster.
        Perhaps -DKILLT can be the default instead of -DHISTORY.

2.      In ProbeTTable (), the line

        PV = SwagHt = ptbl->mv;

        should be moved outside the loop so that it looks like this
        PV = SwagHt = ptbl->mv;
        if ((ptbl->depth >= (short) depth))
          {
            ....

        The effect of this change is that even if the hashtable entry is
        useless because its depth is less than what we need, the move is
        still useful as we can use it for move ordering.  This change will
        speed the search slightly.


More later.

Kong Sian
kongsian@nsrc.nus.sg
Technical Details
Message-ID: <2hg0q1$am3@nuscc.nus.sg>
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!raffles.technet.sg!nuscc.nus.sg!nsrccks

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d71d,3307d974203cb69c,start
X-Google-Attributes: gid10d71d,public
X-Google-ArrivalTime: 1994-01-18 01:42:14 PST
Path: arc1-ca.pugleaf.net!gmd.de!newsserver.jvnc.net!raffles.technet.sg!nuscc.nus.sg!nsrccks
From: nsrccks@leonis.nus.sg (Chua Kong Sian)
Newsgroups: gnu.chess
Subject: Bugs/suggestions for gnuchess 4.0pl64
Date: 18 Jan 1994 06:49:37 GMT
Organization: National University of Singapore
Lines: 195
Message-ID: <2hg0q1$am3@nuscc.nus.sg>
NNTP-Posting-Host: leonis.nus.sg
X-Newsreader: TIN [version 1.2 PL0]