Skip to content

Try it: edit and run every documentation snippet in place - #6054

Merged
shai-almog merged 11 commits into
masterfrom
docs-try-it-inline-playground
Oct 20, 2026
Merged

shai-almog merged 11 commits into
masterfrom
docs-try-it-inline-playground

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Every Java snippet in the developer guide, the API reference and blog posts gets a Try it button. It replaces the static block with the Playground in inline mode -- the editor holding the snippet plus a live preview -- so a reader can change the code and watch it run where they read it. Nothing of the Playground loads until the first click.

Changes

  • Page runner docs/website/static/js/cn1-snippet-runner.js, loaded on guide, javadoc and blog pages. One frame serves the whole page; opening another snippet posts the code to the running frame (about 1 s) instead of booting a second VM (about 3.6 s). javadoc-highlight-init.js delegates to it on the site and keeps the plain link in the offline javadocs.zip.
  • Playground ?mode=inline: compact editor/preview split with a Reset button. It does not read or write the reader's saved Playground state. Run results and an edited-code URL are posted to the page through WebsiteThemeNative.
  • Compiler/runner: unambiguous auto-import of class names the snippet does not import (documentation snippets omit imports). Top-level declarations with an access modifier or static become script fields.
  • Server code gets no button: guide blocks with role=cn1-no-try (backend chapters, includes from backend/src) and the backend API reference. generate_developer_guide.rb carries the role to the fence.
  • Ratchet: scripts/check-doc-snippets.py compiles every snippet the way the frame does. Snippets that do not run are listed in scripts/doc-snippet-baseline.txt (887 of 1506; 619 run as written, up from 228). New workflow check-doc-snippets.yml.

Verification

  • Headless Chromium against a local bundle: no Playground requests before the click; run, edit-and-rerun, frame reuse, compile-error display and Close all pass, with no page errors.
  • Playground syntax matrix 338/338 (new cases for fields and auto-import) and the smoke harness pass.
  • JavaCompilerConformanceTest 7/7 and the guide generator tests pass.

🤖 Generated with Claude Code

Every Java snippet in the developer guide, the API reference and blog posts
gets a "Try it" button that swaps the block for the Playground in inline
mode (editor + live preview), loaded only on click. One frame serves the
page; later snippets are posted to it instead of rebooting the VM.

- Playground ?mode=inline: compact layout, Reset, no saved-state writes;
  host page messaging through WebsiteThemeNative.
- Auto-import of names exactly one API class answers to; top-level fields
  with an access modifier or static in script mode.
- Server code (role=cn1-no-try, backend reference) gets no button.
- scripts/check-doc-snippets.py + baseline ratchet + workflow.

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 19, 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 ✅ Completed 2026-10-19T18:15:54.374381Z 73e8639 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.

@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: ce85c32dd4

ℹ️ 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 docs/website/static/js/cn1-snippet-runner.js
Comment thread vm/JavaCompiler/src/com/codename1/tools/javac/JavaSourceParser.java
Comment thread docs/website/static/js/cn1-snippet-runner.js
Comment thread scripts/check-doc-snippets.py Outdated
Comment thread scripts/check-doc-snippets.py Outdated
Comment thread scripts/check-doc-snippets.py
Comment thread docs/website/static/js/cn1-snippet-runner.js
Comment thread docs/website/static/js/cn1-snippet-runner.js Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@github-actions

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

Copy link
Copy Markdown
Collaborator Author

Compared 170 screenshots: 170 matched.

Native Android coverage

  • 📊 Line coverage: 16.01% (26006/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122186/850229), branch 9.91% (8470/85441), complexity 7.82% (6529/83503), method 11.60% (4650/40094), class 19.80% (961/4853)
    • 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: 16.01% (26006/162390 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 14.37% (122186/850229), branch 9.91% (8470/85441), complexity 7.82% (6529/83503), method 11.60% (4650/40094), class 19.80% (961/4853)
    • 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 135ms / native 43ms = 3.1x speedup
SIMD float-mul (64K x300) java 37ms / native 62ms = 0.5x 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 41.000 ms
Base64 CN1 decode 47.000 ms
Base64 native encode 318.000 ms
Base64 encode ratio (CN1/native) 0.129x (87.1% faster)
Base64 native decode 219.000 ms
Base64 decode ratio (CN1/native) 0.215x (78.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

- check-doc-snippets.py builds the Playground through its reactor (-pl common
  -am install) so the cn1lib siblings exist on a fresh runner.
- The check also covers the CLDC API sources and undelimited include-only
  source blocks, and stale baseline entries now fail.
- Script fields may carry annotations.
- Inline results carry a request id, so a stale result never lands on a newer
  snippet; failures are labelled neutrally.
- The frame takes code only from a same-origin parent; backend imports in blog
  snippets get no button.

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: d7398b7333

ℹ️ 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 .github/workflows/check-doc-snippets.yml Outdated
Comment thread scripts/check-doc-snippets.py Outdated
@github-actions

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

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 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 33ms / native 3ms = 11.0x speedup
SIMD float-mul (64K x300) java 30ms / native 3ms = 10.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 gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 35.000 ms
Base64 CN1 decode 47.000 ms
Base64 SIMD encode 54.000 ms
Base64 encode ratio (SIMD/CN1) 1.543x (54.3% slower)
Base64 SIMD decode 49.000 ms
Base64 decode ratio (SIMD/CN1) 1.043x (4.3% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 4.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.750x (25.0% faster)
Image applyMask (SIMD off) 19.000 ms
Image applyMask (SIMD on) 14.000 ms
Image applyMask ratio (SIMD on/off) 0.737x (26.3% faster)
Image modifyAlpha (SIMD off) 15.000 ms
Image modifyAlpha (SIMD on) 11.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.733x (26.7% faster)
Image modifyAlpha removeColor (SIMD off) 18.000 ms
Image modifyAlpha removeColor (SIMD on) 12.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.667x (33.3% faster)

- check-doc-snippets.py extracts the blog's Java fences, skipping the ones the
  runner skips (cn1-no-try, backend imports); 307 existing ones join the
  baseline.
- The workflow runs when any tree the guide includes Java from changes.
- Standard Codename One headers on the eight playground and javadoc files this
  PR touches that had none.

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: 19866d9f07

ℹ️ 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/JavaCompiler/src/com/codename1/tools/javac/JavaSourceParser.java Outdated
Comment thread scripts/website/generate_developer_guide.rb
Comment thread scripts/check-doc-snippets.py
…d-compat tests

- Script fields: transient and volatile mark a member as a field, like an
  access modifier or static.
- check-doc-snippets.py skips com.codename1.impl, which the javadoc build
  never publishes; two baseline entries go with it.
- generate_developer_guide.rb: note that Hugo applies fence attributes with
  its default configuration (measured), so hugo.toml needs no change.
- android-compat tests: cleanDisplay resets dark mode AND refreshes the
  cached configuration, and AutoCancelReleaseTest starts the display it needs.
  Both failed or passed with the order the classes ran in (build-linux-jdk8).

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 73e86391b5

ℹ️ 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".

Focusing the hidden text-input textarea let the browser scroll it into view,
which scrolls every scrollable ancestor -- including the host page when the app
runs in an iframe. In the documentation's inline Playground a double click in
the editor threw the page hundreds of pixels down in Firefox. The JSO bridge now
focuses with preventScroll, as does the clipboard fallback.

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

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 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 38ms / native 3ms = 12.6x speedup
SIMD float-mul (64K x300) java 38ms / native 3ms = 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 50.000 ms
Base64 CN1 decode 61.000 ms
Base64 SIMD encode 68.000 ms
Base64 encode ratio (SIMD/CN1) 1.360x (36.0% slower)
Base64 SIMD decode 66.000 ms
Base64 decode ratio (SIMD/CN1) 1.082x (8.2% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.667x (33.3% faster)
Image applyMask (SIMD off) 40.000 ms
Image applyMask (SIMD on) 44.000 ms
Image applyMask ratio (SIMD on/off) 1.100x (10.0% slower)
Image modifyAlpha (SIMD off) 37.000 ms
Image modifyAlpha (SIMD on) 89.000 ms
Image modifyAlpha ratio (SIMD on/off) 2.405x (140.5% slower)
Image modifyAlpha removeColor (SIMD off) 34.000 ms
Image modifyAlpha removeColor (SIMD on) 31.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.912x (8.8% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: Intel64 Family 6 Model 173 Stepping 1, GenuineIntel (baseline windows-x64@intel64-family-6-model-173-genuineintel)

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 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (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.26x (base 1.21x, +3.7%) 0.72x (base 0.75x, -4.0%) ok
translator (self) 4 0.74x (base 0.68x, +9.2%) 0.49x (base 0.55x, -11.4%) ok
intArithmetic 4 1.01x (base 1.01x, -0.6%) 0.05x (base 0.05x, +0.4%) ok
longArithmetic 4 1.07x (base 1.07x, +0.2%) 0.05x (base 0.05x, +0.6%) ok
mathTranscendental 4 0.89x (base 0.89x, -0.4%) 0.06x (base 0.06x, -0.6%) ok
arraySequential 4 1.35x (base 1.35x, -0.2%) 0.38x (base 0.38x, +0.3%) ok
arrayRandom 4 1.00x (base 1.00x, -0.1%) 0.23x (base 0.23x, -0.4%) ok
objectAllocation 4 1.68x (base 1.62x, +3.9%) 0.33x (base 0.32x, +2.2%) ok
valueEscape 4 0.13x (base 0.13x, -0.2%) 0.05x (base 0.05x, -0.1%) ok
hashMapChurn 4 0.95x (base 1.00x, -4.8%) 0.10x (base 0.10x, -0.8%) ok
stringBuilding 4 1.33x (base 1.25x, +7.0%) 0.23x (base 0.27x, -16.4%) ok
recursion 4 1.20x (base 1.23x, -2.3%) 0.06x (base 0.06x, +0.1%) ok
quicksort 4 1.08x (base 1.08x, +0.7%) 0.12x (base 0.12x, -0.5%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 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 54ms / native 3ms = 18.0x speedup
SIMD float-mul (64K x300) java 53ms / native 3ms = 17.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 60.000 ms
Base64 CN1 decode 70.000 ms
Base64 SIMD encode 77.000 ms
Base64 encode ratio (SIMD/CN1) 1.283x (28.3% slower)
Base64 SIMD decode 69.000 ms
Base64 decode ratio (SIMD/CN1) 0.986x (1.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.600x (40.0% faster)
Image applyMask (SIMD off) 20.000 ms
Image applyMask (SIMD on) 20.000 ms
Image applyMask ratio (SIMD on/off) 1.000x (0.0% slower)
Image modifyAlpha (SIMD off) 17.000 ms
Image modifyAlpha (SIMD on) 13.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.765x (23.5% faster)
Image modifyAlpha removeColor (SIMD off) 22.000 ms
Image modifyAlpha removeColor (SIMD on) 13.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.591x (40.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 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (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.01x (base 1.11x, -8.6%) 0.76x (base 0.75x, +0.8%) ok
translator (self) 4 0.85x (base 0.84x, +1.0%) 0.49x (base 0.51x, -3.4%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.06x (base 0.06x, +1.3%) ok
longArithmetic 4 0.79x (base 0.80x, -0.1%) 0.06x (base 0.06x, +1.6%) ok
mathTranscendental 4 0.72x (base 0.72x, -0.2%) 0.06x (base 0.06x, +0.2%) ok
arraySequential 4 0.36x (base 0.46x, -21.6%) 0.39x (base 0.39x, -0.1%) ok
arrayRandom 4 0.94x (base 0.94x, -0.1%) 0.23x (base 0.23x, +0.0%) ok
objectAllocation 4 1.82x (base 2.81x, -35.1%) 0.41x (base 0.43x, -5.0%) ok
valueEscape 4 0.76x (base 0.76x, +0.1%) 0.05x (base 0.05x, +1.8%) ok
hashMapChurn 4 1.00x (base 0.98x, +1.1%) 0.12x (base 0.12x, -0.3%) ok
stringBuilding 4 1.61x (base 1.43x, +13.1%) 0.27x (base 0.27x, -0.3%) ok
recursion 4 1.56x (base 1.46x, +6.4%) 0.06x (base 0.07x, -0.5%) ok
quicksort 4 1.00x (base 1.00x, -0.3%) 0.12x (base 0.12x, -0.2%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 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: INTEL(R) XEON(R) PLATINUM 8573C (baseline linux-x64@intel-xeon-platinum-8573c)

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 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (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.91x (base 0.94x, -3.4%) 0.78x (base 0.88x, -11.4%) ok
translator (self) 4 0.62x (base 0.67x, -6.4%) 0.43x (base 0.44x, -3.3%) ok
intArithmetic 4 1.03x (base 1.03x, +0.1%) 0.06x (base 0.07x, -24.3%) ok
longArithmetic 4 0.96x (base 0.96x, -0.1%) 0.05x (base 0.05x, +0.3%) ok
mathTranscendental 4 1.04x (base 1.03x, +0.0%) 0.06x (base 0.06x, +1.3%) ok
arraySequential 4 2.46x (base 2.69x, -8.7%) 0.37x (base 0.35x, +5.4%) ok
arrayRandom 4 1.01x (base 1.05x, -3.6%) 0.21x (base 0.21x, +0.5%) ok
objectAllocation 4 1.25x (base 1.03x, +21.0%) 0.42x (base 0.51x, -17.1%) ok
valueEscape 4 0.13x (base 0.13x, -0.5%) 0.05x (base 0.04x, +4.7%) ok
hashMapChurn 4 0.98x (base 1.00x, -2.0%) 0.11x (base 0.10x, +10.9%) ok
stringBuilding 4 1.56x (base 1.53x, +1.6%) 0.22x (base 0.22x, -2.4%) ok
recursion 4 0.93x (base 1.05x, -12.2%) 0.06x (base 0.06x, -2.5%) ok
quicksort 4 1.07x (base 1.08x, -1.0%) 0.13x (base 0.11x, +18.0%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 185 screenshots: 185 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 15% (time) / 15% (RAM) away from its baseline in vm/selfhost/perf-baseline/ fails: above it is a regression, below it an improvement that has to be rebaselined (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.93x (base 1.02x, -8.7%) 0.77x (base 0.93x, -17.9%) ok
translator (self) 4 0.73x (base 0.70x, +4.1%) 0.46x (base 0.51x, -9.2%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.03x (base 0.03x, -1.9%) ok
longArithmetic 4 0.79x (base 0.79x, -0.3%) 0.03x (base 0.03x, -1.0%) ok
mathTranscendental 4 1.10x (base 1.10x, -0.0%) 0.03x (base 0.03x, +1.3%) ok
arraySequential 4 0.38x (base 0.36x, +5.7%) 0.37x (base 0.37x, +0.2%) ok
arrayRandom 4 0.93x (base 0.94x, -0.3%) 0.20x (base 0.20x, -0.3%) ok
objectAllocation 4 1.96x (base 1.77x, +10.9%) 0.37x (base 0.38x, -3.2%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, -2.5%) ok
hashMapChurn 4 0.85x (base 0.84x, +0.6%) 0.12x (base 0.12x, -2.3%) ok
stringBuilding 4 1.49x (base 1.57x, -4.9%) 0.26x (base 0.26x, -0.1%) ok
recursion 4 1.42x (base 1.43x, -1.2%) 0.03x (base 0.04x, -2.6%) ok
quicksort 4 1.00x (base 0.99x, +0.6%) 0.09x (base 0.09x, +0.2%) ok

Result: no regression

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 833 total, 0 failed, 57 skipped

Benchmark Results

  • Execution Time: 8922 ms

  • Hotspots (Top 20 sampled methods):

    • 8.03% java.lang.System.identityHashCode (115 samples)
    • 7.33% java.util.ArrayList.indexOf (105 samples)
    • 7.05% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (101 samples)
    • 5.52% com.codename1.tools.translator.BytecodeMethod.equals (79 samples)
    • 3.98% java.lang.Object.hashCode (57 samples)
    • 3.35% java.lang.StringBuilder.append (48 samples)
    • 2.93% com.codename1.tools.translator.IteratorEscape.mangle (42 samples)
    • 2.72% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (39 samples)
    • 1.89% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (27 samples)
    • 1.89% java.util.AbstractCollection.containsAll (27 samples)
    • 1.82% com.codename1.tools.translator.classfile.analysis.Frame.merge (26 samples)
    • 1.75% com.codename1.tools.translator.classfile.tree.JsrInliner.replay (25 samples)
    • 1.47% com.codename1.tools.translator.ReachabilityCull.run (21 samples)
    • 1.47% java.lang.String.equals (21 samples)
    • 1.40% java.util.HashMap.putVal (20 samples)
    • 1.40% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (20 samples)
    • 1.19% com.codename1.tools.translator.Parser.cullMethods (17 samples)
    • 1.19% java.util.HashMap.hash (17 samples)
    • 1.05% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (15 samples)
    • 0.98% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (14 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

shai-almog commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 168 screenshots: 168 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 1000 ms
Simulator Boot (Run) 1000 ms
App Install 15000 ms
App Launch 16000 ms
Test Execution 453000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 81ms / native 2ms = 40.5x speedup
SIMD float-mul (64K x300) java 95ms / native 3ms = 31.6x 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 99.000 ms
Base64 CN1 decode 59.000 ms
Base64 native encode 1064.000 ms
Base64 encode ratio (CN1/native) 0.093x (90.7% faster)
Base64 native decode 824.000 ms
Base64 decode ratio (CN1/native) 0.072x (92.8% faster)
Base64 SIMD encode 72.000 ms
Base64 encode ratio (SIMD/CN1) 0.727x (27.3% faster)
Base64 SIMD decode 54.000 ms
Base64 decode ratio (SIMD/CN1) 0.915x (8.5% faster)
Base64 encode ratio (SIMD/native) 0.068x (93.2% faster)
Base64 decode ratio (SIMD/native) 0.066x (93.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 6.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 49.000 ms
Image applyMask (SIMD on) 78.000 ms
Image applyMask ratio (SIMD on/off) 1.592x (59.2% slower)
Image modifyAlpha (SIMD off) 42.000 ms
Image modifyAlpha (SIMD on) 27.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.643x (35.7% faster)
Image modifyAlpha removeColor (SIMD off) 47.000 ms
Image modifyAlpha removeColor (SIMD on) 26.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.553x (44.7% faster)

shai-almog and others added 4 commits October 20, 2026 05:43
After b.getAllStyles(). the editor offered global names: it only recognized a
bare identifier before the dot. The receiver is now read as a chain -- a
variable, global, type, constructor call or string literal, then any number of
.field and .method(args) steps -- each typed from the API's class files (return
and field types, overloads told apart by argument count). A member position
whose receiver cannot be typed offers nothing instead of unrelated names.

PlaygroundCompletionHarness covers it and runs in the smoke tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Savor implementor's guide, new on master, includes nine blocks from
scripts/savor/backend -- server code the browser Playground cannot run.
Marked cn1-no-try like Wayline's backend blocks, and scripts/savor joins the
snippet workflow's paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The JUnit extension applied @DarkMode and never put it back, so
CodenameOneExtensionTest.darkModeEnabled left the rest of the JVM dark and
OtpFieldRenderingTest's ink measurements inverted. LocalContinuityTest
inherited a catch-all route dispatcher from earlier classes, so an
unregistered route restored successfully. Both fail master's CI depending
on test order.

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

shai-almog commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

shai-almog and others added 2 commits October 20, 2026 11:55
…ay in the editor test

Backend-Web.asciidoc gained a backend include without the cn1-no-try role.
CodeEditorInteractionTest built Components without initializing Display and
passed only when another class ran first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shai-almog
shai-almog merged commit f96fb5d into master Oct 20, 2026
67 of 78 checks passed
@shai-almog
shai-almog deleted the docs-try-it-inline-playground branch October 20, 2026 10:14
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