Discuss Scratch
- Discussion Forums
- » Show and Tell
- » Scratch Chess Engine - Game of Kings
- S_P_A_R_T
-
500+ posts
Scratch Chess Engine - Game of Kings
https://scratch.mit.edu/discuss/post/3734295/This did not age so well (my 2020 forum prediction if Chess neural networks would be possible on Scratch).
*NNUE is possible*
Everyone: Wait, this is an actually viable way to do evaluation on Scratch?
GoK NNUE: Always has been
![](http://cdn.scratch.mit.edu/scratchr2/static/__9c6d3f90ec5f8ace6d3e8ea1e684b778__/djangobb_forum/img/smilies/cool.png)
Check out Space Program Simulator!
![](https://uploads.scratch.mit.edu/get_image/project/805427141_120x90.png)
In it, you can build your own rockets from a variety of parts!
Then fly it with realistic orbital mechanics.
Go to orbit, explore different planets, share your save codes, and do so much more!
If you would like to help out on the project or chat about space or really anything else, check out the offical SPS Studio!
For more information & tutorials, check out the offical forum post!
![](https://uploads.scratch.mit.edu/get_image/project/544019342_120x90.png)
![](https://uploads.scratch.mit.edu/get_image/project/805427141_120x90.png)
In it, you can build your own rockets from a variety of parts!
Then fly it with realistic orbital mechanics.
Go to orbit, explore different planets, share your save codes, and do so much more!
If you would like to help out on the project or chat about space or really anything else, check out the offical SPS Studio!
For more information & tutorials, check out the offical forum post!
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
Congrats White Dove to this 94% to 89% win against GoK NNUE, both at 10sec think time: https://lichess.org/I2IsAaO0#116
I cannot say NNUE played bad (just too risky giving away material), WD just played better.
I cannot say NNUE played bad (just too risky giving away material), WD just played better.
Last edited by ArnoHu (June 15, 2024 12:28:05)
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
https://scratch.mit.edu/discuss/post/3734295/This did not age so well (my 2020 forum prediction if Chess neural networks would be possible on Scratch).
*NNUE is possible*
Everyone: Wait, this is an actually viable way to do evaluation on Scratch?
GoK NNUE: Always has been
Haha, yes. Well in all fairness, back then NNUE had not been shipped in chess engines, the first Stockfish implementation came in 2020. We talked about something like Leela Zero, not NNUE.
Last edited by ArnoHu (June 15, 2024 12:27:16)
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I think it’s the graphics card that dropped (a long beep, three short), I will test the graphics card on another pc to see if it works, if not, I would buy an new rtx 3060Sorry, but Destructor NNUE is broken AND my pc no longer works, so I won’t be able to repair Destructor
Sorry to hear, but will you get your PC repaired or a new one?
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
- HasiLover_Test
-
100+ posts
Scratch Chess Engine - Game of Kings
Thanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
Congrats, you were fast to make it work!
1st test game, GoK NNUE (Medium, white) vs Destructor NNUE, GoK wins in 23 moves: https://lichess.org/Qv0UdiWg#45
- HasiLover_Test
-
100+ posts
Scratch Chess Engine - Game of Kings
Scurious 3 was also able to beat it, with 94% accuracy. At 5 Ply depth https://lichess.org/WPIMJd4O#50, it seems to be making alot of bad moves, you should train it a bit more I think, once your PC works again.yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
Last edited by HasiLover_Test (June 15, 2024 13:36:42)
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
effectivelyScurious 3 was also able to beat it, with 94% accuracy. At 5 Ply depth https://lichess.org/WPIMJd4O#50, it seems to be making alot of bad moves, you should train it a bit more I think, once your PC works again.yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I've deleted the quiescence search…effectivelyScurious 3 was also able to beat it, with 94% accuracy. At 5 Ply depth https://lichess.org/WPIMJd4O#50, it seems to be making alot of bad moves, you should train it a bit more I think, once your PC works again.yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
Finished the GoK NNUE (white) vs. Bonsai Blue game on Scratch 3 with recent GoK S3 endgame fix: https://lichess.org/aEiOgTSg#149
First win for GoK NNUE against Bonsai, 2 : 2 overall.
Getting NNUE right on S3 is one of the real challenges. 92% accuracy looks a lot better already. I disabled quiescence extensions and other performance-heavy features, so that GoK NNUE can reach a certain minimum search depth.
First win for GoK NNUE against Bonsai, 2 : 2 overall.
Getting NNUE right on S3 is one of the real challenges. 92% accuracy looks a lot better already. I disabled quiescence extensions and other performance-heavy features, so that GoK NNUE can reach a certain minimum search depth.
Last edited by ArnoHu (June 15, 2024 15:23:30)
- -089-
-
14 posts
Scratch Chess Engine - Game of Kings
https://lichess.org/KC4DCF5x#36 test game vs shallow blue, destructor NNUE is black. it's opening play is interesting, ignoring the center but taking a bunch of space on kingside and queenside instead.I've deleted the quiescence search…effectivelyScurious 3 was also able to beat it, with 94% accuracy. At 5 Ply depth https://lichess.org/WPIMJd4O#50, it seems to be making alot of bad moves, you should train it a bit more I think, once your PC works again.yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
18… Qxd4?? surprised me a lot, I can't tell if that's a search depth problem or not
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I think it's a problem of depth, yeshttps://lichess.org/KC4DCF5x#36 test game vs shallow blue, destructor NNUE is black. it's opening play is interesting, ignoring the center but taking a bunch of space on kingside and queenside instead.I've deleted the quiescence search…effectivelyScurious 3 was also able to beat it, with 94% accuracy. At 5 Ply depth https://lichess.org/WPIMJd4O#50, it seems to be making alot of bad moves, you should train it a bit more I think, once your PC works again.yesThanks alot I arranged with my little brother, he lends me his laptop, so I repaired Destructor NNUE ( chess neural network )!
18… Qxd4?? surprised me a lot, I can't tell if that's a search depth problem or not
- AZURUS41
-
55 posts
Scratch Chess Engine - Game of Kings
Yes Lichess always does that ( reverting it after the draw ) Congrats to Element (black) for this game against GoK NNUE. It clearly would / should have won, but ran into a final-second threefold-repetition.
GoK detected it as a draw and stopped playing, Element wanted to continue. What is a bit strange is that lichess / Stockfish on import detects the draw on the move before, but reverts after the final move? It is a draw from all I can tell. https://lichess.org/J7hLv03T#133
GoK saw it was doomed for a long time, but nothing it could do. Worth mentioning, I had to re-import into Element once (an Undo button would be really great!), but that was far before the three-fold came into reach.
BTW, Element ran into Page-Unresponsive timeouts more or less all through midgame (next time it must play against GoK Difficult :-) ). I know it does not have iterative deepening, but couldn't it just do a quick 5+8 run, cache results, then run 6+8, and in case of timeout, re-use the 5+8 result?
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
Yes Lichess always does that ( reverting it after the draw ) Congrats to Element (black) for this game against GoK NNUE. It clearly would / should have won, but ran into a final-second threefold-repetition.
GoK detected it as a draw and stopped playing, Element wanted to continue. What is a bit strange is that lichess / Stockfish on import detects the draw on the move before, but reverts after the final move? It is a draw from all I can tell. https://lichess.org/J7hLv03T#133
GoK saw it was doomed for a long time, but nothing it could do. Worth mentioning, I had to re-import into Element once (an Undo button would be really great!), but that was far before the three-fold came into reach.
BTW, Element ran into Page-Unresponsive timeouts more or less all through midgame (next time it must play against GoK Difficult :-) ). I know it does not have iterative deepening, but couldn't it just do a quick 5+8 run, cache results, then run 6+8, and in case of timeout, re-use the 5+8 result?
OK, thank you, that explains it!
- birdracerthree
-
500+ posts
Scratch Chess Engine - Game of Kings
What happens here is simple; lichess marks the position before the threefold as 0.0 because the losing side can make a move to cause a threefold. This occurs if the losing side makes the final move. If the winning side makes the final move, the final move will be marked as 0.0 because the winning side was winning prior to the game ending.Yes Lichess always does that ( reverting it after the draw ) Congrats to Element (black) for this game against GoK NNUE. It clearly would / should have won, but ran into a final-second threefold-repetition.
GoK detected it as a draw and stopped playing, Element wanted to continue. What is a bit strange is that lichess / Stockfish on import detects the draw on the move before, but reverts after the final move? It is a draw from all I can tell. https://lichess.org/J7hLv03T#133
GoK saw it was doomed for a long time, but nothing it could do. Worth mentioning, I had to re-import into Element once (an Undo button would be really great!), but that was far before the three-fold came into reach.
BTW, Element ran into Page-Unresponsive timeouts more or less all through midgame (next time it must play against GoK Difficult :-) ). I know it does not have iterative deepening, but couldn't it just do a quick 5+8 run, cache results, then run 6+8, and in case of timeout, re-use the 5+8 result?
OK, thank you, that explains it!
Just for clarification, Element detects twofolds for itself, but only in the root node. Here, it never actually twofolds with a move that it made itself.
Element really needs the extra ply obtained from 6+8. If the 4+8 IID search takes too long to run, it doesn’t run 6+8 at all and it runs 5+8 instead. Timeouts are expected on 6+8. 3 or more timeouts are not expected with this change in v1.488. Your device is so fast, the failsafe never kick in!
In my opinion, running 5+8 is not worth it. The speed loss is too much. However, I can lower the amount it takes the failsafe to kick in. If I do that, Element may struggle to reach 6+8 on lower end devices. Realistically, the most likely solution is either LMR/NMP or better move ordering where PSTs fail (history moves).
- ababoin07
-
100+ posts
Scratch Chess Engine - Game of Kings
I have a question, for the move ordering, you evaluated the positions to what depth? Otherwise I will be afk for two weeks… Destructor with iterative deepening will come out in about 1 month
- birdracerthree
-
500+ posts
Scratch Chess Engine - Game of Kings
I do not know what you mean, but Element uses MVV-LVA and piece-square tables for its move ordering. Originally, I made the move and then used the evaluation function, but that’s not the best method (although it is still faster than no move ordering). I have a question, for the move ordering, you evaluated the positions to what depth? Otherwise I will be afk for two weeks… Destructor with iterative deepening will come out in about 1 month
- ArnoHu
-
1000+ posts
Scratch Chess Engine - Game of Kings
Improved NNUE performance for Scratch runtime by 50% (knowing Scratch runtime inner workings helps, because not all those optimizations are intuitive), and it showed immediately in a first game against Bonsai Blue, GoK NNUE (Difficult, white) at 92% accuracy, much better then the previous games we saw:
https://lichess.org/V2pZJC5y#55
BTW, performance tor TurboWarp stayed as it was (I am glad it did not degrade). That's the world of Scratch runtimes. Scratch 3 create a new Stack at runtime for every structure block it enters, who knows why…
And about that one blunder, for 24 out of 25 seconds NN had produced the right move (Be6), just to give it up at the last moment for Bf4, which it deemed slightly better. Otherwise would have been a perfect game.
We are getting closer to the goal to make NNUE play well on Scratch, too.
https://lichess.org/V2pZJC5y#55
BTW, performance tor TurboWarp stayed as it was (I am glad it did not degrade). That's the world of Scratch runtimes. Scratch 3 create a new Stack at runtime for every structure block it enters, who knows why…
And about that one blunder, for 24 out of 25 seconds NN had produced the right move (Be6), just to give it up at the last moment for Bf4, which it deemed slightly better. Otherwise would have been a perfect game.
We are getting closer to the goal to make NNUE play well on Scratch, too.
Last edited by ArnoHu (June 15, 2024 20:59:16)
- Discussion Forums
- » Show and Tell
-
» Scratch Chess Engine - Game of Kings