gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] Semeai


From: Gunnar Farneback
Subject: Re: [gnugo-devel] Semeai
Date: Sat, 26 Jan 2002 19:51:33 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Dan wrote:
> I put up the revised (noncrashing) version of my patch
> at devel.html. But I suppose it will need to be revised
> again using your hashing patch.

Yes, the following revisions are needed:

> diff -u -r1.6 cache.h
> --- engine/cache.h      11 Oct 2001 15:39:37 -0000      1.6
> +++ engine/cache.h      26 Jan 2002 15:31:46 -0000
> @@ -94,12 +94,18 @@
>  /* Get parts of a Read_result constituting the result of a search. */
>  #define rr_get_status(rr)      (((rr).result_ri_rj >> 24) & 0xff)
>  #define rr_get_result(rr)      (((rr).result_ri_rj >> 16) & 0xff)
> +#define rr_get_resulta(rr)      (((rr).result_ri_rj >> 16) & 0x0f)
> +#define rr_get_resultb(rr)      (((rr).result_ri_rj >> 20) & 0x0f)

Skip this. My patch has already implemented corresponding
functionality, but called result1 and result2. You might want to
change those to be called resulta and resultb if you think that's
better, otherwise revise the macro names used in owl.c.

>  #define rr_get_move(rr)        (((rr).result_ri_rj >>  0) & 0xffff)
>  
>  /* Set corresponding parts. */
>  #define rr_set_result_ri_rj(rr, result, move) \
>         (rr).result_ri_rj \
>             = (2 << 24 | (((result) & 0xff) << 16) | ((move) & 0xffff))
> +#define rr_set_resulta_resultb_ri_rj(rr, resulta, resultb, move) \
> +       (rr).result_ri_rj \
> +           = (2 << 24 | (((resulta) & 0x0f) << 16) | \
> +                         (((resultb) & 0x0f) << 20) | ((move) & 0xffff))

Skip this too.

>  /*
>   * The hash table consists of hash nodes.  Each hash node consists of
> @@ -243,6 +249,15 @@
>      return (value); \
>    } while (0)
>  
> +#define READ_RETURN_SEMEAI(read_result, point, move, value_a, value_b) \
> +  do { \
> +    if ((value_a) != 0 && (point) != 0) *(point) = (move); \

Not related to my patch, but why is only value_a tested here?

> +    if (read_result) { \
> +      rr_set_resulta_resultb_ri_rj(*(read_result), (value_a), (value_b), 
> (move)); \

Change to rr_set_result_move2().

> +    } \
> +    return; \
> +  } while (0)
> +
>  #else
>  
>  #define READ_RETURN0(read_result) \
> @@ -267,6 +282,18 @@
>      return (value); \
>    } while (0)
>  
> +#define READ_RETURN_SEMEAI(read_result, point, move, value_a, value_b) \
> +  do { \
> +    if ((value) != 0 && (point) != 0) *(point) = (move); \
> +    if (read_result) { \
> +      rr_set_result_ri_rj(*(read_result), (value_a), (value_b), (move)); \

This should also be rr_set_result_move2().

> +    } \
> +    gprintf("%o%s %1m %d %d %d %d ", read_function_name, q, stackp, \
> +           (value_a), (value_b), (move)); \
> +    dump_stack(); \
> +    return (value); \
> +  } while (0)
> +
>  #endif
>    

It's also necessary to remove the calls to rr_set_compressed_data() in
owl.c. As discussed in my previous message those were redundant anyway.

To make use of the two-group functionality requires a little more
work. Either revise get_read_result() to take two groups and change
all calls, or implement a variation get_read_result2() for this
purpose. The underlying do_get_read_result() is already sufficiently
general.

I've added gunnar_1_23.4 to CVS. Up to dniwog.tst no problems occured.

/Gunnar



reply via email to

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