Maximum possible mobility

Discussion of chess software programming and technical issues.

Moderator: Ras

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Maximum possible mobility

Post by jwes »

Steelman wrote:Interesting the max number of moves is so high? I did not look at the positions but they must be fantasy positions to have that many possible moves.

However the data structure my engine uses for move storage is a single linked list. Even if there are 500 possible moves for the side the moves would be stored sequentially in the structure. I have pointers for the move parent, the move child, and the move sibling. I need however to also remember the next available open link pointer.
When the my engine is ready to generate the reply moves for the first move in the list (next ply) they get stored starting at that "next available link pointer".
That means I do not have a "MAX_NUMBER_MOVES" definition anywhere in program but I do have MAX_MOVE_STORAGE. The max number of moves that can be stored in the move structure list.

So my question is:
What should MAX_MOVE_STORAGE be set at?

Number of max plies your engine is set at * (max number of moves at each ply)?

I am not even going there!
I have seen my engine go about 22 ply deep. I estimated about 50 moves each ply max. Thats a little over a thousand. No problem. Then I added a big safety factor. Now since I have no idea what the real answer is i have MAX_MOVE_STORAGE set to 5000.

Problem solved!?
This will work very well until your program is playing some very important game on much better hardware and will crash in a winning position. Why not set it to MAX_PLY * 219 ? This still should be only 1 or 2 meg of memory.
Uri Blass
Posts: 10820
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Maximum possible mobility

Post by Uri Blass »

jwes wrote:
Steelman wrote:Interesting the max number of moves is so high? I did not look at the positions but they must be fantasy positions to have that many possible moves.

However the data structure my engine uses for move storage is a single linked list. Even if there are 500 possible moves for the side the moves would be stored sequentially in the structure. I have pointers for the move parent, the move child, and the move sibling. I need however to also remember the next available open link pointer.
When the my engine is ready to generate the reply moves for the first move in the list (next ply) they get stored starting at that "next available link pointer".
That means I do not have a "MAX_NUMBER_MOVES" definition anywhere in program but I do have MAX_MOVE_STORAGE. The max number of moves that can be stored in the move structure list.

So my question is:
What should MAX_MOVE_STORAGE be set at?

Number of max plies your engine is set at * (max number of moves at each ply)?

I am not even going there!
I have seen my engine go about 22 ply deep. I estimated about 50 moves each ply max. Thats a little over a thousand. No problem. Then I added a big safety factor. Now since I have no idea what the real answer is i have MAX_MOVE_STORAGE set to 5000.

Problem solved!?
This will work very well until your program is playing some very important game on much better hardware and will crash in a winning position. Why not set it to MAX_PLY * 219 ? This still should be only 1 or 2 meg of memory.
I think that practically 5000 moves are enough and your case is not going to happen.

Inspite of it movei has
#define GEN_STACK 30000
#define MAX_PLY 128

Uri