Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: MTD(f)

Author: Dieter Buerssner

Date: 09:25:00 06/18/05

Go up one level in this thread


Hi Vaskik,

one example, what can go wrong for fail soft.

int qsearch(int alpha, int beta)
{
  /* Fail soft version - extremly simplified */
  int best, score;
  best = eval();
  if (best > alpha)
  {
    if (best >= beta)
      return best;
    alpha = best;
  }
  for (all captures)
  {
    if (value of captured piece + margin < alpha)
      continue; /* Futile to try this move */
    makemove();
    score = -qsearch(-beta, -alpha)
    unmakemove();
    if (score > best)
    {
      best = score;
      if (best > alpha)
      {
        if (best >= beta)
          return best;
        alpha = best;
      }
    }
  }
  return best;
}

Do you spot the error immediately? To fix it, you'll need to add more lines of
code. If you forget to fix this problem, you probably won't see it easily
by inspecting the output of the program.

One has to add code to absearch and qsearch. When you do lazy eval, add score
there, too. In all places, similar things than above can happen here and there,
so one has to check very carefully.

I am not sure, we agree about the move ordering reasoning in fail-soft vs. fail
hard. But I certainly do not think, that move ordering will be significantly
better. I think, it has the potential for better move ordering. May well be,
that it gets worse in reality. If for example, it for some reason (which I would
not know) sort moves in an order, where moves that need huger trees earlier, and
those moves still would not help to get a cutoff. As you pointed out, we
typically get scores at the bounds anyway.

Cheers,
Dieter



This page took 0.01 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.