gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] NNGS crash


From: Arend Bayer
Subject: Re: [gnugo-devel] NNGS crash
Date: Fri, 1 Nov 2002 15:03:31 -0500 (EST)

Evan wrote:

> On Fri, 1 Nov 2002, I wrote:
>
> > Attached is a simple fix.
> >
> > There is a comment that says that in some rare cases, do_atari_atari finds
> > an attack but no defense, and that we assume the attack is illusory.  This
> > is one of them.  However, we only check for this after the first time we
> > call the function, and then we call it again with different depth
> > settings.  This patch adds the check there.
>
> Oops, wrong explanation.  That could be going on, but isn't here.  The
> check wasn't made after calling do_atari_atari again to try removing moves
> from the combination.
>
> I believe the check is in the right place, and that the original patch is
> correct.

I agree with both your explanation and the fix, but I think the fix below
is a little more precise. What happens in the game position is that GNU Go
finds a atari attack at D5 (capturing G5). After D5 is forbidden
if finds a atari attack at T5 on R5 with no defense, which should hence be
ignored. (This heuristic is actually incorrect here, but I think this is
irrelevant for the discussion.)

This bogus attack at T5 should not cause us to ignore the attack at D5.
This is what the patch below does.

Arend


Index: engine/combination.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/combination.c,v
retrieving revision 1.38
diff -u -r1.38 combination.c
--- engine/combination.c        20 Oct 2002 10:40:45 -0000      1.38
+++ engine/combination.c        1 Nov 2002 18:01:25 -0000
@@ -396,20 +396,20 @@

   if (aa_val == 0 || defense_point == NO_MOVE) {

-  /* No sufficiently large combination attack, so the move is safe from
-   * this danger.
-   *
-   * On rare occasions do_atari_atari might find a combination
-   * but no defense. In this case we assume that the combination
-   * is illusory.
-   */
+    /* No sufficiently large combination attack, so the move is safe from
+     * this danger.
+     *
+     * On rare occasions do_atari_atari might find a combination
+     * but no defense. In this case we assume that the combination
+     * is illusory.
+     */

     popgo();
     decrease_depth_values();
     return 0;
   }

-  while (aa_val >= after_aa_val) {
+  while (aa_val >= after_aa_val && defense_point != NO_MOVE) {
     /* Try dropping moves from the combination and see if it still
      * works. What we really want is to get the proper defense move
      * into (*defense).






reply via email to

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