gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] atari_atari patch


From: Evan Berggren Daniel
Subject: Re: [gnugo-devel] atari_atari patch
Date: Sat, 29 Mar 2003 19:13:20 -0500 (EST)

On Sat, 29 Mar 2003, Gunnar Farneback wrote:

> > To fix this I added code to look for intermediate defensive moves for
> > tactically critical neighbor strings before continuing the attack.
> >
> > I have not run complete regressions; however, the speed penalty on
> > atari_atari.tst is relatively high, at around 12%.
>
> I'm not sure whether that translates to something substantial for
> whole games on average. It may or it may not.

My guess is that it's actually relatively small overall, but
proportionally high for the strength improvement.  I think a lot of the
speed difference comes from additional tactical reading in
atari_atari.tst, which would hopefully partly be cached in games, and also
I think the atari_atari code is a relatively small piece most of the time,
and only expensive in certain positions.

>
> > Does the patch look ok in its current form, or should I work more on it?
>
> It looks a bit too unfocused, which may explain the relatively large
> performance hit. Rather than checking blindly it may be better to keep
> track of the last defended string and only test neighbors of that,
> plus requiring that the defense is again an attack threat on the same
> string.

OK, I'll work on that.  Defending tactically critical enclosing strings
made sense to me as a general thing, but I think you're right that it will
help with speed.

>
> +    if (!ON_BOARD1(k))
> +      continue;
>
> Usually the ON_BOARD() macro is to be preferred. ON_BOARD1() contains
> an extra range check which definitely isn't needed here.
>
> +    if (board[k] != other)
> +      continue;
>
> And with this test the separate on board testing is redundant.

Oops, looks like I forgot to remove those once it worked.  Oh, is

for (k = BOARDMIN; k < BOARDMAX; k++) {
  if (k != find_origin(k))
    continue;

the recommended way to loop over all strings?


Thanks for the comments

Evan Daniel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]