aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2026-09-11 12:56:12 +0100
committertslil <tslil@posteo.de>2026-09-11 17:00:18 +0100
commit6e90f1145b2c5c0f2dcc82d21ec45432274b8cad (patch)
tree18db1c03ea7c3c4724028fc5154d4bca3d7200a5 /Makefile
parent220a4b79e4b6d742a9ca7c278a1962b870500fbc (diff)
move from single candidate td-leaf with gating to tournament of a population
The goal in this change was to overcome the rock-paper-scissors phenomenon that was happening in capability space by having on a single candidate learn to beat the most recent version of itself. In some sense this lead to rotating around in capability space instead of chasing monotonic improvements. I hope that flipping to a system in which many (N=5) candidates play each other and learn from their own set of diverse games in this pool, combined with --replay-iters, will lead to a given network having to have a much more comprehensive understanding of the space of tactics. I haven't yet had time to train this thorougly, will run those experiments on my desktop computer.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 0060fb9..623b382 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ NATIVE_FLAGS=-march=native
CTAK=include/tak.c
CTAK_OBJS=$(CTAK:.c=.o)
-CAND_SRCS=include/cand_weights_5.c include/cand_weights_6.c
+CAND_SRCS=$(wildcard include/cand_*.c)
SRCS=$(filter-out include/lcdlib.c $(CAND_SRCS),$(wildcard include/*.c))
OBJS=$(SRCS:.c=.o)
@@ -27,24 +27,31 @@ cttei: src/cttei.o $(OBJS)
$(CC) $(CFLAGS) src/cttei.o $(OBJS) -o cttei
clean:
- rm -f ctlm ct1986 cttei pptdb geminict selfplay match
+ rm -f ctlm ct1986 cttei pptdb geminict
rm -f src/*.o include/*.o
native: CFLAGS += $(NATIVE_FLAGS)
native: ctlm cttei geminict
-.PHONY: selfplay
-selfplay:
+cand_a = $(word 1,$(subst -, ,$1))
+cand_b = $(word 2,$(subst -, ,$1))
+
+.PHONY: selfplay-%
+selfplay-%:
+ rm -f selfplay-%
$(MAKE) clean
- $(MAKE) DEFINES=-DRECORD_PV selfplay-bin
+ $(MAKE) SELFPLAY_OUT=$@ \
+ DEFINES="-DRECORD_PV -DCAND_A=$(call cand_a,$*) -DCAND_B=$(call cand_b,$*) \
+ -DCAND_A_WEIGHTS_5='\"cand_$(call cand_a,$*)_weights_5.c\"' \
+ -DCAND_B_WEIGHTS_5='\"cand_$(call cand_b,$*)_weights_5.c\"' \
+ -DCAND_A_WEIGHTS_6='\"cand_$(call cand_a,$*)_weights_6.c\"' \
+ -DCAND_B_WEIGHTS_6='\"cand_$(call cand_b,$*)_weights_6.c\"'" \
+ selfplay-bin
+SELFPLAY_OUT ?= selfplay
selfplay-bin: CFLAGS += $(NATIVE_FLAGS)
selfplay-bin: src/selfplay.o $(OBJS)
- $(CC) $(CFLAGS) src/selfplay.o $(OBJS) -o selfplay
-
-match: CFLAGS += $(NATIVE_FLAGS)
-match: src/match.o $(OBJS)
- $(CC) $(CFLAGS) src/match.o $(OBJS) -o match
+ $(CC) $(CFLAGS) src/selfplay.o $(OBJS) -o $(SELFPLAY_OUT)
$(CROSS_CC):
./resources/do_buildroot.sh $(BUILDROOT_DIR)