Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about Crafty's organization of files

Author: Robert Hyatt

Date: 06:29:04 12/16/03

Go up one level in this thread


On December 16, 2003 at 01:10:08, Uri Blass wrote:

>On December 15, 2003 at 20:43:03, Robert Hyatt wrote:
>
>>On December 15, 2003 at 18:44:13, Uri Blass wrote:
>>
>>>Is there a special reason that HashStorePV is in hash.c and not on a seperate
>>>file?
>>
>>I try to keep "related" things together.  IE all the hash code is in hash.c,
>>all the learning stuff is in learn.c, all the evaluation code is in evaluate.c,
>>etc.
>
>I understand but in this case HashStorePV is clearly related to iterate.c and I
>think that having it in iterate when you have a note about it in hash.c is not
>less clear for the readers.

I put it there because all the code that reads/writes hash table entries is
in hash.c...  That tends to collect (encapsulate in a fashion) all the hash
code in one place.  This isn't always possible to do, but notice that I also
call HashProbe()/HashStore() from Search(), so where it is called from is not
necessarily related to the encapsulated capabilities of the code.

The good thing here is that when I change a hash entry, I don't have to go
looking all over the place to find out what to change, almost all of the
hash code is in hash.c (there are a couple of "ClearThisOrThat()" type
functions in utility.c unfortunately.

>
>In another thought a smart compiler may also understand from the code that
>HashStorePV is related to iterate so it is going to make no difference.
>
>Note that I also copied my sort to iterate.c(today I have not a special sort
>that I do only at the root but I plan to have it in the future)
>
>Uri


I think that how you arrange your code is a very small part of the overall
speed equation.  IE I have a RootMoveList() function that is only called
prior to a real search from Iterate().  But it is separate as it is a unique
function and it is easier to work on it without all the other iterate.c noise
scattered around it.





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.