Rodent 0.12

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Rodent 0.12

Post by PK »

available on its usual web page, www.koziol.home.pl/rodent

This version will probably stay for a while, as I will have insane amount of work in March. It's not much stronger than 0.11, but should be a bit more careful tactically.

Changes:

- some restructuring
- smarter time management (probably the most helpful modification)
- LMR code tweaked and simplified, history restriction enabled
- first draft of weakening code (may be enabled by #defines)
- loose pieces of endgame knowledge

Currently only the 32-bit compile is available, so I hope for some help

For the coming month I expect only to add more endgame stuff and release it as developement snapshots.
Rémi Coulom
Posts: 438
Joined: Mon Apr 24, 2006 8:06 pm

Re: Rodent 0.12

Post by Rémi Coulom »

Your link is broken.
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Rodent 0.12

Post by PK »

sorry for broken link.

www.koziol.home.pl/rodent.htm
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Rodent 0.12

Post by lucasart »

PK wrote:sorry for broken link.

www.koziol.home.pl/rodent.htm
thanks!

i'll compile it and run it in my open source bullet rating list

=> results available tomorrow in the tournament forum
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Rodent 0.12

Post by lucasart »

lucasart wrote:
PK wrote:sorry for broken link.

www.koziol.home.pl/rodent.htm
thanks!

i'll compile it and run it in my open source bullet rating list

=> results available tomorrow in the tournament forum
I couldn't compile it on Linux with g++. Here are all the warnings and errors, with solutions :D

Code: Select all

./eval/eval_pieces.c:110:20: warning: "/*" within comment [-Wcomment]
self explanatory

Code: Select all

./parser.c: In member function ‘void sParser::UciLoop()’:
./parser.c:58:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
./parser.c: In member function ‘void sParser::ParsePosition(sPosition*, char*)’:
./parser.c:180:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
The ISO C++ standard declares the char * cast of an std::string as deprecated. It may compile now, but it will not compile in ISO C++ 2011. The correct way to do it is to use .c_str() instead of an implicit cast.

Code: Select all

./timer.c: In member function ‘void sTimer::Waste(int)’:
./timer.c:118:24: error: ‘nanosleep’ was not declared in this scope
I'm not sure why you need a sleep function in your program. Anyway nanosleep is indeed a POSIX function, but it's in <time.h>, not <sys/time.h>
Also the argument is not an int but a struct. Have a look here on how to use nanosleep (basically you need to specify a struct with seconds and nanoseconds)
http://linux.die.net/man/2/nanosleep

Code: Select all

./search/report.c&#58;23&#58;21&#58; fatal error&#58; windows.h&#58; No such file or directory
compilation terminated.
Obviously this can only work under Windows. I'm not sure what windows.h is need for in search.c, but if you can do without, just protect this section with a

Code: Select all

#if defined&#40;_WIN32&#41; || defined&#40;_WIN64&#41;
the same way you did in timer.c

Code: Select all

./search/quiescence.c&#58; In member function ‘int sSearcher&#58;&#58;Quiesce&#40;sPosition*, int, int, int, int, int*)’&#58;
./search/quiescence.c&#58;64&#58;39&#58; warning&#58; suggest parentheses around assignment used as truth value &#91;-Wparentheses&#93;
./search/search.c&#58; In member function ‘int sSearcher&#58;&#58;Search&#40;sPosition*, int, int, int, int, int, int, int, int*)’&#58;
./search/search.c&#58;242&#58;63&#58; warning&#58; suggest parentheses around assignment used as truth value &#91;-Wparentheses&#93;
./search/search.c&#58; In member function ‘int sSearcher&#58;&#58;CountLegalMoves&#40;sPosition*, int&#41;’&#58;
./search/search.c&#58;442&#58;50&#58; warning&#58; suggest parentheses around assignment used as truth value &#91;-Wparentheses&#93;
self explanatory

With these fixes, your code should be compilable on Linux, MacOSX and Android, for example. So it would be nice to include them, unless you're not interested in portability and prefer to focus on Windows only, which is a shame of course ;)
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Rodent 0.12

Post by PK »

hi,

thanks for Your input.

as for sleeping, it is used for weakening the engine. this feature is not activated yet, because it needs much more tuning than I can afford right now.

do You have access to code that wasets specific number of nanoseconds under Linux?
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Rodent 0.12

Post by lucasart »

PK wrote: do You have access to code that wasets specific number of nanoseconds under Linux?
Yes, the link I sent you. There is also usleep (if you want microseconds).

In fact it's probably easier to use usleep, unless you really need nanosecond precision and to not be polluted by signals.

Using usleep couldn't be easier:

Code: Select all

#include <unistd.h>

int usleep&#40;useconds_t usec&#41;;
(usec is expressed in microseconds)
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Rodent 0.12

Post by lucasart »

also for the sake of portability (as well as simplicity), you could use the ISO C function clock() instead of all this

Code: Select all

int sTimer&#58;&#58;GetMS&#40;void&#41;
&#123;
#if defined&#40;_WIN32&#41; || defined&#40;_WIN64&#41;
  return GetTickCount&#40;);
#else
  struct timeval tv;

  gettimeofday&#40;&tv, NULL&#41;;
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
#endif
&#125;
while linux gives you nanosecond precision, I don't think windows' GetTickCount has a better resolution than a millisecond (or maybe even 10 ms...), so there's no point in all this complication.

Much easier and fully portable:

Code: Select all

#include <time.h>

clock_t start = clock&#40;);
...
clock_t stop = clock&#40;);

unsigned duration_milliseconds = &#40;stop - start&#41; * 1000 / CLOCKS_PER_SEC;
Anyway, I fixed your code and compiled it. I'll test it in my Open Source Bullet rating list. As usual results tomorrow in the tournament forum :D
Michel
Posts: 2272
Joined: Mon Sep 29, 2008 1:50 am

Re: Rodent 0.12

Post by Michel »

In fact it's probably easier to use usleep, unless you really need nanosecond precision and to not be polluted by signals.
Well usleep is deprecated....

Code: Select all

POSIX.1-2001  declares  this  function  obsolete;  use  nanosleep&#40;2&#41;  instead.
       POSIX.1-2008 removes the specification of usleep&#40;).
PK
Posts: 893
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Rodent 0.12

Post by PK »

64-bit compiles by Denis Mendoza and Dann Corbit are uploaded
developement snapshot with compatibility fixes will come after the weekend

busy regards,

pawel