First Release of Maverick Chess Engine!

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: First Release of Maverick Chess Engine!

Post by velmarin »

Steve Maughan wrote:
Maverick may be faster than Bouquet but it's nowhere near its strength!

Steve
Of course, that's normal.
I know Bouquet (3000 + Ippolit derivate)
not compared.
Neither my merit 100 100, maybe 5 percent.

I mean, on my computer,
Bouquet say, 1800 kns,
Murka 3.0 3000kns.
Maverick 5400kns.

Awesome, I'll see slowly. (As an apprentice)

But I like your project from the beginning, and always nice to see the efforts to teach or engage fans, lease, Winglet, Maverick, Danasah, ect, ect.
Thank you and to you.


velmarin-PC, Blitz 1m 0
1 Maverick Velmarin +5 +32/=14/-31 50.65% 39.0/77
2 Maverick 0.05 64 bit -5 +31/=14/-32 49.35% 38.0/77

Maverick Velmarin and a compilation first touch,(Intel, not optimizacions)
in the next few hours I would like to see more slowly, to see if it takes more with other compilers.
Just for fun, or experiment....
thanks Steve.
User avatar
Steve Maughan
Posts: 1326
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: First Release of Maverick Chess Engine!

Post by Steve Maughan »

Hi Carl -

Darn pesky bugs!

Are you using the 64 or 32 bit version? The 64 bit requires the popcount instruction, so a i3, i5 or i7.

Has anyone else had a crash?

Steve
tttony
Posts: 278
Joined: Sun Apr 24, 2011 12:33 am

Re: First Release of Maverick Chess Engine!

Post by tttony »

Steve Maughan wrote:Hi Louis,

You can download the source here:

http://chilp.it/ccff73

Unfortunately Maverick is quite Windows centric and uses a thread to capture the user input. So it may be difficult to get it to run on Linux or OS X. I'd be interested to know if it is possible.

Steve
Bad bad that is Windows centric

You can grab the code from the OliThink 5.3.2 source to capture the input

And congrats for the new engine!!!

Found the code:

Code: Select all

int bioskey() {
#ifndef _WIN32
  fd_set readfds;

  FD_ZERO (&readfds);
  FD_SET (fileno(stdin), &readfds);
  tv.tv_sec=0; tv.tv_usec=0;
  select(16, &readfds, 0, 0, &tv);

  return (FD_ISSET(fileno(stdin), &readfds));
#else
   static int init = 0, pipe;
   static HANDLE inh;
   DWORD dw;

   if (!init) {
     init = 1;
     inh = GetStdHandle(STD_INPUT_HANDLE);
     pipe = !GetConsoleMode(inh, &dw);
     if (!pipe) {
        SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT));
        FlushConsoleInputBuffer(inh);
      }
    }
    if (pipe) {
      if (!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL)) return 1;
      return dw;
    } else {
      GetNumberOfConsoleInputEvents(inh, &dw);
      return dw <= 1 ? 0 : dw;
	}
#endif
}
carldaman
Posts: 2287
Joined: Sat Jun 02, 2012 2:13 am

Re: First Release of Maverick Chess Engine!

Post by carldaman »

Steve Maughan wrote:Hi Carl -

Darn pesky bugs!

Are you using the 64 or 32 bit version? The 64 bit requires the popcount instruction, so a i3, i5 or i7.

Has anyone else had a crash?

Steve
I know, I'm a magnet for bugs :P

64-bit version on i3, using Arena 3.0
User avatar
Steve Maughan
Posts: 1326
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: First Release of Maverick Chess Engine!

Post by Steve Maughan »

Hi Carl,

Good news - Dann Corbit found a few lurking gremlins using his uber-powerful toolkit (Thanks Dann!).

As far as I can tell there wasn't anything too serious, but you never know.

I've recompiled and uploaded to the website. There are no functional changes so I haven't changed the version number. You can get the new compile here:

http://www.chessprogramming.net/downloads/

Please let me know if you still have problems,

Best,

Steve
carldaman
Posts: 2287
Joined: Sat Jun 02, 2012 2:13 am

Re: First Release of Maverick Chess Engine!

Post by carldaman »

Thanks, Steve, but the download link is not working for some reason (specifically when I click on the Maverick link).

All these gremlins... :roll: :)
Steve Maughan wrote:Hi Carl,

Good news - Dann Corbit found a few lurking gremlins using his uber-powerful toolkit (Thanks Dann!).

As far as I can tell there wasn't anything too serious, but you never know.

I've recompiled and uploaded to the website. There are no functional changes so I haven't changed the version number. You can get the new compile here:

http://www.chessprogramming.net/downloads/

Please let me know if you still have problems,

Best,

Steve
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: First Release of Maverick Chess Engine!

Post by michiguel »

Steve Maughan wrote:Hi Louis,

You can download the source here:

http://chilp.it/ccff73

Unfortunately Maverick is quite Windows centric and uses a thread to capture the user input. So it may be difficult to get it to run on Linux or OS X. I'd be interested to know if it is possible.

Steve
Actually, the approach of having a thread to capture input is very portable. I wrote wrappers of the different functions available in windows and the unix world and keep them isolated in a different file. I have done that in Gaviota and it compiles in windows, linux, OSX, etc.

For instance in POSIX

Code: Select all

#if defined (POSIX_THREADS)

#include <pthread.h>

extern int /* boolean */
mythread_create (/*@out@*/ mythread_t *thread, routine_t start_routine, void *arg, /*@out@*/ int *ret_error)
{
	const pthread_attr_t *attr = NULL; /* default attributes */
	int ret;
	ret = pthread_create (thread, attr, start_routine, arg);
	*ret_error = ret;
	return 0 == ret;
}

extern int /* boolean */
mythread_join (mythread_t thread)
{
	void *p; /* value return from pthread_exit, not used */
	int ret = pthread_join (thread, &p);
	return 0 == ret;
}

extern void 		
mythread_exit (void)
{
	pthread_exit (NULL);
}


extern const char *
mythread_create_error (int err)
{
	const char *s;
	switch (err) {
		case 0     : s = "Success"; break;
		case EAGAIN: s = "EAGAIN" ; break;
		case EINVAL: s = "EINVAL" ; break; 
		case EPERM : s = "EPERM"  ; break;
		default    : s = "Unknown error"; break;
	}
	return s;
}
and in Windows

Code: Select all

#elif defined(NT_THREADS)

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>

extern int /* boolean */
mythread_create (/*@out@*/ mythread_t *thread, routine_t start_routine, void *arg, /*@out@*/ int *ret_error)
{
	static unsigned int	thread_id;
	mythread_t t;
	int /* boolean */ is_ok;

	t =	(mythread_t) _beginthreadex (NULL, 0, start_routine, arg, 0, &thread_id );
	is_ok = (t != 0);
	*thread = t;
	*ret_error = is_ok? 0: errno;
	return is_ok;
}

extern int /* boolean */
mythread_join (mythread_t thread)
{
	unsigned long int ret;
	ret = WaitForSingleObject (thread, INFINITE);
	CloseHandle(thread);
	return ret != WAIT_FAILED;
}

extern void 		
mythread_exit (void)
{
	return;
}

extern const char *
mythread_create_error (int err)
{
	const char *s;
	switch (err) {
		case 0     : s = "Success"; break;
		case EAGAIN: s = "EAGAIN" ; break;
		case EINVAL: s = "EINVAL" ; break; 
		case EPERM : s = "EPERM"  ; break;
		default    : s = "Unknown error"; break;
	}
	return s;
}
And I use

mythread_create ()
mythread_join ()
mythread_exit ()
mythread_create_error ()

throughout my program.

I have a similar approach with mutexes, etc.

Miguel
User avatar
Steve Maughan
Posts: 1326
Joined: Wed Mar 08, 2006 8:28 pm
Location: Florida, USA

Re: First Release of Maverick Chess Engine!

Post by Steve Maughan »

Hi Carl,
carldaman wrote:Thanks, Steve, but the download link is not working for some reason (specifically when I click on the Maverick link).

All these gremlins... :roll: :)
It should work now,

Thanks,

Steve
User avatar
Mithu
Posts: 213
Joined: Thu Jul 15, 2010 5:59 am

Re: First Release of Maverick Chess Engine!

Post by Mithu »

Download link for Maverick is broken (or some problem from my end)? Please help!
The file starts then stalls immediately saying permission denied or something similar :(
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: First Release of Maverick Chess Engine!

Post by lucasart »

tttony wrote:
Steve Maughan wrote:Hi Louis,

You can download the source here:

http://chilp.it/ccff73

Unfortunately Maverick is quite Windows centric and uses a thread to capture the user input. So it may be difficult to get it to run on Linux or OS X. I'd be interested to know if it is possible.

Steve
Bad bad that is Windows centric

You can grab the code from the OliThink 5.3.2 source to capture the input

And congrats for the new engine!!!

Found the code:

Code: Select all

int bioskey() {
#ifndef _WIN32
  fd_set readfds;

  FD_ZERO (&readfds);
  FD_SET (fileno(stdin), &readfds);
  tv.tv_sec=0; tv.tv_usec=0;
  select(16, &readfds, 0, 0, &tv);

  return (FD_ISSET(fileno(stdin), &readfds));
#else
   static int init = 0, pipe;
   static HANDLE inh;
   DWORD dw;

   if (!init) {
     init = 1;
     inh = GetStdHandle(STD_INPUT_HANDLE);
     pipe = !GetConsoleMode(inh, &dw);
     if (!pipe) {
        SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT|ENABLE_WINDOW_INPUT));
        FlushConsoleInputBuffer(inh);
      }
    }
    if (pipe) {
      if (!PeekNamedPipe(inh, NULL, 0, NULL, &dw, NULL)) return 1;
      return dw;
    } else {
      GetNumberOfConsoleInputEvents(inh, &dw);
      return dw <= 1 ? 0 : dw;
	}
#endif
}
He uses a thread to probe for input without blocking the search. So he doesn't need this code. In fact, using threads, there is nothing that require any OS or Compiler dependance. I don't know why his code uses windows stuff, and is not portable. The first thing to do is to remove

Code: Select all

#inclue <windows.h>
and fix the error messages from there. threads can be done portable in C11 or in C++11.

The second thing is to compile it with GCC and to use -Wall and -pedantic, in order to print out all the warnings and especially those refering to violation of the ISO C++ standard (portability). That should take care of MSVC centric stuff. Also it means you can produce very fast compiles with a free compiler, which is not possible with MSVC (it either cost a fortune, or you use MSVC Express which is limited to 32 bit, and probably produces slower compiles too IIRC).
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.