Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: incremental attack tables?

Author: Uri Blass

Date: 02:50:02 05/05/04

Go up one level in this thread


On May 05, 2004 at 05:32:10, Tony Werten wrote:

>On May 05, 2004 at 05:22:54, Daniel Shawul wrote:
>
>>On May 05, 2004 at 05:16:49, Uri Blass wrote:
>>
>>>On May 05, 2004 at 05:06:43, Daniel Shawul wrote:
>>>
>>>>On May 05, 2004 at 05:01:55, Uri Blass wrote:
>>>>
>>>>>On May 05, 2004 at 04:40:43, Andrew Williams wrote:
>>>>>
>>>>>>On May 05, 2004 at 03:03:15, Daniel Shawul wrote:
>>>>>>
>>>>>>>Hello
>>>>>>>
>>>>>>>Is incremental attack table slower than creating them on fly?
>>>>>>>I have both versions working properly right now but the incremental
>>>>>>>one further drops NPS by 30% , though InCheck and Checks are for free in this
>>>>>>>case. Anybody have similar experience? I am sure i have made no mistake in
>>>>>>>updating because i checked it with the known perft positions and node count is
>>>>>>>perfect.
>>>>>>>
>>>>>>>best
>>>>>>>daniel
>>>>>>
>>>>>>It's a very long time since I implemented them, but at the time I compared the
>>>>>>incremental ones were faster. I can't remember exactly how much faster it was,
>>>>>>but I think it was of the order of 10 to 15%, if only because that is what a
>>>>>>comment in an old source file says. What I don't know is if this was *after*
>>>>>>thorough debugging.
>>>>>>
>>>>>>Andrew
>>>>>
>>>>>I have different attack tables.
>>>>>
>>>>>Last time that I implemented incremental tables was a long time ago before I had
>>>>>a chess program.
>>>>>
>>>>>I did not make notes to see  how much faster it was but it was more than being
>>>>>1000% faster in calculating perft.
>>>>>
>>>>>Uri
>>>>
>>>>How can incrementally updating attack tables make perft faster?
>>>
>>>I need the attack tables to generate legal moves.
>>>
>>>I have a function that generates the legal moves and it is dependent on the
>>>tables.
>>>
>>>My tables tell me if a square is attacked by the opponent so I do not generate
>>>moves that put the king in check.
>>
>>   First you update the attack table with the move and then you generate only
>>legal moves based on the attack tables , right? What i do is update the attack
>>table and then generate "pseudo legal" moves,except king moves to an attacked
>>square. So our difference is you have a routine which calculates only legal
>>moves based on your attack tables. I don't see how that can speed up perft
>>immensely.
>
>At the last ply you don't do make_move but just count the moves since you
>already know they're legal.
>
>Tony

It is the reason that movei is faster than other programs in calculating perft
but movei always used that method to calculate perft so one of the reasons that
I got a big speed improvement from incremental update relative to my first
version is simply the fact that I changed it to do the update of the attack
tables incrementally.

There are other factors that helped me to calculate perft faster relative to
the initial version that I had like piece list that I had not in my initial
code.

It is hard to know exactly the speed improvement that is only thanks to
incremental update (because I did not change to incremental update in one step
and I did a lot of changes that caused speed improvements) but I estimate it as
more than 1000% speed improvement thanks to incremental update.

I remember times when movei was more than 100 times slower than it is today in
calculating perft at that time I cared only about making it faster and not about
writing a chess program.

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.