LitmusKt: Concurrency Stress Testing for Kotlin

📅 2025-01-13
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Kotlin’s multiplatform concurrency semantics exhibit inconsistencies across targets, and its memory model lacks formal verification. Method: This paper designs and implements the first Kotlin-specific cross-platform concurrency stress-testing framework. Built upon a custom domain-specific language (DSL) and compiler plugins, it enables unified execution of litmus tests on both Kotlin/JVM and Kotlin/Native—achieving “write once, run everywhere.” We propose a test-driven cross-platform verification architecture, deeply integrated into CI/CD pipelines. Contribution/Results: The framework uncovered and helped fix multiple compiler-level concurrency bugs in Kotlin, directly influencing the evolution of Kotlin’s official memory model. Open-sourced and adopted by the Kotlin official CI infrastructure, it has become the de facto standard tool for verifying semantic consistency of concurrent behavior across Kotlin multiplatform targets.

Technology Category

Application Category

📝 Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Kotlin Programming
Multitasking Performance
Memory Management
Innovation

Methods, ideas, or system contributions that make the work stand out.

LitmusKt
multi-tasking
memory management
🔎 Similar Papers
No similar papers found.