Author: Uri Blass
Date: 08:20:59 12/11/03
Go up one level in this thread
On December 11, 2003 at 08:29:08, Robert Hyatt wrote: >On December 11, 2003 at 06:44:06, Uri Blass wrote: > >>I deciding that I probably need to rewrite my alphabeta function to make changes >>in the search easier to do. >> >>some questions about it: >> >>1)When do you calculate extensions > >Inside the loop where I choose and make a move and then recursively >call search. That is where I notice that the move is the only legal >move, or the move checks the opponent, or pushes a passed pawn, etc. > > >>Today I call alphabeta immediately after makemove and alphabeta calculate the >>extensions(I think it should be done before it). >> >>2)Another thing that I need to change is the way that I calculate extensions and >>today they are calculated in 2 varaibles when one of them is the partial >>extensions and it may be better to have one varaible. > > > >I just use one and pass it down... it is in units of 1/60th of a ply. > > >> >>3)Another thing that I consider to change is my sort function. >> >>Mine is similiar to tscp and get the number of move in the stack as a parameter >>and I remember from a post of Tord that he simply has a function to pick moves >>that does not get varaibles. >> >>Even without changing this structure I suspect that my replace between moves is >>not efficient >> >>Here is the start of my sort function. >> >>void sort(int from) >>{ >> int i=0; >> int bs; /* best score */ >> int bi; /* best i */ >> gen_t g; >> bi=from; >> switch (phase[ply]) >> { >> case pvnode: >> { >> follow_pv = 0; >> phase[ply]=goodcapture; >> for(i = first_move[ply]; i < first_move[ply + 1]; ++i) >> if (gen_dat[i].m.u == pv[0][ply].u) >> { >> follow_pv = 1; >> g = gen_dat[first_move[ply]]; >> gen_dat[first_move[ply]] = gen_dat[i]; >> gen_dat[i] = g; >> break; >> } >> if (follow_pv) >> break; >> } >> >> > > >Why not stop the "follow PV" logic completely, and before you start >an iteration, make sure that the PV moves are in the hash table. Then >the "hash move first" will take care of this case and you don't have >to handle it separately. You are right. Today I do hash move first after probehash in the following ugly way if (besthashmove.u!=nullmove.u&&(follow_pv==0)) { while (i<first_move[ply+1]) if (gen_dat[i].m.u==besthashmove.u) { g = gen_dat[first_move[ply]]; gen_dat[first_move[ply]] = gen_dat[i]; gen_dat[i] = g; phase[ply]=goodcapture; i=99999; } else i++; } > > > >>first: >>I can do it faster by noticing that the move is illegal in part of the cases >>but it is not very important because the case of pvnode is clearly rare. >> >>I think that what I do is not efficient because when I use switch command, I >>should not start with something rare and case pvnode is clearly something rare >>but I do not know exactly how to change it at this moment to something more >>efficient. >> >>Another point is how to replace between 2 unions in an efficient way because my >>move is a union between struct of 4 chars and int. > >Just assign the unions like a normal variable or structure... I see that you are right but it is not so simple because I did a mistake in understanding my code. Practically I do not replace only moves and I replace struct that have the move and 2 integers that are scores for move ordering when one of them is score to order good captures and another one is score to order quiet moves. It is possible that it may be better to calculate scores for move ordering only if the hash move fails low. you can claim also that I do not need to generate all moves together but it is not something that I plan to change in the near future and at least today I use the number of moves for my mobility evaluation and I use my evaluation to decide about things like pruning (I am sure that there are better ways to calculate mobility but I think to start with fixing my alpha beta and not with fixing that problem). Today my evaluation except mobility is calculated inside make move and my mobility is calculated inside the part that generates the legal moves. Uri
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.