[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: unmake move?
Usually you are unmaking moves near the leafs, so the
old position is still in the cache. So memory bandwidth
is not a problem. Even if there is no cache, so copies
go to memory, Pentium PCs should be able to copy over 100 MB/s.
If the state is 1000 bytes, that limits performance to 100,000
positions per second.
For my chess program, I coded an undo function, and the copy/no undo
approach. The copy approach was faster.
David
At 10:08 AM 6/8/00 +0900, Nobuhiro Yoshimura wrote:
>Don Dailey wrote:
>
>>
>>Note that modern processors are extremely fast at copying data that is
>>layed out consecutively in memory, believe me, you can have a very
>>fast program that uses this technique.
>
>Can you aply this rule to PCs ? I thought that memory bandwidth
>is very narrow for PC.
>
>
>Can you tell me the size of "POSITION" ?
>
>>
>>
>>/* nega-max search */
>>/* --------------- */
>>
>>int search( position *state, int depth, int alpha, int beta )
>>{
>> POSITION new_state; /* allocate state */
>>
>>
>> foreach move in (0 .. number_of_moves)
>> {
>> make_move( state, &new_state, move );
>> score = -search( &new_state, depth-1, -alpha, -beta );
>>
>> /* No need to unmake!!! */
>>
>> if (score > best_found_so_far)
>> {
>> ...
>>
>> }
>>
>> }
>>
>> return( best_found_so_far );
>>
>>}
>>
>
>
>Nobuhiro Yoshimura
>
>Konami Computer Entertainment Tokyo The opinions expressed
>Office: yosimura@xxxxxxxxxxxxxxxxx here are mine and not
> Home: yoshimura@xxxxxxxxxxxxxxxxx necessarily those of Konami.
>
>