Author: Dave Gomboc
Date: 22:44:59 12/31/02
Go up one level in this thread
On January 01, 2003 at 01:03:14, Robert Hyatt wrote: >On December 31, 2002 at 23:03:03, Dave Gomboc wrote: > >>On December 31, 2002 at 20:32:28, Uri Blass wrote: >> >>>On December 31, 2002 at 19:50:43, Robert Hyatt wrote: >>> >>>>On December 31, 2002 at 17:49:52, Uri Blass wrote: >>>> >>>>>From Ed programmer stuff >>>>> >>>>>Killer-One [current ply] 110 >>>>>Killer-One [current ply-2] 108 >>>>>Killer-Two [current ply] 106 >>>>>Killer-Two [current ply-2] 104 >>>>> >>>>>I until today used only >>>>> >>>>>Killer-One [current ply] >>>>>Killer-Two [current ply] >>>>> >>>>>I am interested to know if using 4 killers is a new idea or maybe this idea is >>>>>known to be used by other programs. >>>> >>>>It was known in 1975. Chess 4.0 used this. You can find it mentioned in >>>>the chess 4.7 chapter of "Chess Skill in Man and Machine." >>>> >>>>We did that in Cray Blitz, but we also did more killers, going back to the >>>>root in fact... >>>> >>>> >>>> >>>>> >>>>>I did try part of the idea that Ed suggested without clear results. >>>>> >>>>>I changed the order of moves in movei to >>>>> >>>>>Killer-One [current ply] >>>>>Killer-One [current ply-2] >>>>>Killer-Two [current ply] >>>>> >>>>>instead of >>>>> >>>>>Killer-One [current ply] >>>>>Killer-Two [current ply] >>>>> >>>>>I found that it is better only in part of the cases and have not clear results >>>>>if it is better or worse than previous order but I had a bug in the >>>>>implementation and I checked killer[ply-2] even in cases when ply-2<0. >>>>> >>>>>It is surprising that the program did not crush and even performed better in >>>>>part of the cases. >>>>> >>>>>I still do not use check bound software. >>>>>I asked in a previous discussion about checking bounds but I solved the >>>>>problem that caused me to ask about it and I also read a claim that if a >>>>>varaible is out of bound the program should crush. >>>>> >>>>>I also looked for a software that will help me under visual C++ but after I >>>>>asked to get it for free evaluation and I only got an email that suggest me to >>>>>contact them by fax or telephone I did not respond(I responded by email but my >>>>>email was blocked for some reason and I decided that the subject is probably not >>>>>very important). >>>>> >>>>>I think now that it may be important because a chess program may even play well >>>>>inspite of the fact that it calls killer[-1] so it is possible that I have more >>>>>mistakes like that. >>>>> >>>> >>>>That probably won't hurt a thing. That move probably would not pass your >>>>legality check, so even a garbage move would just waste a tiny bit of time >>>>as you notice it is not legal in the current position. >>> >>>Yes but I can still imagine problems. >>> >>>1)If I am unlucky a garbage move may be legal so it can be counterproductive. >>> >>>2)I thought that garbage may do something worse than giving a random >>>number. >>>I thought that if my program try to look at some place that does not exist the >>>program may crush and not give me a random number or may change another array. >>> >>>I also cared not to have -1 >>> A[x]=1; and not >>>if (x>=0) >>>A[x]=1; >>> >>>If you are right then it means that there are cases when I can save time by >>>doing something like >>> >>>A[x]=1; instead of >>>if (x>=0) >>>A[x]=1; >>> >>>The point is that if I understand correctly then I understand from your post >>>that a[x]=1 when x=-1 can not change relevant information. >>> >>>If I assume that the condition x>=0 happen in most of the cases then it seems >>>clear that A[x]=1 is faster. >>> >>>Uri >> >>Referencing A[-1] will likely give you intermittent problems that are hard to >>track down. If you really think you can't afford the check, though, then do >>something like this (C++ code below:) >> >>int PADDED_A[102]; >>... >>const int & A = PADDED_A+2; >> >>Now you can reference A[i] where i is an int in the range -2 to 99 without >>trashing memory that doesn't belong to you. AFAIK this hack technically invokes >>undefined behaviour, but it's safer than not having the padding at all, where >>you might change the value of another variable by accident. Personally, I'd >>just test for the condition. >> >>Dave > > >I assume you mean const int *A = PADDED_A + 2; > >:) Yep, whoops. :-) Dave
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.