aboutsummaryrefslogtreecommitdiff
path: root/plans.org
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-11-09 16:17:04 +1300
committerDylan <boss@tehbox.org>2026-11-09 16:17:04 +1300
commit0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c (patch)
treeeb926ba3fbc0dcde9717509e9fa02cc79a3679f9 /plans.org
parent046969c820e89b74d55c2d07c47470237f11cc2a (diff)
downloadtigers-and-sheep-0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c.tar.gz
tigers-and-sheep-0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c.zip
feat: Draw by threefold repetition
A position coming up for the third time with the same side to move ends the game as a draw, in the TUI and in training self-play. Players now get the game's earlier boards in pick_move, and the search scores the first repetition on its path as a draw, so a side that is ahead avoids one and a side that is behind seeks one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'plans.org')
-rw-r--r--plans.org14
1 files changed, 14 insertions, 0 deletions
diff --git a/plans.org b/plans.org
index 8f53255..b54040b 100644
--- a/plans.org
+++ b/plans.org
@@ -50,6 +50,20 @@ source, so the times are only comparable with each other; moves and scores uncha
- =evaluate=: tiger moves and trapped tigers from bitmasks rather than =get_moves= + 25 =get()= calls
- Table lookups are now the top item (~28% of cycles), mostly cache misses into the 24 MB table
* Draws
+** DONE Threefold repetition
+The game is drawn on the third occurrence of a position. The search scores the first repetition
+on its path (game history plus search line) as 0. =bench 9= (hpet clocksource), before -> after:
+| Position | Move | Score | Time ms | Repetitions |
+|------------------+-------------+-----------+-------------+-------------|
+| opening | sc5 | 40 | 160 -> 161 | 0 |
+| tiger reply | ta1b2 | 50 | 230 -> 232 | 0 |
+| mid-placement | se2 | 22 | 92 -> 97 | 0 |
+| end of placement | sc4 -> sc3 | 91 -> 77 | 5 -> 7 | 19 |
+| early movement | td2c3 | 212 | 40 -> 41 | 102 |
+| movement | sc4d4 | 214 | 58 -> 60 | 421 |
+| total | | | 584 -> 598 | |
+- About 2% slower overall, from scanning the path at every node.
+- The cache ignores the path, so scores near repetitions can be slightly off (graph-history interaction).
* Neural player training
** DONE Tiger bias in self-play
Before the fix, tigers won ~97% of self-play games and the net only reached ~15-20% against