Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM Browser support for all the libraries including korgw and korge (retake) #1628

Merged
merged 55 commits into from
Jun 3, 2023

Conversation

soywiz
Copy link
Member

@soywiz soywiz commented May 24, 2023

Retake of #1626

./gradlew :korio:wasmBrowserTest
./gradlew :klock:wasmBrowserTest
./gradlew :kbignum:wasmBrowserTest
./gradlew :kmem:wasmBrowserTest
./gradlew :korte:wasmBrowserTest
./gradlew :korinject:wasmBrowserTest
./gradlew :korau:wasmBrowserTest
./gradlew :krypto:wasmBrowserTest

❌☠️ KDS tests are hanging before even starting:

https://youtrack.jetbrains.com/issue/KT-58941/WASM-Hang-with-extension-delegate-inside-a-Class

> Task :kds:wasmBrowserTest
Critical dependency: the request of a dependency is an expression

❌☠️ KORGW tests are hanging before even starting:

It seems that it was because there was a fun main : korlibs.render.main in KorgwSampleMain.kt. Are tests running every main method they find?

> Task :korgw:wasmBrowserTest
Critical dependency: the request of a dependency is an expression

❌☠️ KORGE doesn't have compilation errors but fails when generating the test executable:

Reported here: https://youtrack.jetbrains.com/issue/KT-59061/WASM-CompileError-WebAssembly.instantiateStreaming-korlibs.graphics.gl.AGOpenglssget-glaref.Invoke-failed-callel-expected-type

> Task :korge:compileTestDevelopmentExecutableKotlinWasm FAILED
e: java.util.NoSuchElementException: Key VALUE_PARAMETER name:<this> type:korlibs.korge.Korge{ korlibs.korge.KorgeConfig } is missing in the map.
        at kotlin.collections.MapsKt__MapWithDefaultKt.getOrImplicitDefaultNullable(MapWithDefault.kt:24)
        at kotlin.collections.MapsKt__MapsKt.getValue(Maps.kt:360)
        at org.jetbrains.kotlin.backend.wasm.ir2wasm.WasmFunctionCodegenContext.referenceLocal(WasmFunctionCodegenContext.kt:53)
        at org.jetbrains.kotlin.backend.wasm.ir2wasm.BodyGenerator.visitGetValue(BodyGenerator.kt:256)
        at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitGetValue(IrElementVisitorVoid.kt:492)
        at org.jetbrains.kotlin.backend.wasm.ir2wasm.BodyGenerator.visitGetValue(BodyGenerator.kt:33)
        at org.jetbrains.kotlin.backend.wasm.ir2wasm.BodyGenerator.visitGetValue(BodyGenerator.kt:33)

⚠️ Some KORMA tests fails because Double/Float.toString() display rounding works differently than in other targets.

⚠️ Some KORIM tests fails with different things. Not sure if getImageData/putImageData transferred properly ot something else failed. Because in JS IntArray/Int32Array were aliases and thus mirrored, so maybe in some places we will have to ensure when copying we are loading back

…pending on kotlinx-coroutines"

This reverts commit dc04a50.
soywiz added 28 commits May 26, 2023 16:41
…dyn and in other targets those values are boxed with the same instance as an optimization
… the tests to hang without displaying errors or reporting anything
@soywiz
Copy link
Member Author

soywiz commented May 26, 2023

In the case of korge removing tests doesn't help. Just by including an empty .kt file in the test source folder it hangs already

… to see if we can circumvent the error:

~ Uncaught (in promise) CompileError: WebAssembly. instantiateStreaming() : Compiling function
async module:63
#41285 :"korlibs.graphics.gl.AGOpenglssget-gla$ref.Invoke" failed: call|el expected type (ref null 11168), found local.get of type (ref null 7114) @+6179170
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2023

Codecov Report

Patch coverage: 22.22% and project coverage change: -0.12 ⚠️

Comparison is base (44812e5) 51.03% compared to head (548f105) 50.92%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1628      +/-   ##
==========================================
- Coverage   51.03%   50.92%   -0.12%     
==========================================
  Files        1692     1691       -1     
  Lines       99713    99883     +170     
  Branches    14230    14235       +5     
==========================================
- Hits        50890    50864      -26     
- Misses      44893    45107     +214     
+ Partials     3930     3912      -18     
Flag Coverage Δ
unittests 50.92% <22.22%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rc/main/kotlin/korlibs/korge/gradle/module/Idea.kt 0.00% <0.00%> (ø)
...libs/korge/gradle/targets/android/AndroidDirect.kt 0.00% <0.00%> (ø)
...tlin/korlibs/korge/gradle/targets/js/JavaScript.kt 0.00% <0.00%> (ø)
.../src/main/kotlin/korlibs/root/RootKorlibsPlugin.kt 0.00% <0.00%> (ø)
...mmonTest/kotlin/korlibs/datastructure/ExtraTest.kt 0.00% <0.00%> (-90.91%) ⬇️
...kotlin/korlibs.audio.sound/SoundAudioStreamTest.kt 80.64% <0.00%> (+1.33%) ⬆️
...src/androidMain/kotlin/korlibs/kgl/KmlGlAndroid.kt 0.00% <0.00%> (ø)
...lin/korlibs/render/x11/LinuxJoyEventAdapterTest.kt 93.10% <0.00%> (-3.45%) ⬇️
...mMain/kotlin/korlibs/render/osx/MacosGameWindow.kt 0.00% <ø> (ø)
...vmMain/kotlin/korlibs/render/platform/NativeKgl.kt 0.00% <0.00%> (ø)
... and 19 more

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@soywiz soywiz enabled auto-merge (squash) June 3, 2023 10:09
@soywiz soywiz disabled auto-merge June 3, 2023 11:36
@soywiz soywiz merged commit 8d006dc into main Jun 3, 2023
@soywiz soywiz deleted the feature/retake.wasm branch October 4, 2023 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants