We present LitmusKt - the first tool for litmus testing concurrent programs in Kotlin. The tool's novelty also lies in the fact that Kotlin is a multiplatform language, i.e., it compiles into multiple platforms, which means that the concurrency has to be tested on several of them. Our tool allows writing litmus tests in a single custom DSL, and these tests are then run in Kotlin/Native and Kotlin/JVM, two main platforms for concurrent programming in Kotlin. Using LitmusKt, we discovered novel bugs in the Kotlin compiler, which we then fixed and they are no longer present. Moreover, LitmusKt was integrated into the CI pipeline for Kotlin. We believe that our tool is valuable for further studying concurrency in Kotlin and other multiplatform languages, as well as for further developing the Kotlin memory model. LitmusKt is openly available on GitHub: https://github.com/Jetbrains-Research/litmuskt. The demonstration video is available on YouTube: https://youtu.be/gXI0aYJDnRw.
翻译:本文介绍了 LitmusKt——首个用于 Kotlin 并发程序 Litmus 测试的工具。该工具的创新性还在于 Kotlin 是一种多平台语言,即可编译至多个目标平台,这意味着其并发性必须在多个平台上进行测试。我们的工具允许使用单一自定义 DSL 编写 Litmus 测试用例,随后这些测试会在 Kotlin/Native 和 Kotlin/JVM(Kotlin 并发编程的两个主要平台)上运行。通过使用 LitmusKt,我们发现了 Kotlin 编译器中的新错误,并已修复,目前这些错误已不复存在。此外,LitmusKt 已集成到 Kotlin 的持续集成流水线中。我们相信,该工具对于进一步研究 Kotlin 及其他多平台语言的并发性,以及推进 Kotlin 内存模型的发展具有重要价值。LitmusKt 已在 GitHub 上开源:https://github.com/Jetbrains-Research/litmuskt。演示视频可在 YouTube 观看:https://youtu.be/gXI0aYJDnRw。