Discuss Scratch

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

Why are the cold start runs faster, shouldn't it be the other way around?

It never really speeds up, it's always like 30% faster after I toggle warp timer on/off.

OK, that's true, still it's the recompile that triggers the change. Optimizer can be wrong, or can disable optimizations for certain functions for one reason or another.
waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

Why are the cold start runs faster, shouldn't it be the other way around?

It never really speeds up, it's always like 30% faster after I toggle warp timer on/off.

OK, that's true, still it's the recompile that triggers the change. Optimizer can be wrong, or can disable optimizations for certain functions for one reason or another.

So I get a 30% speed boost by NOT having it optimized? Turbowarp must be “optimizing” one of my main functions in a way that's really counterproductive for there to be such a drop in performance…

Is it possible to prevent it from optimizing at runtime? If it's not possible, is it known what sorts of things get optimized poorly? Is it the kind of thing I can fix by changing my code's structure in some way?
waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI
sprunkrLover1234
Scratcher
9 posts

Scratch Chess Engine - Game of Kings

How is your chess algorithm coming along? Just asking.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

GoK NNUE wins against chess.com max bot (Komodo 25):

https://lichess.org/IUdAsgGh
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

Last edited by ArnoHu (Sept. 25, 2026 02:58:14)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

sprunkrLover1234 wrote:

How is your chess algorithm coming along? Just asking.

Thanks for asking, making progress, step by step.
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

Scratch chess engines TurbowWarp test game series, broadcasted live on lichess:

https://lichess.org/broadcast/scratch-chess-engine-test-games-series/round-1/SLvxmTkh#players

Featuring Wolverine 3, Black Crow, GoK Classic, GoK NNUE (1sec), Delta 5 and Stockfish 12 (depth 10).

GoK NNUE - Stockfish 12: 61 - 39
GoK NNUE - Black Crow: 72.5 - 27.5

GoK Classic - Wolverine 3: 63 - 37
GoK Classic - White Dove: 75.5 - 24.5

Currently playing:

GoK NNUE - Wolverine 3 NNUE
Black Crow - Stockfish 12

Last edited by ArnoHu (Sept. 25, 2026 03:19:22)

waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

Scratch chess engines TurbowWarp test game series, broadcasted live on lichess:

https://lichess.org/broadcast/scratch-chess-engine-test-games-series/round-1/SLvxmTkh#players

Featuring Wolverine 3, Black Crow, GoK Classic, GoK NNUE (1sec), Delta 5 and Stockfish 12 (depth 10).

GoK NNUE - Stockfish 12: 61 - 39
GoK NNUE - Black Crow: 72.5 - 27.5

GoK Classic - Wolverine 3: 63 - 37
GoK Classic - White Dove: 75.5 - 24.5

Currently playing:

GoK NNUE - Wolverine 3 NNUE
Black Crow - Stockfish 12


https://limewire.com/d/dSiUz#DNR14ViCEd

Try this – this one uses a Smallbrain net (not the 3 MB, one that's much smaller but still larger than the Leorik net).

I am curious how this does against GoK NNUE, as well as against the current Wolverine NNUE that uses the Leorik net. (I can't get two Wolverines running in a DCI project due to variable conflicts, so I can't make direct comparisons – but I suspect the Smallbrain version is stronger even though it's about 3x slower.)

Last edited by waabooboo (Sept. 25, 2026 14:32:32)

ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

waabooboo wrote:

ArnoHu wrote:

Scratch chess engines TurbowWarp test game series, broadcasted live on lichess:

https://lichess.org/broadcast/scratch-chess-engine-test-games-series/round-1/SLvxmTkh#players

Featuring Wolverine 3, Black Crow, GoK Classic, GoK NNUE (1sec), Delta 5 and Stockfish 12 (depth 10).

GoK NNUE - Stockfish 12: 61 - 39
GoK NNUE - Black Crow: 72.5 - 27.5

GoK Classic - Wolverine 3: 63 - 37
GoK Classic - White Dove: 75.5 - 24.5

Currently playing:

GoK NNUE - Wolverine 3 NNUE
Black Crow - Stockfish 12


https://limewire.com/d/dSiUz#DNR14ViCEd

Try this – this one uses a Smallbrain net (not the 3 MB, one that's much smaller but still larger than the Leorik net).

I am curious how this does against GoK NNUE, as well as against the current Wolverine NNUE that uses the Leorik net. (I can't get two Wolverines running in a DCI project due to variable conflicts, so I can't make direct comparisons – but I suspect the Smallbrain version is stronger even though it's about 3x slower.)

Couldn't download it.
waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

waabooboo wrote:

ArnoHu wrote:

Scratch chess engines TurbowWarp test game series, broadcasted live on lichess:

https://lichess.org/broadcast/scratch-chess-engine-test-games-series/round-1/SLvxmTkh#players

Featuring Wolverine 3, Black Crow, GoK Classic, GoK NNUE (1sec), Delta 5 and Stockfish 12 (depth 10).

GoK NNUE - Stockfish 12: 61 - 39
GoK NNUE - Black Crow: 72.5 - 27.5

GoK Classic - Wolverine 3: 63 - 37
GoK Classic - White Dove: 75.5 - 24.5

Currently playing:

GoK NNUE - Wolverine 3 NNUE
Black Crow - Stockfish 12


https://limewire.com/d/dSiUz#DNR14ViCEd

Try this – this one uses a Smallbrain net (not the 3 MB, one that's much smaller but still larger than the Leorik net).

I am curious how this does against GoK NNUE, as well as against the current Wolverine NNUE that uses the Leorik net. (I can't get two Wolverines running in a DCI project due to variable conflicts, so I can't make direct comparisons – but I suspect the Smallbrain version is stronger even though it's about 3x slower.)

Couldn't download it.

Strange… Try this instead:

https://fileport.io/FyS9fGBQ7v7N

waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

The DCI file I shared is the new version, only change is I swapped out the Leorik net for a Smallbrain one. Again I had some issues sharing it as a Scratch project, that's why I shared it as a file. The second link I sent will hopefully work…

And I figured out what causes the major slowdowns after a long, painful process, testing every possible thing. Turns out it's sprite costumes with numbers as names, for whatever reason that slows things down significantly…
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

The DCI file I shared is the new version, only change is I swapped out the Leorik net for a Smallbrain one. Again I had some issues sharing it as a Scratch project, that's why I shared it as a file. The second link I sent will hopefully work…

And I figured out what causes the major slowdowns after a long, painful process, testing every possible thing. Turns out it's sprite costumes with numbers as names, for whatever reason that slows things down significantly…

Great finding, I uncovered the same thing only a week ago, it's crazy!

Reason:
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L88-L99
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L150-L160

Why?
In Scratch, switch costume to (“1”) picks the costume named “1”, while switch costume to (1) picks costume number 1. Any stored value could later reach a switch-costume block. So when some costume or sound is named “1”, the compiler keeps every stored 1 as the string “1” to preserve that behaviour. Each later use in arithmetic or a comparison then needs a string-to-number conversion, and the compiler can't use its typed number code paths.

Without S3 backward-compatibility, engines would play a lot better.

Last edited by ArnoHu (Yesterday 07:57:08)

waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

The DCI file I shared is the new version, only change is I swapped out the Leorik net for a Smallbrain one. Again I had some issues sharing it as a Scratch project, that's why I shared it as a file. The second link I sent will hopefully work…

And I figured out what causes the major slowdowns after a long, painful process, testing every possible thing. Turns out it's sprite costumes with numbers as names, for whatever reason that slows things down significantly…

Great finding, I uncovered the same thing only a week ago, it's crazy!

Reason:
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L88-L99
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L150-L160

Why?
In Scratch, switch costume to (“1”) picks the costume named “1”, while switch costume to (1) picks costume number 1. Any stored value could later reach a switch-costume block. So when some costume or sound is named “1”, the compiler keeps every stored 1 as the string “1” to preserve that behaviour. Each later use in arithmetic or a comparison then needs a string-to-number conversion, and the compiler can't use its typed number code paths.

Without S3 backward-compatibility, engines would play a lot better.

You should have told me, would have saved me some time… How does Wolverine with the Smallbrain net do, did you get a chance to test?
ArnoHu
Scratcher
1000+ posts

Scratch Chess Engine - Game of Kings

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

The DCI file I shared is the new version, only change is I swapped out the Leorik net for a Smallbrain one. Again I had some issues sharing it as a Scratch project, that's why I shared it as a file. The second link I sent will hopefully work…

And I figured out what causes the major slowdowns after a long, painful process, testing every possible thing. Turns out it's sprite costumes with numbers as names, for whatever reason that slows things down significantly…

Great finding, I uncovered the same thing only a week ago, it's crazy!

Reason:
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L88-L99
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L150-L160

Why?
In Scratch, switch costume to (“1”) picks the costume named “1”, while switch costume to (1) picks costume number 1. Any stored value could later reach a switch-costume block. So when some costume or sound is named “1”, the compiler keeps every stored 1 as the string “1” to preserve that behaviour. Each later use in arithmetic or a comparison then needs a string-to-number conversion, and the compiler can't use its typed number code paths.

Without S3 backward-compatibility, engines would play a lot better.

You should have told me, would have saved me some time… How does Wolverine with the Smallbrain net do, did you get a chance to test?

Yeah I didn't know your costume names.

I played two quick rounds using Wolverine 3 NNUE-SB, 2.5 - 7.5 against GoK Classic, and 0 - 10 against GoK NNUE. I can export the games to lichess if you want.

Last edited by ArnoHu (Today 17:18:58)

waabooboo
Scratcher
500+ posts

Scratch Chess Engine - Game of Kings

ArnoHu wrote:

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

ArnoHu wrote:

waabooboo wrote:

https://scratch.mit.edu/projects/1202302970/

Wolverine 3's official release. Some more small improvements have been made over the DCI version. Same interface as Wolverine 2, although I am in the process of designing a better UI

Cool, congrats to this version, it is super dangerous!

Where are the DCI-enabled versions? Because I still have only those from a couple of weeks ago.

The DCI file I shared is the new version, only change is I swapped out the Leorik net for a Smallbrain one. Again I had some issues sharing it as a Scratch project, that's why I shared it as a file. The second link I sent will hopefully work…

And I figured out what causes the major slowdowns after a long, painful process, testing every possible thing. Turns out it's sprite costumes with numbers as names, for whatever reason that slows things down significantly…

Great finding, I uncovered the same thing only a week ago, it's crazy!

Reason:
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L88-L99
https://github.com/TurboWarp/scratch-vm/blob/c4823421cb7c17d8d8a89878851ce1668c26a21f/src/compiler/irgen.js#L150-L160

Why?
In Scratch, switch costume to (“1”) picks the costume named “1”, while switch costume to (1) picks costume number 1. Any stored value could later reach a switch-costume block. So when some costume or sound is named “1”, the compiler keeps every stored 1 as the string “1” to preserve that behaviour. Each later use in arithmetic or a comparison then needs a string-to-number conversion, and the compiler can't use its typed number code paths.

Without S3 backward-compatibility, engines would play a lot better.

You should have told me, would have saved me some time… How does Wolverine with the Smallbrain net do, did you get a chance to test?

Yeah I didn't know your costume names.

I played two quick rounds using Wolverine 3 NNUE-SB, 2.5 - 7.5 against GoK Classic, and 0 - 10 against GoK NNUE. I can export the games to lichess if you want.

GoK Classic beat it 7.5-2.5, really? I wonder if I didn't set the NNUE up right, or maybe it was Wolverine HCE playing again…

0-10 against GoK NNUE is a bit disappointing, although not shocking. But I would like to see the exported games, especially against Classic.

Powered by DjangoBB