Repository navigation
Kotlin Multiplatform: Compose code as a Codename One app - #6106
shai-almog wants to merge 18 commits into
Conversation
A KMP module's commonMain (and its JVM source set) builds as a Codename One application: kotlinc compiles it for the JVM with the Compose compiler plugin, the unmodified Compose runtime and kotlinx.coroutines ship as they are, and maven/compose-compat provides the UI layer over Codename One components. - compose-compat: Modifier chains, Box/Row/Column/Lazy layout policies, text, material3, animation; top and navigation bars pad by the part of the safe area their host lies under, read at measure time. - cn1:import-kmp-project, the archetype compose profile, Gradle support. - ParparVM: field updaters lowered at translate time, ServiceLoader registry, the JavaAPI classes the Compose runtime and coroutines need. - Theme loading no longer leaves 24k strings behind (ThemeStrings), and Font.derive finds a cached font without building a key. - hellocodenameone moves to Kotlin 2.2.10 and carries KmpCompat screenshot tests; scripts/kmp-bench compares the same source against Compose Multiplatform; new developer guide chapter with diagrams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 12 screenshots: 12 matched. |
Native fidelity (Android, Material 3)54 pairs compared -- median 95.6%, worst 91.3% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
… reactor; guide snippets by tag Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Flutter vs Codename OneSame application, built both ways: Flutter's AOT compile of the gallery, and the identical Dart source transpiled to Java on Codename One. Lower is better for every metric, so a ratio above 1.00x means Codename One is ahead by that factor. android9 interleaved rounds; host load 1.04, 1.92, 1.54
Compute -- the VM workloads (
Gate: within tolerance against
ios9 interleaved rounds; host load 38.76, 39.17, 29.43
Compute -- the VM workloads ( Not measured: iOS compute is not measured: a device build needs signed hardware, and on the simulator Flutter runs its JIT debug engine rather than AOT code. The macOS row runs the same ParparVM and Dart AOT compilers on the same Apple silicon. Gate: within tolerance against
javascript9 interleaved rounds; host load 1.91, 1.24, 0.55
Compute -- the VM workloads (
Gate: within tolerance against
linux9 interleaved rounds; host load 0.24, 2.85, 2.38
Compute -- the VM workloads (
Gate: within tolerance against
macos9 interleaved rounds; host load 2.98, 20.49, 26.95
Compute -- the VM workloads (
Gate: within tolerance against
windows9 interleaved rounds
Compute -- the VM workloads (
Gate: within tolerance against
Codename One wins 26 of 26 measured metrics across 6 platform(s). |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Native fidelity (ios-27-metal)68 pairs compared -- median 94.6%, worst 74.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
…ndroid duplicate classes, guide snippets, mac goldens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s coroutines version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Native fidelity (iOS Modern, Metal)68 pairs compared -- median 95.0%, worst 83.5% ( Distribution --
Geometry vs native (bbox offset / size ratio / center offset / corner radius) -- gated separately from the visual score
Side-by-side comparisons (worst first)
|
# Conflicts: # .github/workflows/developer-guide-docs.yml # scripts/copyright-header-exclusions.txt
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
Cloudflare Preview
|
…names real animate functions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 26 Model 2 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 196 screenshots: 196 matched. Benchmark Results
Detailed Performance Metrics
ParparVM vs HotSpot (JDK 25): macOS arm64Runner CPU: Apple M1 (Virtual) (baseline 1 improvement past the baseline (not a failure; rebaseline to lock it in):
Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
A change that moves performance ON PURPOSE records the new baseline in Result: no regression (improved past the baseline: consider rebaselining) |
…rd covers the Compose screens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ows KmpCompat goldens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ith their implementors JVMS 5.5 initializes a superinterface declaring a default method together with any class implementing it. The JS runtime only initialized the superclass chain, and a default method reads its own interface's statics without an init guard, so Compose's MonotonicFrameClock.getKey() (= Key) answered null; CombinedContext.minusKey(null) then failed Kotlin's parameter check, whose message builder indexed an empty stack trace (AIOOBE 0 in every KmpCompat screenshot test). The translator now flags such interfaces (D: 1) and ensureClassInitialized and its suspending twin initialize them after the base class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 210 screenshots: 210 matched. Benchmark ResultsDetailed Performance Metrics
|
…routines' stdlib; JS KmpCompat goldens; guide terms Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 231 screenshots: 231 matched. |
…lib; arm64 Linux suite gets swap; Android KmpCompat goldens Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # docs/developer-guide/languagetool-accept.txt
|
Compared 195 screenshots: 195 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
…ass removed An application that never reaches a lowered updater lost the owner class and its header, and the Linux demo build then failed on a missing coroutines header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # .github/workflows/developer-guide-docs.yml # scripts/developer-guide/validate-guide-snippets.py
|
Compared 210 screenshots: 210 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: INTEL(R) XEON(R) PLATINUM 8573C (baseline 1 improvement past the baseline (not a failure; rebaseline to lock it in):
Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
A change that moves performance ON PURPOSE records the new baseline in Result: no regression (improved past the baseline: consider rebaselining) |
|
Compared 210 screenshots: 210 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |




















































































































































































































































































































































































A Kotlin Multiplatform module's
commonMainbuilds as a Codename One application for every target. kotlinc compiles it for the JVM with the Compose compiler plugin. The Compose runtime andkotlinx.coroutinesship unmodified, andmaven/compose-compatreplaces only the UI layer, writing it over Codename One components.Benchmarks
The same
commonMainwas built both ways and run on the iPhone 17 Pro simulator (scripts/kmp-bench).For reference, an empty UIKit app measures 34 MB and starts in 640-750 ms on the same simulator.
What's included
compose-compat): layout policies, modifiers, text, material3 and animation.LazyColumnandLazyRowcompose only the items in view. The top app bar and navigation bar now pad by the part of the safe area their host actually lies under, so the bar no longer draws under the status bar.cn1:import-kmp-project, acomposeprofile in the archetype, and Gradle support. Gradle stops with the line to add if the Compose plugin isn't applied, andconvert-to-gradlewrites that line.ServiceLoaderresolves through a registry built at translate time, and JavaAPI gains the classes the Compose runtime and coroutines need.ThemeStrings), andFont.derivefinds a cached font without building a key. Live heap drops from 3.7 MB to 3.2 MB, and footprint by about 2 MB.KmpCompat*screenshot tests covering layout, typography, lists and state/animation. Their goldens get seeded on CI.Verified locally
LanguageTool and the screenshot suites were not run locally; they run on CI.
🤖 Generated with Claude Code