Skip to content

Java class library additions for ParparVM (split from #5980) - #6044

Merged
shai-almog merged 63 commits into
masterfrom
java-api-additions
Oct 22, 2026
Merged

shai-almog merged 63 commits into
masterfrom
java-api-additions

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Split out of #5980 so the class library can be reviewed and merged on its own. The desktop compatibility layer will rebase onto this.

What is in it

  • Pure-logic JDK API in vm/JavaAPI, mirrored as compile stubs in Ports/CLDC11: java.util.function, java.util.stream, java.time (temporal, chrono, format), java.text, collections, java.util.concurrent, non-file java.io streams, readers and writers, java.lang additions, MessageDigest/SecureRandom, java.nio.charset, UUID.
  • A narrow com.codename1.impl.JdkHost, installed by the ParparVM ports, offering only what those classes cannot do alone. Each member is justified in the class comment:
    • EDT-safe blocking through invokeAndBlock
    • logging a task that threw
    • random bytes and digests
    • locale number symbols
  • String regex members are rewritten in every build, on every target, to com.codename1.util.regex.StringRegex. That covers matches, both split overloads, replaceAll and replaceFirst, called directly or through a method reference. There is now one engine everywhere. Previously matches was not rewritten at all, and the old fallback engine silently treated a bad pattern as literal text. The rule is unconditional by design; see the comment on BytecodeCompliance.createInvocationRewriteRules, which is guarded by tests.
  • Translator and runtime support for the above (natives, JS bindings, record lowering).
  • Tests:
    • Bulk HotSpot-vs-ParparVM conformance checks.
    • theStringRegexRewriteIsUnconditional and everyRegexMemberOfStringIsRewritten.
    • Device-level matches/split cases in hellocodenameone's StringApiTest.

Deliberately not in it

  • No class loaders, modules or ServiceLoader.
  • File, java.nio.file, java.util.prefs, java.util.logging, URL and ResourceBundle are unchanged from master. They will follow as declarations plus build-time rewrites onto Codename One APIs (FileSystemStorage, Preferences, Log), so each behaves the same on every target.

Verified locally

  • JavaAPI, the translator and the full maven install build.
  • BulkConformanceIntegrationTest, JavascriptRuntimeSemanticsTest, CldcJavaApiParityTest and BytecodeComplianceTest pass.
  • SpotBugs reports zero findings on every gated module.
  • The cast-semantics, control-character, @author and @since gates pass.

🤖 Generated with Claude Code

shai-almog and others added 4 commits October 17, 2026 15:07
java.util.function, java.util.stream, java.time, java.text, collections,
java.util.concurrent, non-file java.io streams, java.lang members,
MessageDigest/SecureRandom, charsets and UUID. Host-backed APIs (files,
nio.file, prefs, logging, URL, resource bundles, service loader, modules)
are left as on master. JdkHost is a narrow internal hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CoreJdkHost serves the EDT waits, log, secure random, digests and locale
number symbols; JavaSE and Android carry a copy of JdkHost for the core.

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

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T11:37:22.081661Z be12291 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 17, 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 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 12 screenshots: 12 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 178 screenshots: 178 matched.

Native Android coverage

  • 📊 Line coverage: 17.40% (30688/176354 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 15.70% (144956/923169), branch 10.66% (10013/93896), complexity 8.22% (7449/90604), method 12.01% (5157/42930), class 20.74% (1059/5105)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 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/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 17.40% (30688/176354 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 15.70% (144956/923169), branch 10.66% (10013/93896), complexity 8.22% (7449/90604), method 12.01% (5157/42930), class 20.74% (1059/5105)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 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/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 114ms / native 79ms = 1.4x speedup
SIMD float-mul (64K x300) java 92ms / native 67ms = 1.3x 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 38.000 ms
Base64 CN1 decode 45.000 ms
Base64 native encode 354.000 ms
Base64 encode ratio (CN1/native) 0.107x (89.3% faster)
Base64 native decode 253.000 ms
Base64 decode ratio (CN1/native) 0.178x (82.2% faster)
Image encode benchmark status skipped (SIMD unsupported)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f94e2d35f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CodenameOne/src/com/codename1/impl/CoreJdkHost.java Outdated
Comment thread vm/JavaAPI/src/java/lang/Character.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/FutureTask.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/Delays.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/FutureTask.java Outdated
@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

shai-almog and others added 2 commits October 17, 2026 19:51
- No object serialization: ObjectInput, ObjectOutput and Externalizable are
  back to master's empty interfaces in vm/JavaAPI and gone from Ports/CLDC11.
- Concurrency reads one monotonic clock (BlockingWait.now, System.nanoTime)
  for every deadline and delay, so a wall-clock change cannot fire a timed
  wait or a scheduled task early or late.
- A positive timeout under a millisecond is rounded up instead of being
  due immediately (BlockingWait.millis), at every timed call site.
- FutureTask consumes the runner's interrupt only when cancel(true)
  delivered it; cancel(false) leaves the thread's status alone.
- Character: the unassigned Greek code points are not letters.
- CoreJdkHost finds the locale's separators between any script's decimal
  digits, not only ASCII ones.
- Bulk checks: sub-millisecond timed get, cancel(false) interrupt status.
- CI: copyright exclusions for the Harmony/OpenJDK-derived classes, the
  backend javadoc run no longer documents the class library's internal
  com.codename1.impl, CodeQL no longer resolves the JDK's SecureRandom to
  the device class library's copy, and the flutter-bench size overlay.

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

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 57ms / native 5ms = 11.4x speedup
SIMD float-mul (64K x300) java 73ms / native 4ms = 18.2x 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 gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 97.000 ms
Base64 CN1 decode 100.000 ms
Base64 SIMD encode 115.000 ms
Base64 encode ratio (SIMD/CN1) 1.186x (18.6% slower)
Base64 SIMD decode 100.000 ms
Base64 decode ratio (SIMD/CN1) 1.000x (0.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 10.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 48.000 ms
Image applyMask (SIMD on) 46.000 ms
Image applyMask ratio (SIMD on/off) 0.958x (4.2% faster)
Image modifyAlpha (SIMD off) 46.000 ms
Image modifyAlpha (SIMD on) 33.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.717x (28.3% faster)
Image modifyAlpha removeColor (SIMD off) 58.000 ms
Image modifyAlpha removeColor (SIMD on) 28.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.483x (51.7% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline windows-x64@amd64-family-25-model-1-authenticamd)

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 (WinHelloMain) 4 1.46x (base 1.22x, +19.6%) 0.73x (base 0.94x, -22.5%) ok
translator (self) 4 0.81x (base 0.60x, +34.3%) 0.54x (base 0.54x, +0.5%) ok
intArithmetic 4 1.10x (base 1.10x, +0.0%) 0.06x (base 0.06x, +2.6%) ok
longArithmetic 4 1.14x (base 1.08x, +5.0%) 0.06x (base 0.05x, +3.4%) ok
mathTranscendental 4 0.78x (base 0.79x, -0.8%) 0.06x (base 0.06x, +2.8%) ok
arraySequential 4 1.36x (base 1.36x, -0.6%) 0.39x (base 0.39x, +0.4%) ok
arrayRandom 4 1.16x (base 1.06x, +9.1%) 0.23x (base 0.23x, +0.7%) ok
objectAllocation 4 1.52x (base 1.56x, -2.7%) 0.30x (base 0.39x, -21.6%) ok
valueEscape 4 0.10x (base 0.10x, +0.4%) 0.05x (base 0.04x, +5.6%) ok
hashMapChurn 4 1.89x (base 1.80x, +4.9%) 0.09x (base 0.09x, -2.0%) ok
stringBuilding 4 1.28x (base 1.22x, +5.7%) 0.27x (base 0.32x, -17.1%) ok
recursion 4 1.41x (base 1.49x, -5.9%) 0.06x (base 0.06x, +1.5%) ok
quicksort 4 1.11x (base 1.13x, -2.5%) 0.12x (base 0.12x, +0.9%) ok

Result: no regression

@github-actions

github-actions Bot commented Oct 17, 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 0.76, 1.97, 1.68

Metric Codename One Flutter Ratio Winner
Installed size 78.2 MB 95.8 MB 1.23x Codename One
Executable code 4.6 MB 20.6 MB 4.43x Codename One
Download size (zipped) 78.2 MB 95.8 MB 1.23x Codename One
Cold start to first frame on screen 392 ms 1682 ms 4.14x Codename One
Memory at rest 46.5 MB 87.3 MB 1.88x 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 90 ms 188 ms 2.09x
longArithmetic 65 ms 58 ms 0.89x
mathTranscendental 226 ms 355 ms 1.57x
arraySequential 26 ms 35 ms 1.35x
arrayRandom 323 ms 479 ms 1.48x
objectAllocation 70 ms 47 ms 0.67x
valueEscape 8 ms 7 ms 0.88x
hashMapChurn 141 ms 305 ms 2.16x
stringBuilding 97 ms 134 ms 1.38x
recursion 85 ms 277 ms 3.26x
quicksortBench 129 ms 155 ms 1.20x
Geometric mean 1.40x

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.

javascript

9 interleaved rounds; host load 2.2, 1.27, 0.54

Metric Codename One Flutter Ratio Winner
Installed size 103.9 MB 122.5 MB 1.18x Codename One
Executable code 12.8 MB 25.2 MB 1.96x Codename One
Download size (zipped) 76.3 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 645 ms wrong result Flutter: wrong result
longArithmetic 5267 ms did not run Flutter: did not run
mathTranscendental 569 ms did not run Flutter: did not run
arraySequential 229 ms 82 ms 0.36x
arrayRandom 959 ms wrong result Flutter: wrong result
objectAllocation 38 ms 27 ms 0.71x
valueEscape 154 ms 7 ms 0.04x
hashMapChurn 1084 ms 241 ms 0.22x
stringBuilding 524 ms 106 ms 0.20x
recursion 507 ms 488 ms 0.96x
quicksortBench 405 ms wrong result Flutter: wrong result
Geometric mean 0.28x

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.36, 3.15, 2.7

Metric Codename One Flutter Ratio Winner
Installed size 111.3 MB 143.8 MB 1.29x Codename One
Executable code 14.0 MB 16.1 MB 1.15x Codename One
Download size (zipped) 80.8 MB 92.9 MB 1.15x Codename One
Cold start to first frame on screen 149 ms 249 ms 1.69x Codename One
Memory at rest 82.3 MB 223.9 MB 2.72x 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 74 ms 183 ms 2.47x
longArithmetic 65 ms 55 ms 0.85x
mathTranscendental 254 ms 276 ms 1.09x
arraySequential 16 ms 35 ms 2.19x
arrayRandom 270 ms 292 ms 1.08x
objectAllocation 24 ms 39 ms 1.62x
valueEscape 5 ms 7 ms 1.40x
hashMapChurn 51 ms 334 ms 6.55x
stringBuilding 33 ms 108 ms 3.27x
recursion 91 ms 257 ms 2.82x
quicksortBench 139 ms 149 ms 1.07x
Geometric mean 1.83x

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

macos

9 interleaved rounds; host load 2.15, 9.11, 12.43

Metric Codename One Flutter Ratio Winner
Installed size 123.9 MB 139.4 MB 1.12x Codename One
Executable code 32.8 MB 47.9 MB 1.46x Codename One
Download size (zipped) 85.5 MB 93.3 MB 1.09x Codename One
Cold start to first frame on screen 263 ms 490 ms 1.45x Codename One
Memory at rest 36.7 MB 52.7 MB 1.45x 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 115 ms 231 ms 2.01x
longArithmetic 72 ms 63 ms 0.88x
mathTranscendental 264 ms 311 ms 1.18x
arraySequential 10 ms 43 ms 4.30x
arrayRandom 245 ms 306 ms 1.25x
objectAllocation 58 ms 27 ms 0.47x
valueEscape 5 ms 14 ms 2.80x
hashMapChurn 29 ms 232 ms 8.00x
stringBuilding 21 ms 129 ms 6.14x
recursion 119 ms 284 ms 2.39x
quicksortBench 119 ms 141 ms 1.19x
Geometric mean 2.00x

Gate: within tolerance against scripts/flutter-bench/baseline. Smaller than its baseline, which does not fail the gate: Executable code -6.93%; Installed size -1.93%; Download size (zipped) -1.17% -- rebaseline to tighten. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6044 --reason "<why these moved>" baseline-macos.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 107.7 MB 121.1 MB 1.12x Codename One
Executable code 11.3 MB 14.1 MB 1.25x Codename One
Download size (zipped) 77.8 MB 86.4 MB 1.11x Codename One
Cold start to first frame on screen 110 ms 189 ms 1.75x Codename One
Memory at rest 58.2 MB 92.2 MB 1.58x 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 48 ms 122 ms 2.54x
longArithmetic 34 ms 36 ms 1.06x
mathTranscendental 133 ms 152 ms 1.14x
arraySequential 6 ms 21 ms 3.50x
arrayRandom 172 ms 216 ms 1.26x
objectAllocation 12 ms 19 ms 1.58x
valueEscape 0 ms 5 ms too fast to time
hashMapChurn 26 ms 217 ms 8.35x
stringBuilding 19 ms 72 ms 3.79x
recursion 108 ms 173 ms 1.60x
quicksortBench 111 ms 119 ms 1.07x
Geometric mean 2.03x

Gate: within tolerance against scripts/flutter-bench/baseline. Smaller than its baseline, which does not fail the gate: Executable code -10.90%; Installed size -1.24%; Download size (zipped) -0.82% -- rebaseline to tighten. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6044 --reason "<why these moved>" baseline-windows.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.

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

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00c805346b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/JavaAPI/src/java/time/Duration.java Outdated
Comment thread vm/JavaAPI/src/java/lang/Character.java Outdated
Comment thread vm/JavaAPI/src/java/lang/Math.java
Comment thread vm/JavaAPI/src/java/lang/Math.java
Comment thread vm/JavaAPI/src/java/util/concurrent/ScheduledPool.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/ScheduledPool.java
Comment thread vm/JavaAPI/src/java/io/PrintWriter.java
Comment thread CodenameOne/src/com/codename1/util/regex/Matcher.java
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

- Duration.dividedBy is exact past 292 years: the magnitude is divided as
  an unsigned 128-bit number when the nanosecond count overflows a long.
- Character: the unassigned CJK compatibility code points are not letters.
- Math.scalb's clamp counts all 53 (24) significand bits, so an extreme
  negative factor underflows to a signed zero; cbrt scales subnormals.
- ScheduledPool saturates a fixed rate's next deadline and consumes only
  the interrupt cancel(true) delivered.
- PrintWriter.checkError reports a wrapped PrintWriter's failure.
- Matcher stays exhausted after a zero-width match at the region end.
- Bulk checks for each, and MatcherExhaustionTest.

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb506da229

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/JavaAPI/src/java/lang/Character.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/Executors.java Outdated
Comment thread vm/ByteCodeTranslator/src/nativeMethods.m
Comment thread vm/JavaAPI/src/java/lang/Math.java Outdated
Comment thread vm/JavaAPI/src/java/lang/String.java Outdated
@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
Native Windows port, REAL shipping pipeline: the hellocodenameone screenshot suite rendered by a binary CROSS-COMPILED on Linux (clang-cl + xwin, WebView2 linked) and RUN on a Windows x64 runner. Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 57ms / native 5ms = 11.4x speedup
SIMD float-mul (64K x300) java 63ms / native 5ms = 12.6x 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 gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 76.000 ms
Base64 CN1 decode 90.000 ms
Base64 SIMD encode 107.000 ms
Base64 encode ratio (SIMD/CN1) 1.408x (40.8% slower)
Base64 SIMD decode 105.000 ms
Base64 decode ratio (SIMD/CN1) 1.167x (16.7% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.375x (62.5% faster)
Image applyMask (SIMD off) 29.000 ms
Image applyMask (SIMD on) 27.000 ms
Image applyMask ratio (SIMD on/off) 0.931x (6.9% faster)
Image modifyAlpha (SIMD off) 28.000 ms
Image modifyAlpha (SIMD on) 20.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.714x (28.6% faster)
Image modifyAlpha removeColor (SIMD off) 31.000 ms
Image modifyAlpha removeColor (SIMD on) 44.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.419x (41.9% slower)

@github-actions

github-actions Bot commented Oct 17, 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)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ project-model: 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.

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
Native Windows port (arm64 / Apple Silicon - Arm): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, NEON SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 50ms / native 3ms = 16.6x speedup
SIMD float-mul (64K x300) java 49ms / native 3ms = 16.3x 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 gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 60.000 ms
Base64 CN1 decode 70.000 ms
Base64 SIMD encode 78.000 ms
Base64 encode ratio (SIMD/CN1) 1.300x (30.0% slower)
Base64 SIMD decode 73.000 ms
Base64 decode ratio (SIMD/CN1) 1.043x (4.3% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 17.000 ms
Image applyMask (SIMD on) 18.000 ms
Image applyMask ratio (SIMD on/off) 1.059x (5.9% slower)
Image modifyAlpha (SIMD off) 16.000 ms
Image modifyAlpha (SIMD on) 12.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.750x (25.0% faster)
Image modifyAlpha removeColor (SIMD off) 21.000 ms
Image modifyAlpha removeColor (SIMD on) 12.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.571x (42.9% faster)

ParparVM vs HotSpot (JDK 25): Windows arm64

Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline windows-arm64@armv8-64-bit-family-8-model-d49-microsoft-corporation)

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 (WinHelloMain) 4 1.00x (base 1.11x, -9.8%) 0.64x (base 0.77x, -17.0%) ok
translator (self) 4 0.88x (base 0.84x, +5.5%) 0.48x (base 0.50x, -4.3%) ok
intArithmetic 4 1.04x (base 1.04x, +0.0%) 0.06x (base 0.06x, +3.2%) ok
longArithmetic 4 0.80x (base 0.80x, +0.0%) 0.06x (base 0.06x, +3.7%) ok
mathTranscendental 4 0.72x (base 0.72x, -0.3%) 0.07x (base 0.06x, +1.9%) ok
arraySequential 4 0.41x (base 0.46x, -10.0%) 0.39x (base 0.39x, +0.1%) ok
arrayRandom 4 0.94x (base 0.94x, +0.3%) 0.23x (base 0.23x, +0.3%) ok
objectAllocation 4 1.78x (base 2.81x, -36.7%) 0.40x (base 0.43x, -6.1%) ok
valueEscape 4 0.76x (base 0.76x, +0.0%) 0.05x (base 0.05x, +2.2%) ok
hashMapChurn 4 0.99x (base 0.98x, +0.1%) 0.12x (base 0.12x, +0.1%) ok
stringBuilding 4 1.60x (base 1.43x, +12.4%) 0.27x (base 0.27x, -0.4%) ok
recursion 4 1.55x (base 1.46x, +6.0%) 0.07x (base 0.07x, +1.3%) ok
quicksort 4 1.01x (base 1.00x, +0.5%) 0.12x (base 0.12x, +0.7%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 7763 64-Core Processor (baseline linux-x64@amd-epyc-7763-64-core-processor)

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 (LinuxHelloMain) 4 0.82x (base 0.85x, -3.0%) 0.91x (base 0.83x, +8.7%) ok
translator (self) 4 0.55x (base 0.64x, -13.8%) 0.48x (base 0.52x, -6.6%) ok
intArithmetic 4 1.12x (base 1.12x, +0.5%) 0.04x (base 0.06x, -29.2%) ok
longArithmetic 4 1.08x (base 1.08x, +0.0%) 0.04x (base 0.05x, -29.4%) ok
mathTranscendental 4 1.09x (base 1.08x, +0.4%) 0.04x (base 0.07x, -44.1%) ok
arraySequential 4 2.05x (base 2.00x, +2.0%) 0.36x (base 0.36x, +0.8%) ok
arrayRandom 4 1.01x (base 0.91x, +11.0%) 0.20x (base 0.21x, -3.1%) ok
objectAllocation 4 1.53x (base 1.65x, -7.4%) 0.27x (base 0.35x, -24.8%) ok
valueEscape 4 0.10x (base 0.10x, -0.1%) 0.03x (base 0.04x, -26.4%) ok
hashMapChurn 4 1.49x (base 1.48x, +0.7%) 0.10x (base 0.09x, +2.7%) ok
stringBuilding 4 1.29x (base 1.39x, -7.4%) 0.31x (base 0.31x, +0.2%) ok
recursion 4 1.26x (base 1.25x, +0.1%) 0.04x (base 0.08x, -46.5%) ok
quicksort 4 1.07x (base 1.07x, +0.2%) 0.10x (base 0.11x, -12.4%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

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 (LinuxHelloMain) 4 0.95x (base 1.02x, -7.3%) 0.79x (base 0.93x, -14.8%) ok
translator (self) 4 0.75x (base 0.70x, +7.3%) 0.45x (base 0.43x, +5.2%) ok
intArithmetic 4 1.04x (base 1.04x, -0.1%) 0.03x (base 0.03x, +4.8%) ok
longArithmetic 4 0.79x (base 0.79x, -0.1%) 0.03x (base 0.03x, +5.0%) ok
mathTranscendental 4 1.11x (base 1.10x, +0.8%) 0.04x (base 0.03x, +9.9%) ok
arraySequential 4 0.37x (base 0.36x, +3.3%) 0.37x (base 0.37x, +0.3%) ok
arrayRandom 4 0.93x (base 0.94x, -0.4%) 0.20x (base 0.20x, +1.0%) ok
objectAllocation 4 1.92x (base 1.77x, +8.6%) 0.37x (base 0.37x, +0.0%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +4.9%) ok
hashMapChurn 4 0.84x (base 0.84x, -0.1%) 0.12x (base 0.12x, +1.0%) ok
stringBuilding 4 1.53x (base 1.57x, -2.2%) 0.32x (base 0.26x, +20.8%) ok
recursion 4 1.56x (base 1.43x, +8.7%) 0.04x (base 0.04x, +3.1%) ok
quicksort 4 1.00x (base 0.99x, +1.0%) 0.10x (base 0.09x, +2.7%) ok

Result: no regression

- tanh: Lambert continued fraction for |x| < 1 (within 1.05 ulp).
- String(byte[], int, int, ...): range checked before the native reads it.
- Pool: a worker thread that fails to start gives its slot back.
- Character: CJK extension ranges split at their unassigned gaps.
- Recalibrate the Linux flutter size row and the windows-arm64 hello RAM row.

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

while (position < length && Character.isDigit(value.charAt(position))) {

P2 Badge Restrict duration syntax to ASCII digits

Character.isDigit() admits non-ASCII numerals and the runtime's numeric parsers accept them, so inputs such as Duration.parse("PT١S") succeed even though ISO-8601 duration syntax and the JDK parser reject them. Check explicitly for '0' through '9' in both the whole-number and fractional scans.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/JavaAPI/src/java/util/concurrent/CompletableFuture.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/CompletableFuture.java
Comment thread vm/JavaAPI/src/java/lang/Character.java Outdated
Comment thread vm/JavaAPI/src/java/lang/StringBuffer.java Outdated
Comment thread vm/JavaAPI/src/java/time/format/DateTimeFormatter.java Outdated
Comment thread vm/JavaAPI/src/java/lang/Character.java Outdated
Comment thread vm/JavaAPI/src/java/lang/StringBuffer.java Outdated
Comment thread vm/JavaAPI/src/java/time/format/DateTimeFormatter.java Outdated
Comment thread vm/JavaAPI/src/java/lang/Math.java Outdated
Comment thread vm/JavaAPI/src/java/util/concurrent/ScheduledPool.java
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

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

Benchmark Results

  • Execution Time: 9760 ms

  • Hotspots (Top 20 sampled methods):

    • 14.92% com.codename1.tools.translator.IteratorEscape.mangle (228 samples)
    • 8.31% java.util.ArrayList.indexOf (127 samples)
    • 7.40% java.lang.System.identityHashCode (113 samples)
    • 3.34% com.codename1.tools.translator.BytecodeMethod.equals (51 samples)
    • 3.27% java.lang.Object.hashCode (50 samples)
    • 2.81% java.lang.StringBuilder.append (43 samples)
    • 1.96% java.lang.String.equals (30 samples)
    • 1.90% java.util.AbstractCollection.containsAll (29 samples)
    • 1.70% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (26 samples)
    • 1.70% com.codename1.tools.translator.bytecodes.Invoke.findMethodUp (26 samples)
    • 1.57% com.codename1.tools.translator.Parser.cullMethods (24 samples)
    • 1.57% java.util.HashMap.hash (24 samples)
    • 1.37% com.codename1.tools.translator.IteratorEscape.walk (21 samples)
    • 1.18% com.codename1.tools.translator.ReachabilityCull.run (18 samples)
    • 1.18% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (18 samples)
    • 1.05% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (16 samples)
    • 0.98% com.codename1.tools.translator.classfile.tree.JsrInliner.replay (15 samples)
    • 0.98% java.util.HashMap.putVal (15 samples)
    • 0.98% com.codename1.tools.translator.BytecodeMethod.intrinsifyForEach (15 samples)
    • 0.98% com.codename1.tools.translator.classfile.analysis.Frame.merge (15 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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da29033b1e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/JavaAPI/src/java/util/Locale.java
Comment thread vm/JavaAPI/src/java/time/format/DateTimeFormatter.java
Comment thread vm/JavaAPI/src/java/time/format/DateTimeFormatter.java Outdated
Comment thread vm/JavaAPI/src/java/util/Properties.java
Comment thread vm/JavaAPI/src/java/lang/String.java
shai-almog and others added 2 commits October 21, 2026 13:28
…is not white space

Drops the windows-x64 recursion rebaseline that master's baseline fold superseded.

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f95697b7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread vm/JavaAPI/src/java/util/concurrent/CompletableFuture.java
Comment thread vm/JavaAPI/src/java/util/concurrent/ConcurrentHashMap.java
…eplaced mappings

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

Copy link
Copy Markdown
Collaborator Author

@codex review

shai-almog and others added 7 commits October 21, 2026 17:09
Conflicts: codeql paths-ignore keeps both entries; NavigationTest takes
master's comment and keeps clearStack(); the JS LDC float literal takes
master's floatLiteral and drops this branch's equivalent numericLiteral.

Baselines: master's merged pr/5976.json overlays were stale against the
base fold (both gates' self-tests failed on master); their from values are
repaired, and this PR's rows that rebaselined the same benchmarks to the
same readings are dropped. Flutter linux and javascript re-measured.

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

- Pattern matches, repeats and backtracks by code point, so "." and a
  class take a whole surrogate pair, and classes hold code points above
  U+FFFF.
- Scripts, blocks and general categories, and UNICODE_CHARACTER_CLASS
  ((?U)), are answered from the generated Unicode 15.0 tables in
  UnicodeTables rather than refused.
- UUID.randomUUID throws without a secure random source instead of
  falling back to a clock-seeded generator.
- ChoiceFormat writes an infinite limit as "<" explicitly rather than
  through a NaN comparison ParparVM answers differently.

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

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

shai-almog commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 54ms / native 3ms = 18.0x speedup
SIMD float-mul (64K x300) java 65ms / native 3ms = 21.6x 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 49.000 ms
Base64 CN1 decode 62.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 14.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 64.000 ms
Image applyMask (SIMD on) 56.000 ms
Image applyMask ratio (SIMD on/off) 0.875x (12.5% faster)
Image modifyAlpha (SIMD off) 74.000 ms
Image modifyAlpha (SIMD on) 65.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.878x (12.2% faster)
Image modifyAlpha removeColor (SIMD off) 76.000 ms
Image modifyAlpha removeColor (SIMD on) 83.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.092x (9.2% slower)

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.6%) 0.88x (base 0.93x, -4.9%) ok
translator (self) 3 0.63x (base 0.62x, +1.5%) 0.70x (base 0.58x, +21.1%) ok
intArithmetic 3 1.06x (base 1.03x, +2.5%) 0.12x (base 0.12x, +2.3%) ok
longArithmetic 3 1.03x (base 1.03x, +0.3%) 0.11x (base 0.07x, +63.1%) ok
mathTranscendental 3 0.97x (base 1.01x, -3.7%) 0.12x (base 0.12x, +1.9%) ok
arraySequential 3 0.43x (base 0.42x, +3.3%) 0.53x (base 0.53x, +0.4%) ok
arrayRandom 3 0.99x (base 0.99x, +0.0%) 0.32x (base 0.32x, +0.1%) ok
objectAllocation 3 1.07x (base 1.11x, -3.0%) 0.61x (base 0.72x, -15.1%) ok
valueEscape 3 0.51x (base 0.51x, +0.4%) 0.09x (base 0.09x, +4.9%) ok
hashMapChurn 3 1.04x (base 1.18x, -11.3%) 0.07x (base 0.07x, +0.5%) ok
stringBuilding 3 0.91x (base 0.84x, +7.7%) 0.46x (base 0.46x, -0.4%) ok
recursion 3 1.25x (base 1.24x, +0.8%) 0.12x (base 0.12x, +0.1%) ok
quicksort 3 1.01x (base 1.01x, -0.5%) 0.11x (base 0.11x, +2.2%) ok

Result: no regression

shai-almog and others added 3 commits October 22, 2026 04:27
…r every property

- A search skips the positions inside a surrogate pair when the pattern
  names a supplementary code point or a surrogate, as the JDK's StartS
  does, so a negated class no longer matches half a pair.
- Two backslash-u escapes spelling a pair are one code point, and
  \Q...\E quotes code points, inside a class and out (Pattern.quote of
  an emoji matched nothing).
- The JDK's binary properties and the general categories answer from
  UnicodeTables for all of Unicode; IsWhite_Space no longer takes
  U+001C-U+001F, and a case category under CASE_INSENSITIVE takes Lu, Ll
  and Lt as on the JDK.
- Ports/CLDC11 Random: a no-break space in a comment failed an ASCII
  compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and classes, marks in words

- A pattern with a Unicode property or a (?U) shorthand skips the
  positions inside a pair, as the JDK's search does, so [^\p{L}] no
  longer takes half a supplementary letter.
- A caseless back reference compares code points.
- A caseless Unicode class also tries the lower form of the upper one,
  so (?iu)[a-z] takes U+0131 and U+017F as on the JDK.
- \b and \B count a non-spacing mark after a letter or digit as part of
  the word, and read the lone high half before a position inside a pair.
- usePattern keeps the match and drops its groups; group(0) is null.
- \p{all}.

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

- A lookbehind may repeat one character without bound, as on JDK 21
  ("(?<=a+)b"); a group repeated without bound or a back reference
  inside one is still refused, as there.
- A quantifier repeats \R whole, so each round takes \r\n as a pair.
- Code comments on the JDK parser accidents left alone: a leading {1},
  x{1}{2}, and [a&&&b].

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

shai-almog commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 171 screenshots: 171 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

shai-almog and others added 5 commits October 22, 2026 05:21
…lded class members

- An escaped supplementary character is one atom under a quantifier.
- COMMENTS mode skips whitespace before the ? or + of a quantifier.
- A single class member under UNICODE_CASE also stands for its folded
  form, so (?iu)[ı] takes "I" as on the JDK.
- A possessive repeat of an empty group takes its round and sets it.
- (?) is refused.
- Code comments on the JDK accidents left alone: which positions inside
  a pair its search accepts, the inner groups of repeated empty groups,
  and its && grammar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	vm/selfhost/perf-baseline/pr/5976.json
#6059 rebaselined the JavaScript and Linux gallery size rows from the
same values this PR did, so those rows are dropped here to be measured
again on top of it. The x64 translator override starts from the row as
master now reads it, after #6059 removed the stale #5976 entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog
shai-almog merged commit a1a338d into master Oct 22, 2026
86 of 104 checks passed
@shai-almog
shai-almog deleted the java-api-additions branch October 22, 2026 11:19
shai-almog added a commit that referenced this pull request Oct 22, 2026
…he JS gallery sizes

dart.core.DateTime named java.util.regex, which no ParparVM target has and
nothing relocates in an ordinary application: every native Flutter build
failed on a missing java_util_regex_Pattern.h. It now uses
com.codename1.util.regex, as RegExp already did.

The PR's flutter-bench overlay justified the JavaAPI growth that moved to
#6044; its linux rows are dropped and the javascript rows recalibrated from
this PR's first gallery run on top of #6044 and #6055.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shai-almog added a commit that referenced this pull request Oct 23, 2026
…uild

A reactor build that stops before packaging (mvn test over several
modules, as the Java 8 CI leg runs) resolves the runtime to its
target/classes directory, and the remap found no runtime jar. The
directory is now read like the jar, leaving out com/codename1/impl the way
the module's jar does.

Also rebaselines the android and linux gallery sizes from their first run
on top of #6044 and #6055.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shai-almog added a commit that referenced this pull request Oct 24, 2026
…odename One apps (#5980)

* Desktop compatibility runtimes: Swing, SwingX, JavaFX and FXML over Codename One

swing-compat (java.awt, javax.swing, java.beans, javax.imageio and a SwingX
subset) is authored already relocated under com.codename1.desktopcompat;
javafx-compat is authored under the javafx names and relocated at build time.
desktop-compat-runtime holds what both layers share, including shims for the
host-backed JDK APIs a device lacks (java.io.File, java.net.URL,
java.nio.file, ResourceBundle, java.util.logging, java.util.prefs).
fxml-compiler turns FXML and JavaFX CSS into code and tables at build time.

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

* Build: one relocation pass for the Android, Swing and JavaFX layers

ClassRelocator applies every active layer in one pass; CompatRewrites
redirects the JDK members a device cannot have; the compliance check reports
unsupported desktop API under its original name. remap-compat and
import-desktop-project in Maven and Gradle, with the archetype wiring.

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

* Desktop compatibility: samples, integration tests, CI and documentation

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

* Read .properties bundles as UTF-8 first; never report AutoCloseable as Closeable

A stream bundle is UTF-8 when its bytes are well-formed UTF-8 and ISO-8859-1
otherwise, as the JDK has read them since Java 9. The compliance report no
longer reverses a shim whose target is itself a JDK class.

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

* Fix CI: drop tests of the abandoned design, keep master's Android desugaring, doc snippet roles

The four core-unittests and AndroidDesugaringDependencyTest covered the
core JDK host and the nio desugaring this PR no longer has. The nio
desugar_jdk_libs variant clashed with the Flutter Android build
(DartList.reversed), so AndroidGradleBuilder is master's again.

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

* Flutter: DateTime.parse on the framework's regex engine; rebaseline the JS gallery sizes

dart.core.DateTime named java.util.regex, which no ParparVM target has and
nothing relocates in an ordinary application: every native Flutter build
failed on a missing java_util_regex_Pattern.h. It now uses
com.codename1.util.regex, as RegExp already did.

The PR's flutter-bench overlay justified the JavaAPI growth that moved to
#6044; its linux rows are dropped and the javascript rows recalibrated from
this PR's first gallery run on top of #6044 and #6055.

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

* Flutter: DartList.reversed() clashes with Android's List.reversed()

Android API 35 gives java.util.List a reversed() answering a List, and
every Flutter plugin class extending DartList (dio's Interceptors) failed
to compile in the generated Android project. Dart's reversed getter is
now dartReversed() in Java; the transpiler emits that name.

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

* Extract the desktop runtime from its classes directory in a reactor build

A reactor build that stops before packaging (mvn test over several
modules, as the Java 8 CI leg runs) resolves the runtime to its
target/classes directory, and the remap found no runtime jar. The
directory is now read like the jar, leaving out com/codename1/impl the way
the module's jar does.

Also rebaselines the android and linux gallery sizes from their first run
on top of #6044 and #6055.

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

* Mark the fallback open dialog's identity comparison for PMD

Command.equals compares names, so the cancel and accept buttons must be
told apart by identity; master's #6052 tripped the forbidden-PMD gate.

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

* ParparVM GC: never name a thread that may have exited

A collection that cannot stop a thread records a root miss and skips the
sweep, then names each missed thread with pthread_getname_np. The thread
it could not stop is usually one that is exiting: markDeadThread
deregisters it and the pthread ends, so the recorded handle can name a
thread that no longer exists, and glibc reads its freed descriptor. The
bulk conformance run, whose pool checks start and retire many threads,
crashed with SIGSEGV in this diagnostic right after the skip line
(vm-tests, StringBuilderGrowthApp, exit 139).

The name is now read only for a handle still registered in allThreads,
under the critical section markDeadThread takes, and blocked threads are
released before that lock is taken.

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