i'm still testing the (newest) 4KU2 versions by compiling them and let them play with several engines in CuteChess (on Linux). I gathered a lot of (weaker) open source engines and i try to match opponents with similar rating - my current guess of 4KU2 rating is 2100. These are all seperate games (10 min + 3 sec bonus), i mean i do no tournament in CuteChess.
i like your minimalistic approach .. although i'm not a C++ programmer (but mainly Python and JS), your code seems very well written and is just one small cpp file! The UCI subset which you use is enough for playing in CuteChess (or similar), it understands just "position startpos moves [...]" and "go wtime 603000 btime 603000 winc 3000 binc 3000" or similar.
i guess 4KU2 is not for playing in terminal, but it can be done. Looking at the games 4KU2 plays in CuteChess, i see it has a natural way of developing the pieces and pawns. Using the same time settings in all games, 4KU2 seems rather consistent in its openings, only a few times it plays another variation (when the opponent played known opening moves). I guess in such case both moves have almost equal eval, maybe the hash 'decided' the "best move" ? To test a position with different settings, i used terminal by entering the proper (large) move list to reach that position .. i had some odd results, maybe hash is involved ? Then how ? Could such tests help your development ? Can you reproduce them anyway ? - myself i didn't redo the same terminal sessions to see if they would lead to the exact same results .. btw. i use a rather modern avx2 notebook and Xubuntu 22.04
i want to show the terminal output concerning this position :
![4KU2-pos-after-e4e5](https://user-images.githubusercontent.com/1109281/204861583-e2dfda0d-c21a-402a-85a6-46a1b00c9527.png)
UCI : position startpos moves e2e4 b8c6 d2d4 d7d5 e4e5
FEN : r1bqkbnr/ppp1pppp/2n5/3pP3/3P4/8/PPP2PPP/RNBQKBNR b KQkq - 0 3
This is a well known position in chess theory. Most positions can be reached by altered move order, but normally the game went like this :
- e4 Nc6
This opening is called the Nimzowitch Defence. 4KU2 also prefers e4 on move 1, but with Black it would answer the good standard e7e5 :
ucinewgame
id name 4ku2
id author kz04px
uciok
position startpos moves e2e4
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove e7e5
Our game continues with :
2. d4 d5
4KU2 prefers Nf3 on move 2, but after 2.d4 it also prefers to answer d5 with Black :
position startpos moves e2e4 b8c6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove g1f3
position startpos moves e2e4 b8c6 d2d4
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove d7d5
Our game continues with :
3. e5 ...
Here 4KU2 prefers not to advance the e-pawn, it likes to keep the initiative by e4xd5 :
position startpos moves e2e4 b8c6 d2d4 d7d5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove e4d5
position startpos moves e2e4 b8c6 d2d4 d7d5 e4e5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
We reached the position of the diagram. Here 4KU2 seems to prefer 3...f6 when given 10 minutes (per game), but when i let 4KU2 think again (same hash?) it finds other moves too ?! :
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
quit
And what about my test below (after restarting 4KU2 in terminal) .. same position, other best move :
(Note: the move Bd7 was once picked also)
ucinewgame
id name 4ku2
id author kz04px
uciok
position startpos moves e2e4 b8c6 d2d4 d7d5 e4e5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove f7f6
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8d7
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
go wtime 603000 btime 603000 winc 3000 binc 3000
bestmove c8f5
quit
And this test, using a longer time :
ucinewgame
id name 4ku2
id author kz04px
uciok
position startpos moves e2e4 b8c6 d2d4 d7d5 e4e5
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove f7f6
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove f7f6
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove c8f5
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove c8f5
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove c8f5
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove f7f6
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove c8f5
go wtime 1603000 btime 1603000 winc 3000 binc 3000
bestmove f7f6
quit
Here, the two moves Bf5 and f6 (which indeed are best according to SF) are both 'best move' after some time, but why do they toggle ?