I'm glad to announce a beta release of the CPW-Engine code, constituting a part of the Chessprogramming Wiki. It can be viewed at:
http://chessprogramming.wikispaces.com/CPW-Engine
I consider this code a public domain, not even a GPL.
CPW-Engine is a didactic project, undertaken by myself and Edmond Moshammer a couple of months ago. Its strength is comparable to Gerbil and Faile (it scored the same 5,5/11 in ChessWar XIII F, albeit earning slightly lower rating). Its philosophy, however, is quite different.
CPW-Engine was meant to be a showcase, presenting various techniques without making full use of their potential. Special care has been taken to show, comment and explain things that some time ago were rather lacking in resources. That was the reason for adding futility pruning and some quiescence search stuff
Features:
- 0x88 board
- alpha-beta search with null move, transposition table, PVS and futility pruning
- handling of a SAN opening book
- delta pruning in quiescence search
- code of two different evaluation functions: one with king tropism and lazy eval, the other with a real king safety and eval hashtable
I'd be glad to see some code reviews and ideas how to simplify some parts of the program.
regards,
CPW-Engine
Moderators: hgm, Dann Corbit, Harvey Williamson
-
PK
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
CPW-Engine
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm
-
Andres Valverde
- Posts: 557
- Joined: Sun Feb 18, 2007 11:07 pm
- Location: Almeria. SPAIN
-
Jim Ablett
- Posts: 1343
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: CPW-Engine

C.P.W build 050908 by the C.P.W Team
Windows win32 Intel compiler 10 p.g.o build.
http://www.mediafire.com/?lwgz0nmmjtr
Nice work Pawel, and everyone on C.P.W team.
Jim.
-
Carey
- Posts: 313
- Joined: Wed Mar 08, 2006 8:18 pm
Re: CPW-Engine
Jim;Jim Ablett wrote:
C.P.W build 050908 by the C.P.W Team
Windows win32 Intel compiler 10 p.g.o build.
http://www.mediafire.com/?lwgz0nmmjtr
Nice work Pawel, and everyone on C.P.W team.![]()
Jim.
Are you sure your build is working right?
I'm running some perft's from it and the time its reporting isn't even close to being accurate.
Real time clock is close to a minute and it's reporting 1341.
Assuming that's milliseconds, that'd be 1.3 seconds.
Assuming that's centi-seconds, that'd be 13.4 seconds.
There's nothing else running on the system, and even if there was, there's an extra core to take care of stuff and it still wouldn't be close.
So it can't be cpu time because on such a lightly loaded dual core system, there is nothing to effect the timing that much.
Looking at their code, it doesn't look too complicated. Assuming their Windows specific clock function works, of course.
It looks like it's supposed to be milliseconds. Meaning I should have gotten a timing closer to 58000 instead of 1340.
Any ideas?
(No, I haven't cut & pasted their code from the web site and compiled it myself yet. I just downloaded the windows build and tried it. I wont get a chance to compile it myself until at least tonight.)
-
Jim Ablett
- Posts: 1343
- Joined: Fri Jul 14, 2006 7:56 am
- Location: London, England
- Full name: Jim Ablett
Re: CPW-Engine
Hi Carey,
Looks like a time bug in the code.
Replace with this one (in util.cpp)
Jim.
Looks like a time bug in the code.
Replace with this one (in util.cpp)
Code: Select all
#include <time.h>
void perft_start(char * command) {
clock_t begin, end;
begin = clock();
int depth;
sscanf(command + 6, "%d", &depth);
printf("Performance Test\n");
for (int d=1;d<=depth;d++) {
end = clock()-begin;
printf("%d:\t%6.3f\t%d\n",d,end*(1./CLOCKS_PER_SEC),perft(d));
}
}
-
Carey
- Posts: 313
- Joined: Wed Mar 08, 2006 8:18 pm
Re: CPW-Engine
Nope, that doesn't work either.Jim Ablett wrote:Hi Carey,
Looks like a time bug in the code.
Replace with this one (in util.cpp)
Now that I have time to look at the code more carefully I see that the original problem was the order of evaluation of parameters.
Code: Select all
for (int d=1;d<=depth;d++) {
printf("%d:\t%d\t%d\n",d,gettime()-starttime,perft(d));
}
C doesn't specify the order of evaluation, so it's perfectly acceptable for the perft to be done after the timing stuff.
Not sure if this is a one time bug or there might be similar issues in the rest of it.
That'll need to be done differently, of course.
I'm not sure how they'd want it done (a running total like the do now, or the more normal individual timing), but it would need to be something like:
Code: Select all
for (int d=1;d<=depth;d++) {double p;
starttime = gettime();
p = perft(d);
starttime = gettime()-starttime;
printf("%d:\t%d\t%d\n",d,starttime,p);
}
-
Carey
- Posts: 313
- Joined: Wed Mar 08, 2006 8:18 pm
Re: CPW-Engine
Minor issue for my fix....
I thought perft was returning a double, in spite of it saying U64 just a few lines down...
Either way the printf format string needs to change, since a %d is inappropriate for either param type.
Considering the annoyances of trying to portably print out 64 bit integers, I'd suggest just doing it as a "%.0f" double.
All this is obvious. I just didn't want people to complain my fix was buggy on something so obvious. (It was... I just don't want people to point it out....
)
I wonder how CPWE would fare being run through SPLint....
I thought perft was returning a double, in spite of it saying U64 just a few lines down...
Either way the printf format string needs to change, since a %d is inappropriate for either param type.
Considering the annoyances of trying to portably print out 64 bit integers, I'd suggest just doing it as a "%.0f" double.
All this is obvious. I just didn't want people to complain my fix was buggy on something so obvious. (It was... I just don't want people to point it out....
I wonder how CPWE would fare being run through SPLint....