<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ctak/README.md, branch hybrid_rootstrap</title>
<subtitle>An implementation of Tak and a computer opponent in C</subtitle>
<id>https://git.l-3.space/ctak/atom/README.md?h=hybrid_rootstrap</id>
<link rel='self' href='https://git.l-3.space/ctak/atom/README.md?h=hybrid_rootstrap'/>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/'/>
<updated>2026-09-25T15:18:21Z</updated>
<entry>
<title>factor out nn_train.py into a separate python project to make it more manageable, add plotting and offline strength fit</title>
<updated>2026-09-25T15:18:21Z</updated>
<author>
<name>tslil</name>
<email>tslil@posteo.de</email>
</author>
<published>2026-09-25T13:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=61e5b8949b2f5e8973c58f0dcc7c20c4bdade029'/>
<id>urn:sha1:61e5b8949b2f5e8973c58f0dcc7c20c4bdade029</id>
<content type='text'>
</content>
</entry>
<entry>
<title>TD-leaf and another negamax bug</title>
<updated>2026-09-04T20:03:59Z</updated>
<author>
<name>tslil</name>
<email>tslil@posteo.de</email>
</author>
<published>2026-09-03T19:17:22Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=1ca3309dad9d412870b2b793f33af7a7ccabd514'/>
<id>urn:sha1:1ca3309dad9d412870b2b793f33af7a7ccabd514</id>
<content type='text'>
TD-lambda and TD-leaf are separated by the observation that minimax with a parameterised leaf heuristic is differentiable* in the parameters. "All" that had to be done was to extract the "principal variation": which one position survived all of the pruning to become the reported value.

This was a bit fiddly and uncovered a subtle bug (again) in negamax.c: we were not being complete in our overriding of the TT entry and by omitting key it was possible that later searches would find incorrect values.

The more interesting question to me was: how do we introduce enough variety while not corrupting the PV chain? I settled on having selfplay have one of the players be epsilon-random but the other greedy (minimax) and simply report only the greedy portion PV chain. This appears to work well enough in practice and doesn't introduce nonsense training data for the net (we don't force its actions to be nonsensical). I also deciced, perhaps in a departure from tradition, that we had good supervised labels for PVs that happened to be winning states, so the training overrides the targets in that case. Finally rolled back some of the ambition in nn_train.py default arguments.

*almost always
</content>
</entry>
<entry>
<title>TD(lambda), and a big rework</title>
<updated>2026-09-02T11:13:01Z</updated>
<author>
<name>tslil</name>
<email>tslil@posteo.de</email>
</author>
<published>2026-08-30T18:46:07Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=241156da6f35cb888253e6b8814e7b61a76b4fc7'/>
<id>urn:sha1:241156da6f35cb888253e6b8814e7b61a76b4fc7</id>
<content type='text'>
NOTE: 6x6 weights are as-yet untrained

On the performance side:
* switch from linked-list chaining hash table to direct mapping
* cache check_win by hash
* persist transposition tables across plies (this was a big deal and difficult to puzzle out)
* add align directives to the network floats
* prepare_nn_input gained a small LUT to avoid branching (i suppose you might call this 1D embedding)
* apply mtune=native for the native builds

On the correctness side:
* Zobrist has now includes the ply parity
* the network now predicts something in [-1, 1] using tanh (approximated by polynomials)
* the training object is now MSE because we're learning a value estimate
* use .clangd instead of compile_commands.json

On the training side:
* completely forgo human-derived data set
* implement td(lambda), self-play, tournaments
</content>
</entry>
<entry>
<title>switch to explicit game state &amp; important bug fix &amp; clang format</title>
<updated>2023-01-16T11:25:47Z</updated>
<author>
<name>tslil clingman</name>
<email>tslil@posteo.de</email>
</author>
<published>2023-01-15T20:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=ef785da721a47e6d13aa854c795d2a9e269285b0'/>
<id>urn:sha1:ef785da721a47e6d13aa854c795d2a9e269285b0</id>
<content type='text'>
Previously the code base assumed that there was a single, global game
state which was the implicit target of all actions taken. Looking
ahead at architectural improvements, this has now been (almost
entirely) made explicit and functions take tak_state_p where
necessary (and also where unnecessary).

Two important fixes to actions.c were made:

- Previously when generating the possible stack moves, stack height
overflows (&gt; 15) were not taken into account and this resulted in the
tree search corrupting the board state. Now action search does not
list all legal actions, rather the subset of these encodeable by the
implementation.

- The check for crushing on a stack move was incorrect (too strict),
and this resulted in many legitimate moves being igonored.

Finally, in other changes, weights have also been improved by training
all games instead of some subset for chosen players, and clang-format
was run on the codebase.
</content>
</entry>
<entry>
<title>new neural network arch (faster + better) &amp; minor changes + fixes</title>
<updated>2023-01-15T15:03:37Z</updated>
<author>
<name>tslil clingman</name>
<email>tslil@posteo.de</email>
</author>
<published>2023-01-15T15:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=81213c273fd874aba95c45bd692e14079ebce434'/>
<id>urn:sha1:81213c273fd874aba95c45bd692e14079ebce434</id>
<content type='text'>
Gone is the convolutional neural network, for it turns out not only is
it more difficult to train, but all of the extra information about
board layers didn't make much of a difference at this size.

So cnn1986 has been replaced by nn1986, a standard, two-layer, dense
nn configured as a binary classifier and (mis)used in that capacity.
Note: total number of parameters is unchanged.

HARK: this new nn exposes a bug somewhere in ctak. Run ctlm with
self-play to see the completely borked board state at the end.
</content>
</entry>
<entry>
<title>Cleaned up build system</title>
<updated>2021-01-29T18:06:49Z</updated>
<author>
<name>tslil clingman</name>
<email>tslil@posteo.de</email>
</author>
<published>2021-01-29T18:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=0ce9856d34c58f6cb9c38281e04d1c4cbd09804c'/>
<id>urn:sha1:0ce9856d34c58f6cb9c38281e04d1c4cbd09804c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Skeleton readme</title>
<updated>2021-01-29T02:46:39Z</updated>
<author>
<name>tslil clingman</name>
<email>tslil@posteo.de</email>
</author>
<published>2021-01-29T02:45:57Z</published>
<link rel='alternate' type='text/html' href='https://git.l-3.space/ctak/commit/?id=9fb8a6e6e34ba8b5477fe7029172fd12f42a5df2'/>
<id>urn:sha1:9fb8a6e6e34ba8b5477fe7029172fd12f42a5df2</id>
<content type='text'>
</content>
</entry>
</feed>
