Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: reuse Last Ply Moves In Move Gen ?

Author: Russell Reagan

Date: 09:36:56 04/12/02

Go up one level in this thread


On April 12, 2002 at 10:13:45, Sune Fischer wrote:

>On April 12, 2002 at 09:30:45, Uri Blass wrote:
>
>>On April 12, 2002 at 09:14:22, Oren Avraham wrote:
>>
>>>I've gone through the archive to look for a simple idea
>>>but found non:
>>>Why every ply should i generate the pseudomoves all over again, when i can
>>>"recycle" the old ones in some way or another.
>>
>>You do not have to generate the pseudomoves all over again.
>>I believe that programmers are usually not very good programmers
>>so they choose to do it because recycling
>>the old ones without bugs is too hard for them or takes
>>too much time that they prefer to invest time in other things
>>because they may get only a small speed improvement from
>>recycling the old moves.
>>
>>>If it is done somewhere: how ? (what are the 'thumb rules' to update the old
>>>moves...")
>>>
>>>10x (Thank Tou) in advance Oren. (p.s i'm an 18 years old IDIOT who makes a
>>>chess program in PROLOG...)
>>
>>I do not think that you are an idiot.
>>They are a lot of good ideas that are not used by the top
>>chess programs.
>
>I've thought about this idea too, the problems I see I haven't been able to
>solve.
>
>First of all, how will you save them, you need to back up large parts of the
>tree I think.
>Second you if you are not in exactly the same position, only some of the moves
>are valid, so you have to find some (quick) way of determaning what those are
>and just generate the remaining, it is bound to get messy.
>Third, if you do reach a similar position, then you can probably get a hash cut
>or move to try first, and often won't need to regenerate anything at all.
>
>I'm thinking more in the lines of an incremental movegenerator, still
>how to effectively remove the old bad moves and put in the new valid ones seems
>very complicated, at least the way I do things.
>
>For instance, there is no need to update a knight's moves unless a friendly
>pieces has moved from one of its attacking squares (by capture), in which case
>we should add that move to the list....
>The other pieces seems even more complicated, and I think all the hassle of
>checking if and if and if then so and so and so will just not be worth it in the
>end (or else it would be in Crafty already:).
>
>Still it is fun to ponder about the "optimal" way of doing things :)
>
>-S.

This also could be the crucial point that seperates an extremely talented
programmer from a good one, and the point that seperates a world class program
from just another chess engine.

You say that this "seems complicated" and that it's a "hassle". Of course it
would be. The research involved in finding all of the special cases alone would
be a hassle, BUT how do you think improvement comes in the world?

For example, consider the people who first wanted to implement multiprocessor
support in their chess programs. There was no clear "winning" solution to the
problem and people had to implement rather complex algorithms in some cases,
knowing that they may not even work or might work inefficiently. Would we have
been better off if they would have said, "this is going to be too hard" and
never experimented with it? Certainly not. The process from going from a single
threaded chess engine to a multithreaded engine with support for multiple
processors IS a "hassle", but that's one of the factors that determines a world
class program from just another chess engine.

If the programmer isn't willing to work hard in the first place, then they
should never expect to have anything but a below average chess program. If you
have dreams of your program being up there with Fritz and friends, then get
ready to put in hard work and overcome obstacles such as these. If you aren't
willing to work that hard at something, that's your loss, because I guarentee
that someone out there IS willing to work that hard to gain that 5% (or
whatever) advantage, and if they're willing to do the hard work this time,
they're going to be wiling to do it next time, and when they add up 5% speed
increase after 5% speed increase, a 2% increase here, a 1% speed up there, it is
all going to add up to a strong chess program.

I think the desire and wilingness to put in hard work is a major factor in
determining the success you have in any field. If you enjoy putting in the hard
work, then it's not hard work anymore and it's fun. I would bet that all of the
authors of top chess programs enjoy what they do and it brings them pleasure to
hammer out a new idea and put in the hard work.

And please excuse me if I sound like I'm talking down to you, that isn't my
intention. I just hope to bring someone to the reality that success comes from
hard work, although I approached it from a rather longwinded direction :)

Russell



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.