Skip to content

cn1lib: a library can carry a server half - #6139

Merged
shai-almog merged 6 commits into
masterfrom
cn1lib-backend-part
Nov 1, 2026
Merged

shai-almog merged 6 commits into
masterfrom
cn1lib-backend-part

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

A cn1lib can now ship server code. Its controllers, beans, entities, repositories and migrations are wired into any server that depends on it, as if that server had compiled them.

How

  • A jar carrying META-INF/codenameone/backend-library is a backend library. BackendLibraries.merge copies it into the server module's classes before annotation processing: Maven process-annotations, Gradle compileJava, and the native BackendPackager. The library itself is never processed, so its generated wiring can't collide with the server's.
  • .cn1lib gains backend.zip (Cn1libMojo packs it, Cn1libInstaller unpacks it to the backend classifier). The cn1lib archetype gets a backend module, and Gradle cn1libs publish <name>-backend from src/backend/{java,resources}.
  • The merge records each copied file with its size and CRC32. A library upgrade or removal leaves nothing stale, and a class the module compiles over a merged one stays the module's. The record is restamped after processing, failed or not, because weaving rewrites merged classes in place.
  • The library jars are a content input of Gradle's compileJava. Without that, compile avoidance would skip the merge when a library changes a method body or a migration.
  • The native packager stages only cn1-native from a library (jar or directory), so no class is translated twice.

Tests

  • BackendLibrariesTest: 7 tests, including the module-class-wins and rewritten-class cases.
  • maven/integration-tests/backend-cn1lib-test.sh: new, runs in archetype-smoke. A generated cn1lib with an endpoint, service, entity, repository and migration is consumed by a generated server, and checked with @BackendTest and natively compiled tests.
  • gradle-cn1lib-test.sh checks the <name>-backend artifact.

Docs: Backend-Beans ("Controllers and beans from a library"), Backend-Data, Advanced Topics (cn1lib contents) and Gradle-Project-Workflow.

🤖 Generated with Claude Code

shai-almog and others added 2 commits October 30, 2026 15:50
A jar marked with META-INF/codenameone/backend-library is a backend library:
a server that depends on one wires its controllers, beans, entities,
repositories and migrations as its own, on the JVM (Maven process-annotations,
Gradle compileJava) and in the native backend build. The library itself is
never processed. A .cn1lib carries the server half as backend.zip; the cn1lib
archetype gains a backend module and Gradle cn1libs publish <name>-backend.

The merge records what it copied, with each file's size and CRC, so a library
upgraded or dropped leaves nothing stale, and a class the module compiled over
a merged one stays the module's. The record is restamped after processing,
failed or not, because weaving rewrites merged classes in place.

Tested by BackendLibrariesTest, backend-cn1lib-test.sh (archetype-smoke,
JVM and native) and gradle-cn1lib-test.sh; documented in the developer guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide's snippet gate requires every source block to come from
docs/demos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ compose-compat: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ desktop-compat-runtime: 0 findings (no issues)
    • ✅ fxml-compiler: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ javafx-compat: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
    • ✅ swing-compat: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

ProcessAnnotationsMojoTest runs the mojo with no project; every other
helper there allows for that, and the backend-library check did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Flutter vs Codename One

Same 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.

android

9 interleaved rounds; host load 1.0, 1.74, 1.35

Metric Codename One Flutter Ratio Winner
Installed size 78.3 MB 95.8 MB 1.22x Codename One
Executable code 4.7 MB 20.6 MB 4.35x Codename One
Download size (zipped) 78.3 MB 95.8 MB 1.22x Codename One
Cold start to first frame on screen 328 ms 1216 ms 3.54x Codename One
Memory at rest 46.0 MB 79.5 MB 1.74x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 59 ms 126 ms 2.14x
longArithmetic 37 ms 37 ms 1.00x
mathTranscendental 169 ms 205 ms 1.21x
arraySequential 20 ms 21 ms 1.05x
arrayRandom 201 ms 218 ms 1.08x
objectAllocation 50 ms 30 ms 0.60x
valueEscape 7 ms 5 ms 0.71x
hashMapChurn 105 ms 185 ms 1.76x
stringBuilding 77 ms 82 ms 1.06x
recursion 44 ms 178 ms 4.04x
quicksortBench 106 ms 122 ms 1.15x
Geometric mean 1.24x

Gate: within tolerance against scripts/flutter-bench/baseline.

Android sizes are for the arm64-v8a slice a phone is delivered, on both sides; Flutter's release apk carries three ABIs and would otherwise count its engine about three times.
Android start-up and memory come from an x86_64 emulator with a software GPU. They compare the two runtimes on one machine; they are not phone timings, and a renderer that leans on the GPU is penalised more there.
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

ios

9 interleaved rounds; host load 27.9, 37.13, 33.48

Metric Codename One Flutter Ratio Winner
Installed size 108.5 MB 110.5 MB 1.02x Codename One
Executable code 17.4 MB 19.1 MB 1.09x Codename One
Download size (zipped) 80.0 MB 81.9 MB 1.02x Codename One
Cold start to first frame on screen -- -- -- not measured
Memory at rest -- -- -- not measured

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

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 scripts/flutter-bench/baseline.

iOS start-up and memory are not measured here: Flutter cannot AOT-compile for the simulator, so a simulator run would time a JIT debug build against a release build. Sizes come from release device bundles; timings need signed hardware.
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

javascript

9 interleaved rounds; host load 2.15, 1.57, 0.74

Metric Codename One Flutter Ratio Winner
Installed size 104.4 MB 122.5 MB 1.17x Codename One
Executable code 13.3 MB 25.2 MB 1.89x Codename One
Download size (zipped) 76.4 MB 84.1 MB 1.10x Codename One
Cold start to first frame on screen -- -- -- not measured
Memory at rest -- -- -- not measured

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 646 ms wrong result Flutter: wrong result
longArithmetic 5033 ms did not run Flutter: did not run
mathTranscendental 574 ms did not run Flutter: did not run
arraySequential 227 ms 82 ms 0.36x
arrayRandom 1028 ms wrong result Flutter: wrong result
objectAllocation 37 ms 27 ms 0.73x
valueEscape 149 ms 7 ms 0.05x
hashMapChurn 1034 ms 240 ms 0.23x
stringBuilding 511 ms 106 ms 0.21x
recursion 507 ms 490 ms 0.97x
quicksortBench 401 ms wrong result Flutter: wrong result
Geometric mean 0.29x

Gate: within tolerance against scripts/flutter-bench/baseline; BEHIND FLUTTER on Compute (geomean of the VM workloads) (reported, not gated: a loss to Flutter on the web is currently accepted).

the JavaScript adapter needs a Chrome DevTools driver; sizes are reported and timings are not
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

linux

9 interleaved rounds; host load 0.31, 3.06, 2.7

Metric Codename One Flutter Ratio Winner
Installed size 113.5 MB 143.8 MB 1.27x Codename One
Executable code 15.8 MB 16.1 MB 1.02x Codename One
Download size (zipped) 81.7 MB 92.9 MB 1.14x Codename One
Cold start to first frame on screen 205 ms 228 ms 1.07x Codename One
Memory at rest 90.5 MB 225.5 MB 2.49x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 8 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 76 ms 234 ms 3.08x
longArithmetic 61 ms 65 ms 1.07x
mathTranscendental 211 ms 238 ms 1.13x
arraySequential 21 ms 40 ms 1.91x
arrayRandom 254 ms 279 ms 1.10x
objectAllocation 35 ms 41 ms 1.17x
valueEscape 4 ms 13 ms 3.25x
hashMapChurn 42 ms 304 ms 7.24x
stringBuilding 31 ms 120 ms 3.87x
recursion 96 ms 207 ms 2.16x
quicksortBench 152 ms 151 ms 0.99x
Geometric mean 1.97x

Gate: OUTSIDE THE BASELINE against scripts/flutter-bench/baseline. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6139 --reason "<why these moved>" baseline-linux.json, then commit the overlay it writes.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

windows

9 interleaved rounds

Metric Codename One Flutter Ratio Winner
Installed size 108.4 MB 121.1 MB 1.12x Codename One
Executable code 11.8 MB 14.1 MB 1.20x Codename One
Download size (zipped) 78.1 MB 86.4 MB 1.11x Codename One
Cold start to first frame on screen 158 ms 262 ms 1.57x Codename One
Memory at rest 57.3 MB 93.0 MB 1.62x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 80 ms 184 ms 2.30x
longArithmetic 60 ms 58 ms 0.97x
mathTranscendental 198 ms 267 ms 1.35x
arraySequential 11 ms 35 ms 3.18x
arrayRandom 260 ms 294 ms 1.13x
objectAllocation 25 ms 40 ms 1.60x
valueEscape 1 ms 7 ms 7.00x
hashMapChurn 48 ms 313 ms 6.52x
stringBuilding 34 ms 122 ms 3.59x
recursion 198 ms 256 ms 1.29x
quicksortBench 143 ms 146 ms 1.02x
Geometric mean 2.11x

Gate: within tolerance against scripts/flutter-bench/baseline.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

Codename One wins 21 of 21 measured metrics across 5 platform(s).

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

@shai-almog

shai-almog commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 195 screenshots: 195 matched.

Native Android coverage

  • 📊 Line coverage: 19.19% (56038/292047 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 18.14% (269997/1488151), branch 12.40% (19633/158314), complexity 10.36% (15811/152567), method 15.72% (11379/72383), class 27.88% (2235/8017)
    • Lowest covered classes
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2396 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • androidx.compose.runtime.androidx.compose.runtime.LinkComposer – 0.00% (0/1430 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlinx.coroutines.channels.kotlinx.coroutines.channels.BufferedChannel – 0.00% (0/863 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/744 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/630 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 19.19% (56038/292047 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 18.14% (269997/1488151), branch 12.40% (19633/158314), complexity 10.36% (15811/152567), method 15.72% (11379/72383), class 27.88% (2235/8017)
    • Lowest covered classes
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2396 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • androidx.compose.runtime.androidx.compose.runtime.LinkComposer – 0.00% (0/1430 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlinx.coroutines.channels.kotlinx.coroutines.channels.BufferedChannel – 0.00% (0/863 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/744 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/630 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 198ms / native 101ms = 1.9x speedup
SIMD float-mul (64K x300) java 166ms / native 137ms = 1.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 87.000 ms
Base64 CN1 decode 84.000 ms
Base64 native encode 441.000 ms
Base64 encode ratio (CN1/native) 0.197x (80.3% faster)
Base64 native decode 268.000 ms
Base64 decode ratio (CN1/native) 0.313x (68.7% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 231 screenshots: 231 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 192 screenshots: 192 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 630 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 59ms / native 7ms = 8.4x speedup
SIMD float-mul (64K x300) java 52ms / native 2ms = 26.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 69.000 ms
Base64 CN1 decode 69.000 ms
Base64 native encode 705.000 ms
Base64 encode ratio (CN1/native) 0.098x (90.2% faster)
Base64 native decode 362.000 ms
Base64 decode ratio (CN1/native) 0.191x (80.9% faster)
Base64 SIMD encode 71.000 ms
Base64 encode ratio (SIMD/CN1) 1.029x (2.9% slower)
Base64 SIMD decode 61.000 ms
Base64 decode ratio (SIMD/CN1) 0.884x (11.6% faster)
Base64 encode ratio (SIMD/native) 0.101x (89.9% faster)
Base64 decode ratio (SIMD/native) 0.169x (83.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.571x (42.9% faster)
Image applyMask (SIMD off) 56.000 ms
Image applyMask (SIMD on) 52.000 ms
Image applyMask ratio (SIMD on/off) 0.929x (7.1% faster)
Image modifyAlpha (SIMD off) 50.000 ms
Image modifyAlpha (SIMD on) 35.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.700x (30.0% faster)
Image modifyAlpha removeColor (SIMD off) 46.000 ms
Image modifyAlpha removeColor (SIMD on) 33.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.717x (28.3% faster)

@shai-almog

shai-almog commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 196 screenshots: 196 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 626 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 62ms / native 4ms = 15.5x speedup
SIMD float-mul (64K x300) java 60ms / native 3ms = 20.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 55.000 ms
Base64 CN1 decode 59.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.444x (55.6% faster)
Image applyMask (SIMD off) 62.000 ms
Image applyMask (SIMD on) 69.000 ms
Image applyMask ratio (SIMD on/off) 1.113x (11.3% slower)
Image modifyAlpha (SIMD off) 73.000 ms
Image modifyAlpha (SIMD on) 62.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.849x (15.1% faster)
Image modifyAlpha removeColor (SIMD off) 55.000 ms
Image modifyAlpha removeColor (SIMD on) 53.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.964x (3.6% faster)

ParparVM vs HotSpot (JDK 25): macOS arm64

Runner CPU: Apple M1 (Virtual) (baseline macos-arm64)

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 vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (HelloCodenameOne) 3 0.97x (base 0.96x, +1.3%) 0.88x (base 0.93x, -4.6%) ok
translator (self) 3 0.61x (base 0.62x, -2.3%) 0.84x (base 0.78x, +7.2%) ok
intArithmetic 3 1.05x (base 1.03x, +1.2%) 0.12x (base 0.12x, +1.8%) ok
longArithmetic 3 1.06x (base 1.03x, +3.2%) 0.11x (base 0.07x, +60.0%) ok
mathTranscendental 3 0.99x (base 1.01x, -2.1%) 0.12x (base 0.12x, -0.6%) ok
arraySequential 3 0.44x (base 0.42x, +4.9%) 0.53x (base 0.53x, +0.0%) ok
arrayRandom 3 0.99x (base 0.99x, +0.4%) 0.32x (base 0.32x, -0.0%) ok
objectAllocation 3 1.02x (base 1.11x, -7.4%) 0.89x (base 0.72x, +22.3%) ok
valueEscape 3 0.51x (base 0.51x, -0.0%) 0.08x (base 0.09x, -5.9%) ok
hashMapChurn 3 1.04x (base 1.18x, -11.9%) 0.07x (base 0.07x, +3.6%) ok
stringBuilding 3 0.95x (base 0.84x, +12.3%) 0.45x (base 0.46x, -1.9%) ok
recursion 3 1.23x (base 1.24x, -0.6%) 0.12x (base 0.12x, -0.0%) ok
quicksort 3 0.99x (base 1.01x, -1.8%) 0.11x (base 0.11x, +0.7%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Apple Watch (watchOS / Core Graphics)

Compared 253 screenshots: 247 matched, 2 updated, 4 missing references.

  • KmpCompatLayout — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-watch/KmpCompatLayout.png.

    KmpCompatLayout
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as KmpCompatLayout.png in workflow artifacts.

  • KmpCompatList — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-watch/KmpCompatList.png.

    KmpCompatList
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as KmpCompatList.png in workflow artifacts.

  • KmpCompatState — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-watch/KmpCompatState.png.

    KmpCompatState
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as KmpCompatState.png in workflow artifacts.

  • KmpCompatTypography — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-watch/KmpCompatTypography.png.

    KmpCompatTypography
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as KmpCompatTypography.png in workflow artifacts.

  • Sheet — updated screenshot. Screenshot differs (416x496 px, bit depth 8).

    Sheet
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as Sheet.png in workflow artifacts.

  • TabsAnimatedIndicatorScreenshotTest — updated screenshot. Screenshot differs (208x248 px, bit depth 8).

    TabsAnimatedIndicatorScreenshotTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70.
    Full-resolution PNG saved as TabsAnimatedIndicatorScreenshotTest.png in workflow artifacts.

@shai-almog

shai-almog commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

Apple TV (tvOS / Metal)

Compared 188 screenshots: 171 matched, 13 updated, 4 missing references.

  • AnimateHierarchyScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    AnimateHierarchyScreenshotTest
    Preview info: JPEG preview quality 50; JPEG preview quality 50; downscaled to 1344x756.
    Full-resolution PNG saved as AnimateHierarchyScreenshotTest.png in workflow artifacts.

  • AnimateLayoutScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    AnimateLayoutScreenshotTest
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 1344x756.
    Full-resolution PNG saved as AnimateLayoutScreenshotTest.png in workflow artifacts.

  • AnimateUnlayoutScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    AnimateUnlayoutScreenshotTest
    Preview info: JPEG preview quality 50; JPEG preview quality 50; downscaled to 1344x756.
    Full-resolution PNG saved as AnimateUnlayoutScreenshotTest.png in workflow artifacts.

  • KmpCompatLayout — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-tv/KmpCompatLayout.png.

    KmpCompatLayout
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 1920x1080.
    Full-resolution PNG saved as KmpCompatLayout.png in workflow artifacts.

  • KmpCompatList — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-tv/KmpCompatList.png.

    KmpCompatList
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 1920x1080.
    Full-resolution PNG saved as KmpCompatList.png in workflow artifacts.

  • KmpCompatState — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-tv/KmpCompatState.png.

    KmpCompatState
    Preview info: JPEG preview quality 50; JPEG preview quality 50; downscaled to 1920x1080.
    Full-resolution PNG saved as KmpCompatState.png in workflow artifacts.

  • KmpCompatTypography — missing reference. Reference screenshot missing at /Users/runner/work/CodenameOne/CodenameOne/scripts/ios/screenshots-tv/KmpCompatTypography.png.

    KmpCompatTypography
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 1920x1080.
    Full-resolution PNG saved as KmpCompatTypography.png in workflow artifacts.

  • MorphTransitionScrolledSourceTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    MorphTransitionScrolledSourceTest
    Preview info: JPEG preview quality 70; JPEG preview quality 70; downscaled to 1344x756.
    Full-resolution PNG saved as MorphTransitionScrolledSourceTest.png in workflow artifacts.

  • PullToRefreshSpinnerScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    PullToRefreshSpinnerScreenshotTest
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 1920x1080.
    Full-resolution PNG saved as PullToRefreshSpinnerScreenshotTest.png in workflow artifacts.

  • SheetSlideUpAnimationScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    SheetSlideUpAnimationScreenshotTest
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 1920x1080.
    Full-resolution PNG saved as SheetSlideUpAnimationScreenshotTest.png in workflow artifacts.

  • SmoothScrollScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    SmoothScrollScreenshotTest
    Preview info: JPEG preview quality 20; JPEG preview quality 20; downscaled to 1344x756.
    Full-resolution PNG saved as SmoothScrollScreenshotTest.png in workflow artifacts.

  • StatusBarTapDiagnosticScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    StatusBarTapDiagnosticScreenshotTest
    Preview info: JPEG preview quality 60; JPEG preview quality 60; downscaled to 1344x756.
    Full-resolution PNG saved as StatusBarTapDiagnosticScreenshotTest.png in workflow artifacts.

  • StickyHeaderFadeTransitionScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    StickyHeaderFadeTransitionScreenshotTest
    Preview info: JPEG preview quality 30; JPEG preview quality 30; downscaled to 1344x756.
    Full-resolution PNG saved as StickyHeaderFadeTransitionScreenshotTest.png in workflow artifacts.

  • StickyHeaderScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    StickyHeaderScreenshotTest
    Preview info: JPEG preview quality 40; JPEG preview quality 40; downscaled to 1344x756.
    Full-resolution PNG saved as StickyHeaderScreenshotTest.png in workflow artifacts.

  • StickyHeaderSlideTransitionScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    StickyHeaderSlideTransitionScreenshotTest
    Preview info: JPEG preview quality 30; JPEG preview quality 30; downscaled to 1344x756.
    Full-resolution PNG saved as StickyHeaderSlideTransitionScreenshotTest.png in workflow artifacts.

  • TabsAnimatedIndicatorScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    TabsAnimatedIndicatorScreenshotTest
    Preview info: JPEG preview quality 10; JPEG preview quality 10; downscaled to 1920x1080.
    Full-resolution PNG saved as TabsAnimatedIndicatorScreenshotTest.png in workflow artifacts.

  • TensileBounceScreenshotTest — updated screenshot. Screenshot differs (3840x2160 px, bit depth 8).

    TensileBounceScreenshotTest
    Preview info: JPEG preview quality 30; JPEG preview quality 30; downscaled to 1344x756.
    Full-resolution PNG saved as TensileBounceScreenshotTest.png in workflow artifacts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 901 total, 0 failed, 55 skipped

Benchmark Results

  • Execution Time: 10882 ms

  • Hotspots (Top 20 sampled methods):

    • 14.15% com.codename1.tools.translator.IteratorEscape.mangle (228 samples)
    • 8.69% java.lang.System.identityHashCode (140 samples)
    • 5.71% java.util.ArrayList.indexOf (92 samples)
    • 4.28% java.lang.Object.hashCode (69 samples)
    • 3.35% com.codename1.tools.translator.BytecodeMethod.equals (54 samples)
    • 3.17% java.lang.StringBuilder.append (51 samples)
    • 1.61% com.codename1.tools.translator.bytecodes.Invoke.findMethodUp (26 samples)
    • 1.43% java.util.HashMap.putVal (23 samples)
    • 1.30% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (21 samples)
    • 1.30% java.util.HashMap.hash (21 samples)
    • 1.24% com.codename1.tools.translator.Parser.cullMethods (20 samples)
    • 1.24% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (20 samples)
    • 1.12% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (18 samples)
    • 1.12% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (18 samples)
    • 1.06% java.io.FileOutputStream.writeBytes (17 samples)
    • 1.06% com.codename1.tools.translator.BytecodeMethod.intrinsifyForEach (17 samples)
    • 0.99% com.codename1.tools.translator.ReachabilityCull.run (16 samples)
    • 0.99% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (16 samples)
    • 0.87% java.lang.String.equals (14 samples)
    • 0.81% com.codename1.tools.translator.classfile.analysis.Frame.execute (13 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

shai-almog and others added 2 commits November 1, 2026 04:51
The Metal, tvOS and watchOS suites captured these differently on master
before this branch, and the KmpCompat tests had no reference at all.
Taken from run 41192866461's artifacts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viewSafeAreaInsetsDidChange is not sent to a view a presented controller
covers, so a rotation under one left landscape insets in place once the
app was back in portrait: forms with a safe area were squeezed between
the old notch margins and lost their top inset. The insets are now
refreshed wherever the size is (#6080's cn1PublishViewSizeIfChanged).

The goldens these broken captures replaced go back to the originals;
only the KmpCompat references, which had none, stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog
shai-almog merged commit 13882fb into master Nov 1, 2026
@shai-almog
shai-almog deleted the cn1lib-backend-part branch November 1, 2026 14:58
shai-almog added a commit that referenced this pull request Nov 2, 2026
…rea goldens

The method sat inside the non-Metal-Catalyst branch of the layout hooks, while
viewSafeAreaInsetsDidChange calls it on every UIKit slice, so the Mac Catalyst
build failed with -Wobjc-method-access. It now precedes that #if.

Reading the insets with the view size (#6139) gives the first forms their
status-bar inset: the animation captures on Metal and the watch Sheet now draw
it, identically on master's run 41407471851 and this PR's run 41386600541.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shai-almog added a commit that referenced this pull request Nov 4, 2026
* javafx-compat: list property content events, bound cell graphic, ObservableValue.map, Region.insetsProperty, ImageView fit CSS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Mapping processor: canonical names for nested types, map inherited properties

Nested class/enum field types were emitted as binary names (Outer$Inner),
which javac rejects in source. Properties inherited from a non-@mapped
base class were silently dropped by the generated mapper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Default network error path no longer blocks the EDT with a modal prompt

An HTTP error code is not a crash, so Lifecycle no longer sends the log for
it; the simulator's built_by_user prompt is skipped on the EDT or headless.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Storage entry size no longer spins forever on a stream that ends

The default getStorageEntrySize looped until skip() answered -1, but
skip() answers 0 at the end of a stream, so an implementation without its
own override hung its background thread on the first cached image.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: load http and https images in the background, cached in Storage

Image downloads a remote URL through ConnectionRequest.downloadImageToStorage,
the cache URLImage uses, and tells the views showing it when it arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: wrapText wraps a Label onto several lines

A Label with wrapText on now has a horizontal content bias, a preferred
height of its text wrapped at the given width, and a native peer
(WrappingLabel) that paints the wrapped lines. VBox, HBox and ScrollPane
already ask for height-for-width, so a column of wrapping labels in a
fit-to-width scroll pane gets the right height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* getStorageEntrySize is abstract; every implementation asks its own storage

Reading an entry through to count it was slow, and the loop the default
used never ended on a stream whose skip() honours its contract. The native
Linux and Windows ports ask the file length, the headless implementations
the stored array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Review fixes: no view leak or poisoned cache in remote images, lazy map/flatMap

- Image holds view listeners only while a remote load is pending, and drops a
  cached entry that failed to decode so the next request downloads again.
- DerivedValue observes its source only while it is observed itself.
- WrappingLabel caches its lines per text, font and width; tabs break.
- The mapping processor skips an inherited field whose type is a type
  variable of the superclass instead of mapping it erased.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* WrappingLabel: tabs break lines the same way in layout and paint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: a labeled control with a graphic gives up theme padding before letters

A tab bar of icon-over-text toggle buttons on a phone theme cut "Home" to
"Ho..." between margins wide enough for the word: fitPadding refused to shed
anything once a graphic was set. The theme's part of the padding is now given
up as it is without a graphic; the graphic's own room never is, and the
graphic is placed against the padding that remains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: a labeled control's minimum width keeps its graphic's room

computeMinWidth counted the whole padding as sheddable, graphic room
included, while fitPadding only gives up theme padding; a control
shrunk to its minimum lost the text to the graphic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: a cell's graphic fits the cell, and rows measure at their width

Cell laid its graphic out at its preferred width, so a list cell with
wrapping text drew it on one line past the edge of the list. The graphic
is now no wider than the cell, as in JavaFX, and is as tall as it is at
that width; RowFlow measures the row height at the column width and
measures again when that changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Smooth touch scrolling and press repaints in the JavaFX layer

- Lists and scroll panes glide on after a touch drag, decelerating the
  way a UIScrollView does (runtime Fling, driven by the frame clock).
  They used to stop dead the moment the finger lifted.
- A native button's own repaint (its pressed state) now goes through its
  node, so it no longer paints over the graphic drawn above it or
  outside the clips and effects of its ancestors. A touched tab lost
  its icon until the next full repaint.
- ParentPeer's layout reports overlap support, so a peer that repaints
  alone also repaints the siblings drawn over it.
- Component skips a backdrop blur that its own opaque fill hides; the
  iOS theme's text field blur was most of the time a frame took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: clip to a shape's outline, fit text fields and lists to their CSS, auto-hide touch scroll bars; JavaSE measures text unzoomed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: keep an opaque region's shadow when a change inside it moves nothing

A press on a tab button re-captured and re-blurred the whole shadowed
navigation drawer, on press and on release. A shadow is made from the
outline of what is drawn, so a paint-only change (colour, opacity,
pressed state) inside a region whose opaque, square, unclipped
background fill covers its box cannot change it. Measured in the new
test: 5 presses made 5 captures before, 0 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: a list's scroll moves its rows without relaying out the scene

RowFlow.scrollTo called requestLayout on every drag or fling frame,
which cleared the size caches of every ancestor up to the scene and
laid each of them out again. A new offset changes no size: the flow now
marks only itself and asks for a pulse, whose layout pass walks the
tree and finds it. Measured in the new test: 10 drag frames laid out
the list's holder 10 times before, 0 after. ScrollPane already only
relocated its content; the test holds that too (0 content or row
layouts over 20 offset changes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: keep a phone's scene out of the status bar and fill the strip with its background

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert every change outside the JavaFX layer to master

The layer no longer needs them; the headless test harness answers a
stored entry's size from its own map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "javafx-compat: a list's scroll moves its rows without relaying out the scene"

Recycled rows were filled with their new item but never laid out again,
so a row showed the previous item's description while scrolling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: rebuild a shadow picture after the paint, never during it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: stretch a touch scroll past its ends and spring back

A drag past the top or bottom of a ScrollPane or a list moves the
content with UIScrollView's rubber-band resistance, a glide that reaches
an end carries on and returns, and the row a drag began on loses its
pressed look once the drag becomes a scroll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: take a drag from its first pixel, and press without restyling the scene

Codename One held every drag back until it crossed 5% of the screen,
because the scene's components answered not draggable; the stage forms
now claim drags over the scene, which tells a click from a drag itself.

A pseudo-class some rule asks of an ancestor compound made any node in
that state restyle everything below it, so pressing a tab restyled the
whole scene twice per tap (27-112 ms each on the iOS simulator). It now
counts only on a node that has the rest of that compound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: survive Codename One's shape clip bug, and re-pad a label whose graphic grew

A rounded clip is narrowed by every rectangle painted inside it; Codename
One's intersection throws when a curve ends a fraction of a pixel from
the rectangle, which took the app down on iOS on a scrolled card list.
Clip paths now end every segment on a whole pixel, and narrowing a shape
clip falls back to a rectangle if it still throws.

A label padded its text for its graphic once, when styled; an icon whose
font arrived later grew past that padding and was drawn over the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: keep desktop mouse drags free of overscroll and fling

A mouse drag on the desktop (a ListView's rows, a pannable ScrollPane)
stretched past the ends and glided on after release, which JavaFX on the
desktop never does. Both now feed the spring and the glide only on a
touch screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: place a label's graphic without the theme padding a bare label does not have

The graphic was placed as if the label kept its theme's padding, which a
bare label is drawn without: under the iOS theme every titled card drew
its icon over the first letters. Also removes a scratch probe test that
was committed by mistake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reseed the Android DesktopCompatFxData golden for whole-pixel clip edges

The JavaFX layer now snaps a clip path to device pixels; the list's
antialiased edges move by at most 17/255 on 998 pixels. Identical on
the Default, JDK 17 and JDK 21 legs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reseed the macOS DesktopCompatFxData golden for the ListView border edge

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: let accessibility activate nodes that handle clicks

A region with an onMouseClicked handler had no accessibility action, so
VoiceOver, TalkBack and the MCP UI tools could not press a card or a list
row. Its peer now offers activate, which taps the middle of the peer through
the form so the scene delivers press, release and click as for a finger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: deliver accessibility activation to the node itself

Firing press, release and click at the node, instead of tapping the
centre through the form, keeps a child over the centre, a transform or a
scrolled-off node from taking the press. Only handlers count (a filter on
every mouse event tracks hovering), types above MOUSE_CLICKED count, a
disabled node offers nothing, and only the action this layer added is
ever removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* javafx-compat: cn1HandlesClicks counts handlers only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Reseed DesktopCompatFxData on iOS Metal, Metal 27, watch and Catalyst

The ListView border is now snapped edge by edge, as on Android and macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* iOS: define cn1ReadSafeAreaInsets on Catalyst and tvOS; reseed safe-area goldens

The method sat inside the non-Metal-Catalyst branch of the layout hooks, while
viewSafeAreaInsetsDidChange calls it on every UIKit slice, so the Mac Catalyst
build failed with -Wobjc-method-access. It now precedes that #if.

Reading the insets with the view size (#6139) gives the first forms their
status-bar inset: the animation captures on Metal and the watch Sheet now draw
it, identically on master's run 41407471851 and this PR's run 41386600541.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* iOS screenshots: reseed tvOS animation goldens with the safe-area inset

tvOS now reads its safe-area insets on the Metal path too, so the animation
frames carry the title bar's top inset, as Metal iPhone does. Taken from run
41466125366's tv-ui-tests artifacts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant