Null Move

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Zach Wegner
Posts: 1922
Joined: Wed Mar 08, 2006 11:51 pm
Location: Earth
Contact:

Re: Null Move

Post by Zach Wegner » Tue Nov 27, 2007 3:15 am

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: 8594
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: Null Move

Post by Uri Blass » Tue Nov 27, 2007 8:33 am

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 » Tue Nov 27, 2007 9:37 am

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 » Tue Nov 27, 2007 9:38 am

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: 20566
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Null Move

Post by bob » Tue Nov 27, 2007 4:32 pm

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: 20566
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Null Move

Post by bob » Tue Nov 27, 2007 4:35 pm

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 » Tue Nov 27, 2007 4:45 pm

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 » Tue Nov 27, 2007 5:10 pm

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

Post Reply