Vibe Coding

Discussion about development of draughts in the time of computer and Internet.
Post Reply
BertTuyt
Posts: 1637
Joined: Wed Sep 01, 2004 19:42

Vibe Coding

Post by BertTuyt »

These days programming has changed quite a bit due to Vibe Coding, which uses AI.
In my case I started with Codex from OpenAI, to develop a new GUI.
I have reported several times about (some) progress.
As this was (quite) successful, I started with a new challenge, tackling the evaluation function.
In some posts I will describe progress (if any).

First I received from Joost a dataset with around 100M labeled FEN's. The labels contain the outcome of the respective game and were limited to W, D and L (win, draw and loss).
Next I asked Codex to develop a training application with input the data-set, and a description of the neural network.
In my (first) case this was 190 inputs, and then 4 fully connected layers with 256, 32, 32 and 1 neuron(s).
To secure that the inputs only/mainly covered positional information, the material component was "hardwired" / added to the output of the last neuron. This can be changed in the future (for example a simple NN), but as a first guess/start the values man = 1.0, and king = 3.2 were used (not game-phase dependent).
Output was a file with the 32-bit float weights for the neural network.

See some screenshots of the tool developed by Codex, and named quattice :shock:

Bert

quanttice about.png
quattice.png
BertTuyt
Posts: 1637
Joined: Wed Sep 01, 2004 19:42

Re: Vibe Coding

Post by BertTuyt »

The next step was to optimize NNUE.
Although NNUE is an Efficient Updateable NN, I wanted to get rid off the incremental update, and the need to copy the 256 * 4 byte float accumulator at every new node. For this reason Codex designed the quasar application which converts areas of the draughtboard (8 in total) to neural network tables (each with 256 floats). The base idea is to calculate every combination of white/black man in every area, and to add all the 256 byte floats for every piece/square combination to the table entry. In contrast with the patterns in Scan these areas are non-overlapping (and don't need to cover a logical draughts related concept). The index of the tables entries is calculated in a similar way as Scan.
The quasar application converts the .qnn file (22k KB) to a .qtf file (8913 KB).

See below screenshots.

Bert
quasar.png
quasar about.png
BertTuyt
Posts: 1637
Joined: Wed Sep 01, 2004 19:42

Re: Vibe Coding

Post by BertTuyt »

Last but not least when the .qtf file was available, Codex was given the assignment to take the code of the damage161 engine, and to convert this to a new damage184 engine, in which the previous evaluation was replaced by an evaluation designed by Codex, which could handle the .qtf file, understands the interfaces towards the engine, and uses the avx2 vector instructions. This was all information given to Codex.

In these 3 steps (the previous 2 provided in the previous posts), Codex was able (with some discussion between the 2 of us), to start with a labeled FEN file, and ended with a updated damage application.

As the proof of the pudding is in the eating, I started a DXP match against Kingsrow. Settings 5 minutes for 80 games, 6p Database, no book for Damage and a book for Kingsrow. Also only 1 core was used.

DXP match is in progress, but current status after 63 games, 3 wins for Kingsrow, and 60 draws.
One results was unknown, but i could see from the score that this was a loss for Damage
So not superior to Kingsrow, but to my opinion an encouraging result.

Bert

kingsrow.png
Post Reply