Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: definition of clones: Danchess an Crafty

Author: Uri Blass

Date: 19:32:43 02/17/04

Go up one level in this thread


On February 17, 2004 at 17:47:10, Dann Corbit wrote:

>On February 17, 2004 at 17:22:59, Bo Persson wrote:
>
>>On February 16, 2004 at 19:08:38, Dann Corbit wrote:
>>
>>>On February 15, 2004 at 18:00:37, Bo Persson wrote:
>>>
>>>>On February 15, 2004 at 14:43:06, Bob Durrett wrote:
>>>>
>>>>>On the other hand, maybe there are parts of crafty which could be used in the
>>>>>beginning so that the newbie programmer could concentrate on creating his/her
>>>>>own code for the really important parts.
>>>>
>>>>The problem is that the really important parts are those that are hard to write,
>>>>and easiest to copy.
>>>>
>>>>The parts that are simple and non-important, you could just as easily write
>>>>yourself in an evening or three.
>>>
>>>The search is more important than the evaluation, in my opinion.
>>
>>I think that they are both important, but that a simple alpha-beta routine is
>>explained in many books on algorithms. It is also rather short and well
>>researched and documented.
>>
>>An evaluation is much harder to start from scratch, IMO. Partly because there is
>>much less solid material to read up on.
>
>Where have you been looking?  This is quite good:
>http://home.vicnet.net.au/~chess/posi.html
>
>Here is some more stuff I turned up in a jiffy:
>http://myweb.cableone.net/christienolan/coach/evaluating.htm
>http://en.wikipedia.org/wiki/Chess_strategy_and_tactics
>http://www.markalowery.net/Chess/Tactics_Strategy/Menu/tactics_strategy_index.html
>
>This is what I use:
>Play Winning Chess (Winning Chess) by Yasser Seirawan, Jeremy Silman
>Winning Chess Brilliancies by Yasser Seirawan (Author)
>Winning Chess Endings by Yasser Seirawan (Author)
>Winning Chess Openings by Yasser Seirawan (Author)
>Winning Chess Strategies (Winning Chess) by Yasser Seirawan, Jeremy Silman
>Winning Chess Tactics by Yasser Seirawan, Jeremy Silman  (Author)
>
>
>>>>>Dann Corbit seems to have suggested that starting with an existing search
>>>>>algorithm, such as alpha/beta, might be a prudent way to get started.
>>>>
>>>>That part you can get from a text book, so you don't have to "borrow" it from
>>>>some program source.
>>>
>>>If you borrow it from a book, that is exactly the same thing.
>>
>>I wasn't talking about a verbatim copy, but that the algoritm is well described
>>and easy to find in standard text books. It is also no rocket science - like
>>this piece from my feeble attempt:
>>
>>      // Start regular search
>>
>>      SCORE Score = -Infinity;
>>      bool LegalMoveFound = false;
>>
>>      for (MoveSequencer::iterator CurrentMove = Replies.begin();
>>           CurrentMove != Replies.end(); ++CurrentMove)
>>      {
>>         ASSERT(!CurrentMove->CapturesKing());
>>         ASSERT(LookAheadBoard.WhiteToMove() ==
>>                CurrentMove->MovedPiece().IsLite());
>>
>>         if (RemainingDepth + Extension > 1)
>>         {
>>            Score = -Search(-Beta, -Alpha,
>>                            GameState(LookAheadBoard, *CurrentMove),
>>                            RemainingDepth + Extension - 1,
>>                            Ply + 1);
>>         }
>>         else
>>         {
>>            Score = -Quiescence(-Beta, -Alpha,
>>                                GameState(LookAheadBoard, *CurrentMove),
>>                                Ply + 1);
>>         }
>>
>>         if (Score != IllegalMoveScore)
>>            LegalMoveFound = true;
>>
>>         if (Score >= Beta)
>>         {
>>            SCORE LowerBound = AdjustBoundForStoring(Score);
>>
>>            MyTranspositionTable.StoreLowerBound(LookAheadBoard.Signature(),
>>                                                 RemainingDepth,
>>                                                 LookAheadBoard.WhiteToMove(),
>>                                                 *CurrentMove, LowerBound);
>>
>>            MoveHistory.AddHistory(*CurrentMove, RemainingDepth);
>>
>>            if (!CurrentMove->IsCapture())
>>               Killers.AddKiller(Ply, *CurrentMove);
>>
>>            return Score;
>>
>>         }
>>
>>      }
>>
>>
>>Hardly worth stealing, is it?
>
>The most fundamentally important part of any good chess program?
>Surely you jest.  At any rate, borrowing anything should include credit if
>adapted and include permission if used directly.
>
>>>> The alpha/beta code is also less than a page long, out of
>>>>the 60k(?) lines of Crafty.
>>>
>>>~42000, unless you add in the EGTB stuff of Eugene, in which case it will be
>>>larger:
>>
>>Well, I didn't actually count it but "borrowed" the number from one of Bob's
>>posts.
>
>Did you notice that Bob's program is 6 times larger?
>
>>> snip
>>
>>>>>It is not so clear about the position evaluation [and maybe move generator].  I
>>>>>do not read about well known algorithms for position evaluation.
>>>>
>>>>Exactly, so here we have the hard-to-write parts. Using Crafty's evaluation
>>>>function is definitely cloning.
>>>
>>>Except that it did not use Crafty's evaluation function.  It did use many of the
>>>terms from Crafty's evaluation function.
>>
>>I said that "Using Crafty's evaluation function is definitely cloning." from a
>>principal point of view, I have no idea what pieces of the code are (or are not)
>>present in some other chess program.
>>
>>Using some ideas is ok, using all 4000 lines of Bob's evaluate.cpp is not. It is
>>also one thing to peek at some code like Crafty to see what's going on there and
>>get some inspiration, and an entirely different thing to just copy and paste
>>from it.
>
>He did not use all 4000 lines of Crafty's evaluation function.  His evalation
>function is much smaller.
>E:\pgn\winboard-engines\danchess>wc board_evaluate.cpp
>1370 Lines, 5466 Words, 51771 Characters
>
>He definitely did borrow many ideas from crafty in that version of his eval
>function.  No question.
>
>>I can give you an example, from my own experience:
>>
>>Like many others, I learned about rotated bitboards from Bob. Of course I also
>>took a quick peek at Crafty's source, to get the general idea, before I did my
>>own version.
>>
>>Only years later did I discover that my bitboards are rotated 0, 45, 90, and 135
>>degrees instead of Crafty's 0, 90, and +/- 45.
>>
>>Bob has also numbered the bits in the "wrong" direction. Can't he get anything
>>right?  :-)
>
>If you had numbered them in the same way as Bob, because of seeing how he did
>it, do you feel that would have been doing something improper?

I see no reason to number them in the same way.
You have in crafty

first_one[0]=16;
last_one[0]=16;

simple logic says that if you want the biggest power or the smallest power you
should get 0 in both cases.

If I understand correctly Danchess probably also have arrays with the same
contrent and not the natural 0.

I have different arrays of biggest_power and smallest_power that are logical to
think about

9=2^3+2^0 so
biggest_power[9]=3;
smallest_power[9]=0;

I understand that Crafty gets
first_one[9]=12;
last_one[9]=15;

It is not logical to have
first_one[2^15]=0
first_one[2^14]=1
...
first_one[2^3]=12

I am not talking about speed here because new programmer first need something
that works.

It seems to me harder to debug a thing like this because I can calculate my
biggest_power and smallest_power by head(9=2^3+2^0 is something that I see
immediatly) when calculating first_one of crafty is simply harder task.


My conclusion is that every program that has an array with the same content as
crafty first_one or function with the same content as crafty first_one(because
as far as I can see crafty does not use the arrays when it calculates first_one
in the assembler version) is suspected to be crafty clone.

I do not say that it is enough evidence and if it is the only similiarity to
crafty it is not enough but Bob showed more evidence in the case of DannChess.

Uri



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.