Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Non recursive search(is there a free source code for doing it?)

Author: Vincent Diepeveen

Date: 11:06:03 04/11/04

Go up one level in this thread


On April 10, 2004 at 10:29:51, Dan Andersson wrote:

> There are reasons for using recursion. One of them is that the generated code
>tends to be smaller. And that could trumph any gains made from reducing the

I disagree with the first point with regards to the data used by the processor
on the stack. In my function ABISMP() which is a non recursive search using
principal variation search, i never call the function ABISMP() again. I just
call it 1 time. That reduces data overhead considerable. It's faster too.

That it is a bit more work to get it to work than recursive search i agree with.
Complex code can be very tiny though.

>data.
> Another one is decreasing complexity. And the ability to use induction to prove
>an algorithm.

Search algorithms are so complex that it is very hard to proof anything
theoretically. I'm using extensions (singular also) which are of course in fact
related to the complex evaluation function and nullmove with a quiescencesearch
which also is unlimited in fact for checks (stack limits it to 32 ply).

In short try to proof something about that. In general your proof has nothing to
do with whether it is recursive or non-recursive.

> I often use tail recursion as a goto with values. It usually doesn't incur any
>overhead. And increases branch prediction for some types of code like parsers,

Calling functions is very expensive. I do not know how low level you program but
a function call a few years ago for commercial chessprograms was too expensive.

Ask whether one of the commercial programs at the time used recursion. The
answer is NO.

>regexp and interpreters.

It's all high level stuff used to learn students how things work. Not how
reality works.

Recursion is a good tool to teach students how to do bugfree programming.

Saying it is faster than other methods is however not true. The call + ret in
assembly is very expensive.

>MvH Dan Andersson



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.