Development of Shen Yu

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
AAce3
Posts: 80
Joined: Fri Jul 29, 2022 1:30 am
Full name: Aaron Li

Re: Development of Shen Yu

Post by AAce3 »

Ras wrote: Tue Nov 08, 2022 8:04 am
AAce3 wrote: Tue Nov 08, 2022 4:20 amThere have been weird crashes with banksia gui when undo-ing and setting up positions,
Looking at https://github.com/AAce3/ShenYu/blob/master/src/uci.rs, I can see that you expect position startpos moves ... from line 212, but for position fen ... from line 203, there is no corresponding evaluation of moves. By consequence, this will only work with GUIs that transfer the game from the starting position followed by all game moves. If a GUI instead transfers the position after the last non-reversible move plus the move list from there, that will not work:

[d]7r/3p1n2/5k2/R7/1P2B3/2P5/3K4/8 w - - 0 1

This works:

Code: Select all

position fen 7r/3p1n2/5k2/R7/1P2B3/2P5/3K4/8 w - - 0 1
go depth 2
info depth 1 score cp 159 nodes 39 nps 0 time 0 pv a5a7
info depth 2 score cp 116 nodes 113 nps 0 time 0 pv d2d3 h8h2
bestmove d2d3
This fails, the engine tries to move White's king although it's Black's turn:

Code: Select all

position fen 7r/3p1n2/5k2/R7/1P2B3/2P5/3K4/8 w - - 0 1 moves d2d3
go depth 2
info depth 1 score cp 159 nodes 39 nps 0 time 0 pv a5a7
info depth 2 score cp 116 nodes 79 nps 0 time 0 pv d2d3
bestmove d2d3
Also, the FEN parser does not always evaluate who is to move (and hence maybe not the following castling rights / ep square, either - should be verified):

[d]7r/3p1n2/5k2/R7/1P2B3/2P5/3K4/8 b - - 0 1

Code: Select all

position fen 7r/3p1n2/5k2/R7/1P2B3/2P5/3K4/8 b - - 0 1
go depth 2
info depth 1 score cp 159 nodes 41 nps 41000 time 1 pv a5a7
info depth 2 score cp 166 nodes 244 nps 244000 time 1 pv a5f5 f6e6 b4b5
The issue seemed to be that only the 'board' section of the fen would be parsed, and as a result would not take into account any other details. Thank you for your help! I have released a new version which fixes this bug.
User avatar
Ras
Posts: 2695
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Development of Shen Yu

Post by Ras »

Looks good with the Windows version, also with castling and EP. :) Can you also update the Linux version, that's still as 1.0.0 in the 1.0.1 release assets, with the same issues as before? I'd also suggest to include the version in the UCI response as part of id name, that makes things easier to track.
Rasmus Althoff
https://www.ct800.net
User avatar
AAce3
Posts: 80
Joined: Fri Jul 29, 2022 1:30 am
Full name: Aaron Li

Re: Development of Shen Yu

Post by AAce3 »

Ras wrote: Wed Nov 09, 2022 7:36 am Looks good with the Windows version, also with castling and EP. :) Can you also update the Linux version, that's still as 1.0.0 in the 1.0.1 release assets, with the same issues as before? I'd also suggest to include the version in the UCI response as part of id name, that makes things easier to track.
I think I accidentally misnamed the linux version :oops: :oops:
User avatar
AAce3
Posts: 80
Joined: Fri Jul 29, 2022 1:30 am
Full name: Aaron Li

Re: Development of Shen Yu

Post by AAce3 »

Hi all,

It's been awhile since I posted here. I've been doing lots of stuff with chess programming in the past year or so of course, but nothing that was really post-worthy. So, with the release of Shen Yu 2.0.0 nearing (plus maybe a new engine !), I'm going to be posting all the stuff I've done in the past year (besides padding my profile for college applications :lol: )

My initial experiments with AB+MCTS ended up being kind of pointless. I won't go much into them, but overall it wasn't stronger than the version without. I decided to look at the more popular approach (relatively - I haven't seen many of these engines!) of NN+MCTS. I've been researching a lot about the topic, from AlphaZero Lite by Dietrich Kappe, as well as the Lc0 discord and codebase. I've also been working on an NN+MCTS engine named Cygnus in C++ for a couple of months now (with lots of breaks - did I mention my college applications? :oops: ). I've successfully been able to run an Lc0 network using Onnxruntime, and I'm planning to get a basic search working before adding in cool feature like batching, tree reuse, multithreading, futility pruning. Of course, I will be posting all of that here on talkchess in case anyone is interested.

I also picked back up Shen Yu, with the intention of a full rewrite. My goal for Shen Yu right now is to generate a from-scratch self-play trained NNUE with my own unique architecture. With the rewrite, I focused a bit more on code maintainability than speed so I suffered quite a hit in that area :oops: although adding NNUE (in the far future) should make it so that the speed change doesn't particularly matter.

I successfully implemented Null move pruning and late move reductions. NMP gave roughly 140 elo, while LMR needs to be tested again (somehow, with no opening book, ShenYu+LMR+NMP is 350 elo higher than ShenYu+NMP at 20+0.1 tc). Once I get a rough sense of what elo ShenYu 2.0.0 is at, I will publish it. So, if anyone has engines that can be tested send them my way! :D I'm hoping for 2500+, got my fingers crossed!

I probably will be going on hiatus for another 3 months or so until application season ends, but after that, expect lots of cool content from both ShenYu and Cygnus!
User avatar
AAce3
Posts: 80
Joined: Fri Jul 29, 2022 1:30 am
Full name: Aaron Li

Re: Development of Shen Yu

Post by AAce3 »