Welcome, Guest. Please Login or Register.
May 3rd, 2024, 4:53pm

Home Home Help Help Search Search Members Members Login Login Register Register
Arimaa Forum « bot functions speed »


   Arimaa Forum
   Arimaa
   Bot Development
(Moderator: supersamu)
   bot functions speed
« Previous topic | Next topic »
Pages: 1 2 3 4  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: bot functions speed  (Read 7882 times)
Hippo
Forum Guru
*****




Arimaa player #4450

   


Gender: male
Posts: 883
Re: bot functions speed
« Reply #45 on: May 16th, 2011, 9:02am »
Quote Quote Modify Modify

on May 16th, 2011, 6:48am, JimmSlimm wrote:
Ah, thanks lightvector for that idea.
 
Yes Swynndla I am currently doing width-first

 
I cannot beleive it could work ... expanding to 2 or at least 3 full turns must lead to consumption of the whole memory.
 
I would expect expanding to full width only in one branch.
 
Of course even more (at least space) effective method does not need to keep full expansion of a level, but generating positions/moves on demand.
 
The problem with avoiding search of repeated positions could be more difficult when positions are generated on several levels of search concurently.
(Repetition avoiding hash table(s) need several active histories).
 
I still use the original jdb's engine, but it's step based except the root level so expanding full width of at most 185 moves (except the killers) is not problem.
 
I am still not sure which option to chose. Generating moves on demand has advantage when the generation is interrupted due to cut in search.
Generating all the moves allow their sorting prior to further search. So it allows more efficient cutting.
 
So probably on bottom search level generating on demand is preferable while on higher levels generating all the moves (and their sorting) is better.
 
Generating on demand "presorted" is preferable.
IP Logged

lightvector
Forum Guru
*****



Arimaa player #2543

   


Gender: male
Posts: 197
Re: bot functions speed
« Reply #46 on: May 16th, 2011, 9:52am »
Quote Quote Modify Modify

I also copy the board, because it's easier. I don't have to track all the metadata for undoing in the presence of captured pieces.
 
Optimization of all of this stuff is fine, but as long as you're doing something "not terrible", I've found that it doesn't matter. The bottleneck for me at least is evaluation. I could do any number of different things to optimize move generation, board copying, etc, in the search, and it wouldn't make that big of a difference, since only a small fraction of the time is taken by these things, compared to evaluation.
 
Beware of premature optimization.
IP Logged
rbarreira
Forum Guru
*****



Arimaa player #1621

   


Gender: male
Posts: 605
Re: bot functions speed
« Reply #47 on: May 16th, 2011, 10:56am »
Quote Quote Modify Modify

on May 16th, 2011, 9:52am, lightvector wrote:
I also copy the board, because it's easier. I don't have to track all the metadata for undoing in the presence of captured pieces.
 
Optimization of all of this stuff is fine, but as long as you're doing something "not terrible", I've found that it doesn't matter. The bottleneck for me at least is evaluation. I could do any number of different things to optimize move generation, board copying, etc, in the search, and it wouldn't make that big of a difference, since only a small fraction of the time is taken by these things, compared to evaluation.
 
Beware of premature optimization.

 
In general you are definitely correct, but sometimes profiling the code can be deceptive. As an extreme example a program may have a piece of code which doesn't take that long to run, but which causes the whole cache to get filled with trash. The slowdown will show up in other parts of the code.
 
For this specific case on copying vs unmaking moves, originally I saw benchmarks from Robert Hyatt with his chess program which indicated that as the number of threads goes up, the unmaking approach starts to get faster. I was unable to reproduce this with my Arimaa bot, but I don't think I tested with as many threads as he did, since I usually only test it on a 6-core CPU.
IP Logged
Druzil
Forum Junior Member
**



Arimaa player #6252

   


Gender: male
Posts: 6
Re: bot functions speed
« Reply #48 on: May 16th, 2011, 7:09pm »
Quote Quote Modify Modify

JimmSlimm how are you accessing so much memory with C#.  Even with x64 CPU and x64 OS the maximum memory available is ~8.7GB
IP Logged
JimmSlimm
Forum Guru
*****




Arimaa player #6348

   


Gender: male
Posts: 86
Re: bot functions speed
« Reply #49 on: May 17th, 2011, 6:44am »
Quote Quote Modify Modify

on May 16th, 2011, 7:09pm, Druzil wrote:
JimmSlimm how are you accessing so much memory with C#.  Even with x64 CPU and x64 OS the maximum memory available is ~8.7GB

 
I don't know, task manager sais >10gb is used by the bot process sometimes
IP Logged
Swynndla
Forum Guru
*****



Arimaa player #1821

   


Posts: 235
Re: bot functions speed
« Reply #50 on: May 18th, 2011, 9:16pm »
Quote Quote Modify Modify

on May 16th, 2011, 9:52am, lightvector wrote:
Optimization of all of this stuff is fine, but as long as you're doing something "not terrible", I've found that it doesn't matter. The bottleneck for me at least is evaluation. I could do any number of different things to optimize move generation, board copying, etc, in the search, and it wouldn't make that big of a difference, since only a small fraction of the time is taken by these things, compared to evaluation.

I like what you say.  Please keep up the clear, logical & to-the-point posts!  (I'm learning a lot.)
 
Will you be making Sharp 2012 multi-threaded (to take advantage of the multiple cores), or will you be concentrating on evaluation & pruning?
« Last Edit: May 18th, 2011, 9:18pm by Swynndla » IP Logged
Pages: 1 2 3 4  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.