gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] nando_3_9.4


From: Portela Fernand
Subject: [gnugo-devel] nando_3_9.4
Date: Mon, 16 Sep 2002 02:34:08 +0200

Purpose:

  This patch extends the OWL code so that it becomes aware of tactical
  gains and losses while trying to attack or defend a dragon.

Changelog:

- added 2 new move reasons
    OWL_ATTACK_MOVE_GAIN
    OWL_DEFENSE_MOVE_LOSS
  The associated .what field references the biggest affected _worm_
- added 2 new fields in the dragon_data structure :
    int owl_attack_kworm;
    int owl_defense_kworm;
  which account for the (k)illed worm in case of GAIN/LOSS
  attack/defense codes
- renamed MAX_WORMS to MAX_GOAL_WORMS in owl.c to prevent confusion with
  the definition of MAX_WORMS in move_reasons.h and resurrected the
  catalog_goal() function in owl.c
- added supporting code in :
    too many places to list, see patch
- both cache mechanisms have been adapted :
  * the field move2 is used to store the worm information in the OWL
    persistent cache for the OWL_ATTACK and OWL_DEFEND codes.
    A bit ugly...
  * the field result2 is used in the read_result structure to store the
    index in the worm list. Only 4 bits are used, which means, only 15
    max worms are tracked by this mechanism.

Observations:

- It should always be possible to verify that the added code doesn't break
  the previous comportement of the engine, simply by deactivating the
  small portion of code in do_owl_attack() which triggers the rest of the
  chain. I did so and noticed no changes in the regressions.
- I'm not too sure if I coded correctly the moves valuations, but it
  doesn't look too bad at first. Needs probably some tuning though.
  For instance, D4 in blunder:12 is 15 points worth, not 11 like
  currently reported.

Breakage: 3 PASSes, no FAILs

---- File [blunder.tst]
12 PASSED
20 PASSED
---- File [trevor.tst]
290 PASSED

 Btw, something weird here about nngs2:40. When running the regressions,
 gnugo still returns the wrong move K18, while if run directly as
   gnugo -l games/nngs/Jion-gnugo-3.3.2-200205241928.sgf \
    -L 158 -t -w -d0x101800
 it returns N17 instead.

TODOs:

 Many are noted in the patch code itself as FIXMEs.

 The new macros READ_RETURN2 in cache.h might need to be a bit reworked

 There are still a lot of places where the owl return codes are only
 checked against LOSE or WIN. It might be interesting to review them to
 see whether the new codes could be used efficiently. For instance, by
 tuning owl_confirm_safety() and its single calling function, I was able
 to solve trevor:290 properly.

 Something to keep in mind : the attack/defense codes ordering (LOSE,
 KO_B, LOSS, GAIN, KO_B, WIN), will naturally give a "color" to the
 engine behavior : for instance, it will prefer a garanted life with
 sacrifice (of any size) over a disavantageous ko. This issue needs to be
 addressed, but I think there's no urgence yet.


I could do some more code tweaking and bug hunting (for instance, try to
get back all the PASSes I've mentioned in an earlier post), but I think
that it's time to submit the patch for review, since it seems stable
enough now and implements about all the ideas expressed here on this topic. 


/nando

PS: Arend, finally yes, it clashes a bit with your patch, but it
    shouldn't be hard to solve (just add a NULL parameter for now)

Attachment: nando_3_9.4.diff
Description: Binary data


reply via email to

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