Advertisement

Iterative deepening query

Started by July 24, 2010 02:04 AM
12 comments, last by willh 14 years, 3 months ago
Quote: Original post by beneficii
Quote: Original post by Artichoker
Quote: Original post by beneficii
I retain redundant information about the pieces and the board. I retain the physical board representation and lists of pieces. I go through the list, look at the pseudo-legal moves, check to see if they don't leave the king in check, and add them to a list, which I then sort according to various factors. I can get about 2 or 300,000 nodes per second with this, with the debugging information turned off. It's way slower without it. (This is for a chess variant which has a bigger board and more pieces and about twice the branching factor, though that's largely irrelevant to the speed per node, it seems.)

EDIT: About the debugging information, your compiler/GUI should have an option to turn off the debugging information when you compile. What do you use?


Thanks for the info, I will try some of those suggestions. Also, I am using C# on Microsoft Visual Studio 2010.

@Alvaro. Thanks for your response. I will look into hash tables and a quiescence search once I can at least get my engine to a decent speed. I am not copying boards or generating the entire tree or anything like that. Rather, I think my problem may be in inefficient move generation.


I'm using C++ on Microsoft Visual C++ 2010, which is notorious for having slow memory deallocation when programs compiled with it are run in debug mode. Really do try turning it off. Go to Solution in the Solution Explorer, go to Properties, go to Compiling Properties, and make sure the Solution is built as Release, not Debug, when you test the speed (and then make sure you test the EXE in the Release folder). If you're testing other aspects, you would probably just want to search to a shallow depth, like 3 ply, when you do the testing in debug mode.


Hmmm, this might have to do with the fact that I'm running the express edition, but there is no Compiling Properties section, and no files in my Release folder.
Quote: Original post by Artichoker
Quote: Original post by beneficii
Quote: Original post by Artichoker
Quote: Original post by beneficii
I retain redundant information about the pieces and the board. I retain the physical board representation and lists of pieces. I go through the list, look at the pseudo-legal moves, check to see if they don't leave the king in check, and add them to a list, which I then sort according to various factors. I can get about 2 or 300,000 nodes per second with this, with the debugging information turned off. It's way slower without it. (This is for a chess variant which has a bigger board and more pieces and about twice the branching factor, though that's largely irrelevant to the speed per node, it seems.)

EDIT: About the debugging information, your compiler/GUI should have an option to turn off the debugging information when you compile. What do you use?


Thanks for the info, I will try some of those suggestions. Also, I am using C# on Microsoft Visual Studio 2010.

@Alvaro. Thanks for your response. I will look into hash tables and a quiescence search once I can at least get my engine to a decent speed. I am not copying boards or generating the entire tree or anything like that. Rather, I think my problem may be in inefficient move generation.


I'm using C++ on Microsoft Visual C++ 2010, which is notorious for having slow memory deallocation when programs compiled with it are run in debug mode. Really do try turning it off. Go to Solution in the Solution Explorer, go to Properties, go to Compiling Properties, and make sure the Solution is built as Release, not Debug, when you test the speed (and then make sure you test the EXE in the Release folder). If you're testing other aspects, you would probably just want to search to a shallow depth, like 3 ply, when you do the testing in debug mode.


Hmmm, this might have to do with the fact that I'm running the express edition, but there is no Compiling Properties section, and no files in my Release folder.



I'm using Express too, but the Japanese version. The word that I translated as "Compiling" was kousei--a better word may be "Build". Think of some word that implies construction.
Advertisement
Compiling in release mode would definitely help. I use g++, so I can't really help much.

I don't know if it's possible with C#, but in C or C++ you don't need to do virtually any dynamic memory allocation inside minimax.

.NET is really slow when it comes to array referencing. If you use the unsafe keyword you can force it to use pointers which should speed things up.

That said, it still sounds too slow. The problem is very likely how you are generating your moves.

How are you representing the board?

This topic is closed to new replies.

Advertisement