Null Move

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Zach Wegner
Posts: 1922
Joined: Thu Mar 09, 2006 12:51 am
Location: Earth

Re: Null Move

Post by Zach Wegner »

hristo wrote:
bob wrote: Not sure what would cause that. First thought is to just try "make linux" instead, as that makes cleanly on my linux boxes...

Bob
"make linux" compiled ... damn linux is better than FreeBSD. ;-) (your Makefile proves it)
However when running the application

Code: Select all

hristo$ ./crafty 
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
ERROR.  shmget() failed, unable to allocate a shared memory segment.
        Please verify that your /proc/sys/kernel/shmmax value is
        large enough to allow allocating the amount of memory you
        are requesting.  "echo 1000000000 > /proc/sys/kernel/shmmax"
        will allow a segment up to one billion bytes.
Cheers,
Hristo
Check out this page: http://www.spy-hill.net/help/apple/SharedMemory.html

Because of this nonsense I chose to do shared memory with mmap(). Much easier.
Uri Blass
Posts: 10281
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Null Move

Post by Uri Blass »

Zach Wegner wrote:
Dann Corbit wrote:
Tony wrote:
Zach Wegner wrote:
Tony wrote:I always nullmove, since it always gives me something. Killer moves, threaths, hash moves (iid) etc.
Indeed. The _only_ condition I use right now is whether I am in check.
Yes, you are right. I have 1 condition.

Tony
Do you check to see if you just executed a null move? (Double null move)
I don't. I removed that condition too, because it didn't really matter. So now I allow triple, quadruple, etc. nullmoves. One less parameter to my search function...
It means that your program may see a draw in position that the side to move is losing because the best thing for both sides is to play a null move.

Uri
Tony

Re: Null Move

Post by Tony »

Dann Corbit wrote:
Tony wrote:
Zach Wegner wrote:
Tony wrote:I always nullmove, since it always gives me something. Killer moves, threaths, hash moves (iid) etc.
Indeed. The _only_ condition I use right now is whether I am in check.
Yes, you are right. I have 1 condition.

Tony
Do you check to see if you just executed a null move? (Double null move)
I notice, but I still do it.

I make sure the best move isn't a nullmove (verification search) and when fe nullmove returns a checkmate score and a double nullmove was executed, I jump back 2 plies.


Tony
Tony

Re: Null Move

Post by Tony »

Uri Blass wrote:
Zach Wegner wrote:
Dann Corbit wrote:
Tony wrote:
Zach Wegner wrote:
Tony wrote:I always nullmove, since it always gives me something. Killer moves, threaths, hash moves (iid) etc.
Indeed. The _only_ condition I use right now is whether I am in check.
Yes, you are right. I have 1 condition.

Tony
Do you check to see if you just executed a null move? (Double null move)
I don't. I removed that condition too, because it didn't really matter. So now I allow triple, quadruple, etc. nullmoves. One less parameter to my search function...
It means that your program may see a draw in position that the side to move is losing because the best thing for both sides is to play a null move.

Uri
Not with a verification search.

Tony
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null Move

Post by bob »

hristo wrote:
bob wrote: Not sure what would cause that. First thought is to just try "make linux" instead, as that makes cleanly on my linux boxes...

Bob
"make linux" compiled ... damn linux is better than FreeBSD. ;-) (your Makefile proves it)
However when running the application

Code: Select all

hristo$ ./crafty 
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
ERROR.  shmget() failed, unable to allocate a shared memory segment.
        Please verify that your /proc/sys/kernel/shmmax value is
        large enough to allow allocating the amount of memory you
        are requesting.  "echo 1000000000 > /proc/sys/kernel/shmmax"
        will allow a segment up to one billion bytes.
Cheers,
Hristo
Read the entire error. As root, type "echo 1000000000 > /proc/sys/kernel/shmmax" and you will be set. :)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Null Move

Post by bob »

Zach Wegner wrote:
hristo wrote:
bob wrote: Not sure what would cause that. First thought is to just try "make linux" instead, as that makes cleanly on my linux boxes...

Bob
"make linux" compiled ... damn linux is better than FreeBSD. ;-) (your Makefile proves it)
However when running the application

Code: Select all

hristo$ ./crafty 
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
ERROR.  shmget() failed, unable to allocate a shared memory segment.
        Please verify that your /proc/sys/kernel/shmmax value is
        large enough to allow allocating the amount of memory you
        are requesting.  "echo 1000000000 > /proc/sys/kernel/shmmax"
        will allow a segment up to one billion bytes.
Cheers,
Hristo
Check out this page: http://www.spy-hill.net/help/apple/SharedMemory.html

Because of this nonsense I chose to do shared memory with mmap(). Much easier.
mmap() is an alternative, but it too has some portability issues. I once used that but have had no failures with shmget()/shmat() except for the max segment size issue. Personally, I think the MacOS is pretty poor if you can't dynamically change this. Linux has had this for years...
Alessandro Scotti

Re: Null Move

Post by Alessandro Scotti »

bob wrote:mmap() is an alternative, but it too has some portability issues. I once used that but have had no failures with shmget()/shmat() except for the max segment size issue. Personally, I think the MacOS is pretty poor if you can't dynamically change this. Linux has had this for years...
I would never ask any user to change such a system settings just to run a chess engine. Not on Linux and certainly not on Mac OS X. Just my opinion of course.
hristo

Re: Null Move

Post by hristo »

bob wrote:
hristo wrote:
bob wrote: Not sure what would cause that. First thought is to just try "make linux" instead, as that makes cleanly on my linux boxes...

Bob
"make linux" compiled ... damn linux is better than FreeBSD. ;-) (your Makefile proves it)
However when running the application

Code: Select all

hristo$ ./crafty 
unable to open book file [./book.bin].
book is disabled
unable to open book file [./books.bin].
ERROR.  shmget() failed, unable to allocate a shared memory segment.
        Please verify that your /proc/sys/kernel/shmmax value is
        large enough to allow allocating the amount of memory you
        are requesting.  "echo 1000000000 > /proc/sys/kernel/shmmax"
        will allow a segment up to one billion bytes.
Cheers,
Hristo
Read the entire error. As root, type "echo 1000000000 > /proc/sys/kernel/shmmax" and you will be set. :)
This error would be meaningful if I actually had "/proc/sys/kernel/shmmax" ... but I don't even have "/proc" ... I compiled crafty using a linux target, but am attempting to run it in Darwin, so I don't expect the reported errors to make sense. :-)

BTW,
mmap could be a bit better and easier.

Good morning,
Hristo