Skip to content

Native Linux (GTK3/Cairo) port + CI screenshot tests (x64 + arm64)#5239

Open
shai-almog wants to merge 2 commits into
masterfrom
linux-native-port
Open

Native Linux (GTK3/Cairo) port + CI screenshot tests (x64 + arm64)#5239
shai-almog wants to merge 2 commits into
masterfrom
linux-native-port

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Adds a native Linux desktop port — the structural twin of the native Windows port. The same ParparVM bytecode→C pipeline, here targeting Linux with GTK3 / Cairo / Pango / GdkPixbuf rendering, OpenGL ES (EGL) for 3D, GStreamer media/camera/audio, WebKitGTK browser, libsecret / libnotify / GeoClue services, libcurl networking. Single self-contained ELF (resources .incbin'd in), musl-linked VM with the GTK stack dynamically linked.

What's here

  • ParparVM: @Concrete.linux() selector; a linux executable CMake target with the GTK pkg-config link set and .incbin resource embedding.
  • Ports/LinuxPort: LinuxImplementation + LinuxNative (173 native methods, no stubs) + 15 cn1_linux_*.c native sources (window/graphics/text/image/io/net/socket/services/edit/browser/media/peer/gl/print/simd).
  • Build wiring: maven/linux module, LinuxNativeBuilder (zig/musl toolchain), CN1BuildMojo local-linux-device dispatch.
  • CI — linux-build-run.yml: builds the framework + the hellocodenameone screenshot suite, translates + native-builds the ELF, runs it headless under Xvfb, and captures the suite over the cn1ss WebSocket on both x86_64 (ubuntu-latest) and arm64 (ubuntu-24.04-arm) — the same two-arch coverage as the Windows port. CleanTargetLinuxIntegrationTest drives translate → native build → run/capture.
  • Docs: docs/developer-guide/Working-With-Linux.asciidoc.

Verification done locally (Linux container)

  • All 15 native files compile against the real GTK/WebKit/GStreamer/libsecret/libnotify/GeoClue/EGL/GLES headers (strict: -Werror=implicit-function-declaration -Werror=int-conversion).
  • A real CN1 Form app translates with the linux app-type, native-builds to a 12 MB ELF (810 translated C files + the native layer), runs headless and renders correctly — 2D (Cairo/Pango/GdkPixbuf), GLES 3D (offscreen triangle), and the bundled material icon font (FontConfig/FreeType).

Purpose of this PR

Run the CI so we can see the hellocodenameone screenshots rendered on Linux for x64 and arm64. The baseline dirs (scripts/linux/screenshots, scripts/linux/screenshots-arm) start empty — the compare-comment job is report-only and posts the rendered screenshots to the PR; baselines get seeded from the first green run (see the READMEs in those dirs).

🤖 Generated with Claude Code

…ests

Adds a native Linux desktop port, the structural twin of the Windows port:
ParparVM "clean" C target with a `linux` app-type, rendering through
GTK3/Cairo/Pango/GdkPixbuf, OpenGL ES (EGL) for 3D, GStreamer media/camera,
WebKitGTK browser, libsecret/libnotify/GeoClue services, libcurl networking.

- ParparVM: @Concrete.linux() selector, `linux` executable CMake target with the
  GTK link set and .incbin resource embedding.
- Ports/LinuxPort: LinuxImplementation + LinuxNative (173 native methods, no
  stubs) + 15 cn1_linux_*.c native sources.
- maven/linux module + LinuxNativeBuilder + CN1BuildMojo local-linux-device.
- CI: linux-build-run.yml builds + runs the hellocodenameone screenshot suite on
  x86_64 and arm64, captured over the cn1ss WebSocket, compared against
  per-arch baselines (scripts/linux/screenshots[-arm]).
- CleanTargetLinuxIntegrationTest drives translate -> native build -> run/capture.
- Developer guide chapter: Working-With-Linux.asciidoc.

Verified in a Linux container: all native files compile against the real GTK
stack; a translated CN1 Form app builds to a native ELF and renders correctly
(2D + GLES 3D + bundled icon fonts).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 13, 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: 10 alert(s) (5 errors, 5 warnings, 0 suggestions) (exit code 1) (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: 18 advisory match(es) — top: MORFOLOGIK_RULE_EN_US (17), EN_A_VS_AN (1) (report)
  • Image references: No unused images detected (report)

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 390 total, 0 failed, 14 skipped

Benchmark Results

  • Execution Time: 16159 ms

  • Hotspots (Top 20 sampled methods):

    • 25.74% com.codename1.tools.translator.Parser.addToConstantPool (364 samples)
    • 16.69% java.util.ArrayList.indexOf (236 samples)
    • 4.31% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (61 samples)
    • 3.39% java.lang.StringBuilder.append (48 samples)
    • 3.25% com.codename1.tools.translator.Parser.classIndex (46 samples)
    • 2.40% com.codename1.tools.translator.BytecodeMethod.equals (34 samples)
    • 2.33% com.codename1.tools.translator.BytecodeMethod.optimize (33 samples)
    • 1.63% org.objectweb.asm.ClassReader.readCode (23 samples)
    • 1.56% com.codename1.tools.translator.BytecodeMethod.appendMethodSignatureSuffixFromDesc (22 samples)
    • 1.56% java.io.UnixFileSystem.getBooleanAttributes0 (22 samples)
    • 1.34% java.lang.StringCoding.encode (19 samples)
    • 1.20% java.util.HashMap.hash (17 samples)
    • 1.13% java.util.TreeMap.getEntry (16 samples)
    • 1.13% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (16 samples)
    • 0.99% sun.nio.fs.UnixNativeDispatcher.open0 (14 samples)
    • 0.92% java.lang.System.identityHashCode (13 samples)
    • 0.85% com.codename1.tools.translator.NativeSymbolIndex.<init> (12 samples)
    • 0.85% sun.nio.ch.FileDispatcherImpl.write0 (12 samples)
    • 0.71% java.io.FileOutputStream.open0 (10 samples)
    • 0.71% java.lang.Object.hashCode (10 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 Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 128 screenshots: 128 matched.

Native Android coverage

  • 📊 Line coverage: 14.21% (8642/60799 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 11.51% (42589/370069), branch 5.05% (1758/34801), complexity 6.04% (2014/33356), method 10.47% (1633/15593), class 17.14% (377/2200)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 14.21% (8642/60799 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 11.51% (42589/370069), branch 5.05% (1758/34801), complexity 6.04% (2014/33356), method 10.47% (1633/15593), class 17.14% (377/2200)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 225ms / native 165ms = 1.3x speedup
SIMD float-mul (64K x300) java 169ms / native 115ms = 1.4x 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 204.000 ms
Base64 CN1 decode 365.000 ms
Base64 native encode 768.000 ms
Base64 encode ratio (CN1/native) 0.266x (73.4% faster)
Base64 native decode 1395.000 ms
Base64 decode ratio (CN1/native) 0.262x (73.8% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@github-actions

github-actions Bot commented Jun 13, 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)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 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 Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 125 screenshots: 125 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 71ms / native 4ms = 17.7x speedup
SIMD float-mul (64K x300) java 66ms / native 3ms = 22.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 323.000 ms
Base64 CN1 decode 191.000 ms
Base64 SIMD encode 135.000 ms
Base64 encode ratio (SIMD/CN1) 0.418x (58.2% faster)
Base64 SIMD decode 133.000 ms
Base64 decode ratio (SIMD/CN1) 0.696x (30.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 32.000 ms
Image createMask (SIMD on) 14.000 ms
Image createMask ratio (SIMD on/off) 0.438x (56.3% faster)
Image applyMask (SIMD off) 55.000 ms
Image applyMask (SIMD on) 26.000 ms
Image applyMask ratio (SIMD on/off) 0.473x (52.7% faster)
Image modifyAlpha (SIMD off) 55.000 ms
Image modifyAlpha (SIMD on) 25.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.455x (54.5% faster)
Image modifyAlpha removeColor (SIMD off) 60.000 ms
Image modifyAlpha removeColor (SIMD on) 24.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.400x (60.0% faster)

@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 125 screenshots: 125 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 75ms / native 3ms = 25.0x speedup
SIMD float-mul (64K x300) java 66ms / native 2ms = 33.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 316.000 ms
Base64 CN1 decode 183.000 ms
Base64 SIMD encode 134.000 ms
Base64 encode ratio (SIMD/CN1) 0.424x (57.6% faster)
Base64 SIMD decode 128.000 ms
Base64 decode ratio (SIMD/CN1) 0.699x (30.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 30.000 ms
Image createMask (SIMD on) 12.000 ms
Image createMask ratio (SIMD on/off) 0.400x (60.0% faster)
Image applyMask (SIMD off) 54.000 ms
Image applyMask (SIMD on) 21.000 ms
Image applyMask ratio (SIMD on/off) 0.389x (61.1% faster)
Image modifyAlpha (SIMD off) 50.000 ms
Image modifyAlpha (SIMD on) 20.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.400x (60.0% faster)
Image modifyAlpha removeColor (SIMD off) 54.000 ms
Image modifyAlpha removeColor (SIMD on) 20.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.370x (63.0% faster)

… guide chapter

CI: the codenameone maven plugin depends on CEF, which has no linux-arm64 build,
so the hellocodenameone suite classes only compile on x64. Split the workflow: a
prepare-suite job (x64) builds the plugin + suite classes once and shares them;
the build-run matrix then builds only core + the Linux port (which build fine on
arm64), translates the shared classes and builds/runs the ELF per arch. This
unblocks the arm64 screenshot leg.

Docs: rewrite the developer guide chapter to be end-user focused -- expand why we
link musl (self-contained, glibc-version-independent binary) vs glibc, add a
GTK3-vs-GTK4 section (chose 3 for universal reach), frame cross-compiling as a
user capability (arm from x64), document the build hints, and drop the internal
testing/status notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 61ms / native 7ms = 8.7x speedup
SIMD float-mul (64K x300) java 53ms / native 2ms = 26.5x 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 272.000 ms
Base64 CN1 decode 201.000 ms
Base64 native encode 567.000 ms
Base64 encode ratio (CN1/native) 0.480x (52.0% faster)
Base64 native decode 273.000 ms
Base64 decode ratio (CN1/native) 0.736x (26.4% faster)
Base64 SIMD encode 54.000 ms
Base64 encode ratio (SIMD/CN1) 0.199x (80.1% faster)
Base64 SIMD decode 46.000 ms
Base64 decode ratio (SIMD/CN1) 0.229x (77.1% faster)
Base64 encode ratio (SIMD/native) 0.095x (90.5% faster)
Base64 decode ratio (SIMD/native) 0.168x (83.2% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 18.000 ms
Image createMask (SIMD on) 9.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 65.000 ms
Image applyMask (SIMD on) 42.000 ms
Image applyMask ratio (SIMD on/off) 0.646x (35.4% faster)
Image modifyAlpha (SIMD off) 67.000 ms
Image modifyAlpha (SIMD on) 37.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.552x (44.8% faster)
Image modifyAlpha removeColor (SIMD off) 59.000 ms
Image modifyAlpha removeColor (SIMD on) 49.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.831x (16.9% faster)

@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 59000 ms
Simulator Boot (Run) 0 ms
App Install 10000 ms
App Launch 9000 ms
Test Execution 238000 ms

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 70ms / native 4ms = 17.5x 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 333.000 ms
Base64 CN1 decode 340.000 ms
Base64 native encode 434.000 ms
Base64 encode ratio (CN1/native) 0.767x (23.3% faster)
Base64 native decode 336.000 ms
Base64 decode ratio (CN1/native) 1.012x (1.2% slower)
Base64 SIMD encode 54.000 ms
Base64 encode ratio (SIMD/CN1) 0.162x (83.8% faster)
Base64 SIMD decode 46.000 ms
Base64 decode ratio (SIMD/CN1) 0.135x (86.5% faster)
Base64 encode ratio (SIMD/native) 0.124x (87.6% faster)
Base64 decode ratio (SIMD/native) 0.137x (86.3% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 25.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.120x (88.0% faster)
Image applyMask (SIMD off) 76.000 ms
Image applyMask (SIMD on) 32.000 ms
Image applyMask ratio (SIMD on/off) 0.421x (57.9% faster)
Image modifyAlpha (SIMD off) 95.000 ms
Image modifyAlpha (SIMD on) 40.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.421x (57.9% faster)
Image modifyAlpha removeColor (SIMD off) 81.000 ms
Image modifyAlpha removeColor (SIMD on) 45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.556x (44.4% faster)

@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 124 screenshots: 124 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 61000 ms
Simulator Boot (Run) 0 ms
App Install 11000 ms
App Launch 37000 ms
Test Execution 285000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 63ms / native 2ms = 31.5x speedup
SIMD float-mul (64K x300) java 98ms / native 3ms = 32.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 355.000 ms
Base64 CN1 decode 203.000 ms
Base64 native encode 459.000 ms
Base64 encode ratio (CN1/native) 0.773x (22.7% faster)
Base64 native decode 275.000 ms
Base64 decode ratio (CN1/native) 0.738x (26.2% faster)
Base64 SIMD encode 56.000 ms
Base64 encode ratio (SIMD/CN1) 0.158x (84.2% faster)
Base64 SIMD decode 50.000 ms
Base64 decode ratio (SIMD/CN1) 0.246x (75.4% faster)
Base64 encode ratio (SIMD/native) 0.122x (87.8% faster)
Base64 decode ratio (SIMD/native) 0.182x (81.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 22.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.045x (95.5% faster)
Image applyMask (SIMD off) 53.000 ms
Image applyMask (SIMD on) 33.000 ms
Image applyMask ratio (SIMD on/off) 0.623x (37.7% faster)
Image modifyAlpha (SIMD off) 63.000 ms
Image modifyAlpha (SIMD on) 35.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.556x (44.4% faster)
Image modifyAlpha removeColor (SIMD off) 58.000 ms
Image modifyAlpha removeColor (SIMD on) 35.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.603x (39.7% faster)

@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 125 screenshots: 125 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 63ms / native 4ms = 15.7x speedup
SIMD float-mul (64K x300) java 60ms / native 3ms = 20.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 601.000 ms
Base64 CN1 decode 235.000 ms
Base64 SIMD encode 104.000 ms
Base64 encode ratio (SIMD/CN1) 0.173x (82.7% faster)
Base64 SIMD decode 132.000 ms
Base64 decode ratio (SIMD/CN1) 0.562x (43.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 22.000 ms
Image createMask (SIMD on) 7.000 ms
Image createMask ratio (SIMD on/off) 0.318x (68.2% faster)
Image applyMask (SIMD off) 39.000 ms
Image applyMask (SIMD on) 13.000 ms
Image applyMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image modifyAlpha (SIMD off) 37.000 ms
Image modifyAlpha (SIMD on) 11.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.297x (70.3% faster)
Image modifyAlpha removeColor (SIMD off) 40.000 ms
Image modifyAlpha removeColor (SIMD on) 11.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.275x (72.5% faster)

@shai-almog

shai-almog commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

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

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