Ok, in that tone, I would agree but would only ask why you are talking about yourself here?hgm wrote:This policy apparrently also applies to what people post here...bob wrote:OK. I did not look at his code and generally do not look at code of others due to a lack of time.
Then explain it in a way that is theoretically sound. Moving a piece that is absolutely pinned is rare. Because absolute pins themselves are rare. So which is more efficient, to discover later that the piece was pinned and spend a little extra time doing this, or spending a little extra time on _every_ move to determine the same thing?... as it was clearly explained above that it actually saves a lot of time, and that it is the generation of such illegal moves that is a big time waster.If he generates legal moves that's fine. Sounds like a waste of time, but that's a different matter.
Make the common case fast...
Are you reading what people are doing? they are _not_ doing what they normally do in their engines. Not updating hash signature in Make/Unmake. Hashing move counts which is not used anywhere in the tree search. Etc. So how is _that_ reflective of the actual gen/make/unmake overhead? Why not just measure it as it really is?Not redefine. Just implement it better. They want to test the performance of their engine, and thus they do the performance test to mimic the behavior of their engine as closely as possible. But it is still a performance test, as it fulfills exactly the functions you defined.Sorry, but you don't get to redefine something _I_ defined first. Perft was designed with two goals. (1) enumerate a tree of legal moves to a fixed depth; (2) test performance (hence the name "perf from performance, and t from time) by measuring move generation and make/unmake speed. Full make/unmake, whatever it is you do in your actual program is what was intended to be done here.
You only have to look at the speed differences to figure out they are _not_ testing it in the same way...Unless, of course, the programs that are being compared are doing it the same way. Then it doesn't matter so much which way this is.bob wrote:Fine. But let me _again_ point out. "perft". "performance test". Originally defined in Cray Blitz, and then in Crafty in 1995. It was originally used after Crafty was originally released, as a way for others to (a) test move generator for correctness (it is easy to screw up en passant captures, promotions, etc) and (b) a way to measure the speed of the move generator and make/unmake code which also tests the data structures for efficiency as well.
Comparing two programs that do the computations differently is useless when time is measured... Yet everyone is doing that and it is wrong.
The real engine spends a small part of its time generating and making/unmaking moves. It also does a real tree search, with extensions, reductions, evaluations, etc. perft has _none_ of that. So the perft numbers have zero to do with how the overall engine performs. Particularly when the perft algorithm is further hacked up to be as fast as possible, without regard to how the engine itself does the same tasks...
Everyone is well aware of this, and this is why we always report if we are making the last ply, hashing counts, classifying moves, detecting checks...
How do you know there are none generated to make? Wouldn't that be by running your move generator? I was under the impression that Crafty would not search bad captures in end leaves. So you must generate the captures, in order to subject them to see, and then _not_ make them...Eh? Why don't you make/unmake moves in the last ply? I do, unless there are none generated to make...hgm wrote:
And, like I said, engines usually don't make the moves they generate in the end-leaves either. So for timing an engine under construction, Make / UnMake of the last ply would invite you to make completely wrong and counterproductive 'optimizations'.
They are both tree walks. So "nothing" must be a relative notion here...bob wrote: Again I don't follow. Perft has _nothing_ to do with an alpha/beta search.
So extensions take no time? My evaluation takes more than 50% of the total search time as measured by profile runs. That is "no time"?None of the tasks you mention takes significant time. Except the hashing, but as you must have figured by now we already did this in the perft we were comparing with. And, knowing how much you value purity of the terms used, most of them really don't have anything to do with alpha-beta.There are no cutoffs. No evaluations. no extensions. No hashing. No repetitions. No 50-move rule and other drawing conditions. My move generation and make/unmake generally take less than 15% of the total search time when profiled... So the speed of perft doesn't even relate to the speed of the chess engine.
Please get serious. The only reason perft was even timed in the first place was to let us quantify the differences in various approaches to generate moves and represent the board. Rotated bitmaps, for example, have extra make/unmake overhead that a non-rotated bitboard program doesn't have. But optimizing perft itself is pointless. It has no use in and of itself.