Author: Gerd Isenberg
Date: 14:10:22 06/25/04
Go up one level in this thread
On June 25, 2004 at 16:39:01, Dieter Buerssner wrote: >On June 25, 2004 at 15:03:21, Gerd Isenberg wrote: > >>http://chessprogramming.org/cccsearch/ccc.php?art_id=357556 >>http://chessprogramming.org/cccsearch/ccc.php?art_id=357568 > >Thanks Gerd. I think I understood now. > >>So it really seems negligible for "huge" search functions. >> >>Maybe my "bad" expirience has other sources by sideeffect or whatever. >>But nowadays i often use [ply-1] or [ply-2] and more a lot and prefere external >>arrays of nodes. One may simply use threadsafe preallocated external stacks too, >>eg. as member of a search thread object. > >I of course agree, that arrays where you have to access info not only from the >current node, must be some sort of global. I had in mind the best line, which I >use as a local array. Same for generated moves. > >int search(... bestline[]) >{ > local_bestline[]; > generated_moves[]; > gen_moves(generated_moves); > /* recursive calls */ > search(local_bestline) > /* And update bestline, when needed */ >} > >instead of having something like a global > >bestline[MAXPLY][MAXPLY]. > >and an expicit move stack. At least in my engine, I don't need access to the >list of generated moves from another recursion level. The generated_moves array >might come close to the 4 kB (for me 8 bytes per move), local_bestline for me is >256 bytes, other local vars in search will hardly matter. > >Cheers, >Dieter I see, interesting. OTOH the generated_moves[] array "allocates" always about 4K on the stack frame per search/qsearch call. If only a few captures, or even no move at leaf nodes are generated, or if you generate not all at once, the whole array is a kind of "wasted" stack ressource. If you call eval at some leaves, you often have nply gaps inside your valuable fast stack - nply pages. How deep do you search pawn endings? IMHO, saving some index or two per node (nextget, nextput), accessing an one dimensional stack like array seems more ressource friendly to me, specially if you don't generate all moves at once. I guess that safes some 4K pages, may be not important if you have enough. But i like to waste it elsewere ;-) Cheers, Gerd
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.