[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnugo-devel] influence speed exactness tradeoff
From: |
Arend Bayer |
Subject: |
[gnugo-devel] influence speed exactness tradeoff |
Date: |
Tue, 25 Jun 2002 01:33:40 +0200 (CEST) |
I'd like to post the patch below for discussion. It reduces the depth
values by 1 during the influence computations. This saves 5% of reading
nodes in strategy3.tst, and also appr. 5% of time for the full
regression run (this is not exact).
The breakage is 3 PASSes and 3 FAILs. trevorb:620 is the only bad fail.
The problem with nicklas4:1201 is hardly related and it's mostly luck it
passed before. G12 in trevorc:890 is absolutely playable.
I am not sure whether this is a good tradeoff. Opinions?
Anyway, it shows that the influence computations consumes too many
reading nodes, maybe we should do some pattern profiling and fix the
expensive patterns. Also, we should check that the persistent reading
cache is big enough to store all expensive reading calls used in the
territorial influence computation, as they can get reused for all move
evaluations.
I will probably also try out two more exactness-speed tradeoffs, to make
owl and influence reading calls less expensive:
* disable all (including legal) ko captures (as all the helper
functions do not even test for ko results, this seems a reasonable
thing to do).
* disable passes (which are used, though somewhat hidden, for the
defender) in the reading code -- this will be more convenient to try
after a little more reading.c clean-up.
Arend
./regress.sh . trevorb.tst
620 unexpected FAIL: Correct '!J10', got 'J10'
./regress.sh . strategy2.tst
73 unexpected PASS!
./regress.sh . nicklas4.tst
1201 unexpected FAIL: Correct 'Q9', got 'S7'
./regress.sh . trevor.tst
380 unexpected PASS!
./regress.sh . trevorc.tst
890 unexpected FAIL: Correct 'J10', got 'G12'
./regress.sh . 13x13.tst
65 unexpected PASS!
- reduce reading depth values for influence helper functions
Index: engine/influence.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v
retrieving revision 1.57
diff -u -r1.57 influence.c
--- engine/influence.c 19 Jun 2002 22:30:04 -0000 1.57
+++ engine/influence.c 24 Jun 2002 23:01:30 -0000
@@ -1566,6 +1566,8 @@
initial_opposite_influence.dragons_known = dragons_known;
initial_opposite_influence.is_territorial_influence = dragons_known;
+ decrease_depth_values();
+
compute_influence(&initial_influence, OTHER_COLOR(color), -1, -1,
NULL, NULL);
if (dragons_known) {
@@ -1586,6 +1588,8 @@
delta_territory_cache[POS(i, j)] = NOT_COMPUTED;
followup_territory_cache[POS(i, j)] = NOT_COMPUTED;
}
+
+ increase_depth_values();
}
/* Redo the segmentation of the initial influence. */
@@ -1697,11 +1701,9 @@
move_influence.is_territorial_influence = 1;
if (tryko(POS(m, n), color, "compute_move_influence", EMPTY, NO_MOVE)) {
- increase_depth_values();
compute_influence(&move_influence, OTHER_COLOR(color), m, n,
NULL, saved_stones);
compute_followup_influence(m, n, color, saved_stones);
- decrease_depth_values();
popgo();
if (m == debug_influence_i
@@ -1781,8 +1783,10 @@
escape_influence.is_territorial_influence = 0;
escape_influence.dragons_known = dragons_known;
+ decrease_depth_values();
compute_influence(&escape_influence, OTHER_COLOR(color), -1, -1,
goal, NULL);
+ increase_depth_values();
for (i = 0; i < board_size; i++)
for (j = 0; j < board_size; j++) {
- [gnugo-devel] influence speed exactness tradeoff,
Arend Bayer <=