Skip to content

Backend: certificates, CSRs, PKCS#12, chain validation and ECDH - #6091

Merged
shai-almog merged 9 commits into
masterfrom
backend-pki
Oct 25, 2026
Merged

shai-almog merged 9 commits into
masterfrom
backend-pki

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Fixes #5991.

New package com.codename1.backend.security.pki (shared Java, so the JVM and the native build run identical code):

  • Pem: multi-block PEM decode/encode.
  • Certificate: X.509 parsing (names, validity, key, SAN DNS/IP/email/URI, basic constraints, key usage, EKU, SKI/AKI). Also host matching per RFC 9525 (SAN only, leftmost wildcard, IPv4/IPv6).
  • CertificateValidator: validates a chain against explicit trust anchors only.
    • Builds the path from the leaf through certificates in any order.
    • Checks signatures, validity, basic constraints, keyCertSign, path length and unknown critical extensions.
    • Optionally checks the host and EKU.
    • Errors name the certificate and the reason.
  • CertificationRequest: PKCS#10 create (RSA/P-256/P-384, SAN extension request), parse and verify.
  • Pkcs12: read and write in the PBES2/PBKDF2/AES-CBC + HMAC profile of OpenSSL 3 and current JDKs.
    • Legacy RC2/3DES files are refused with the re-export command.
    • A wrong password is reported as such.
  • DistinguishedName: RFC 4514 parse/format.

Crypto (both impl/javase and impl/parparvm + cn1_backend_crypto.c): generateEcKey(P-256|P-384), ecdh and aesCbcEncrypt/aesCbcDecrypt. On the JVM, EC keys are written in OpenSSL's PKCS#8 shape (public point included) so Der.publicKeyOf works on both runtimes.

Profiles are documented in the package docs and in a new Backend-Security section.

Tests / fixtures

  • Fixtures were generated with the openssl CLI (maven/backend/src/test/resources/pki/generate.sh).
  • PkiTest cross-checks against the JDK:
    • Parsed fields against CertificateFactory.
    • Our PKCS#12 loaded by KeyStore, and the JDK's PKCS#12 read by us.
    • CSR signatures verified by Signature.
    • ECDH against KeyAgreement, and AES-CBC against Cipher.
  • The authcheck demo prints 74 new deterministic VALUE lines covering parsing, every validation failure, CSRs, PKCS#12, ECDH (fixed keys) and the NIST CBC vector.
    • BackendSecurityTest requires those lines to match between the JVM and the native binary.
    • Locally, all 165 lines were identical across the two runtimes.

backend verify (SpotBugs, Checkstyle), the PMD report for backend and backend-parparvm, and JDK 25 doclint on the new sources are clean.

🤖 Generated with Claude Code

com.codename1.backend.security.pki reads PEM and X.509, validates chains
against explicit trust anchors (signatures, validity, basic constraints, key
usage, path length, critical extensions, host name and EKU), creates and
reads PKCS#10 requests, and reads and writes PKCS#12 in the PBES2/AES/HMAC
profile OpenSSL 3 and current JDKs use. It is shared Java, so both runtimes
run the same code.

Crypto gains generateEcKey (P-256/P-384), ecdh and AES-CBC on both the JVM
and the native OpenSSL arm. The algorithm profile is documented in the
package and the developer guide.

Fixtures come from the openssl command line. PkiTest cross-checks every
result against the JDK's X.509, KeyStore, Signature and KeyAgreement, and
authcheck prints the same results as VALUE lines that BackendSecurityTest
requires to match between the JVM and the native binary.

Fixes #5991

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

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 191 screenshots: 191 matched.

Native Android coverage

  • 📊 Line coverage: 19.18% (48148/251040 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 17.88% (228763/1279760), branch 12.19% (16778/137674), complexity 9.81% (12875/131234), method 14.81% (9094/61424), class 25.73% (1769/6875)
    • 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: 19.18% (48148/251040 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 17.88% (228763/1279760), branch 12.19% (16778/137674), complexity 9.81% (12875/131234), method 14.81% (9094/61424), class 25.73% (1769/6875)
    • 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 256ms / native 178ms = 1.4x speedup
SIMD float-mul (64K x300) java 205ms / native 103ms = 1.9x 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 95.000 ms
Base64 CN1 decode 84.000 ms
Base64 native encode 435.000 ms
Base64 encode ratio (CN1/native) 0.218x (78.2% faster)
Base64 native decode 285.000 ms
Base64 decode ratio (CN1/native) 0.295x (70.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 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 69ms / native 6ms = 11.5x speedup
SIMD float-mul (64K x300) java 57ms / native 6ms = 9.5x 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 77.000 ms
Base64 CN1 decode 89.000 ms
Base64 SIMD encode 118.000 ms
Base64 encode ratio (SIMD/CN1) 1.532x (53.2% slower)
Base64 SIMD decode 102.000 ms
Base64 decode ratio (SIMD/CN1) 1.146x (14.6% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 28.000 ms
Image applyMask (SIMD on) 32.000 ms
Image applyMask ratio (SIMD on/off) 1.143x (14.3% slower)
Image modifyAlpha (SIMD off) 32.000 ms
Image modifyAlpha (SIMD on) 20.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.625x (37.5% faster)
Image modifyAlpha removeColor (SIMD off) 32.000 ms
Image modifyAlpha removeColor (SIMD on) 58.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.813x (81.3% slower)

@github-actions

github-actions Bot commented Oct 24, 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)
    • ✅ desktop-compat-runtime: 0 findings (no issues)
    • ✅ fxml-compiler: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ javafx-compat: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
    • ✅ swing-compat: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

The padded AES-CBC API offered a padding verdict to any caller, the
padding-oracle shape code scanning flags. PKCS#12 now removes its own
padding only after checkMac() has accepted the file.

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

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 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 63ms / native 4ms = 15.7x speedup
SIMD float-mul (64K x300) java 56ms / native 5ms = 11.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 73.000 ms
Base64 CN1 decode 89.000 ms
Base64 SIMD encode 124.000 ms
Base64 encode ratio (SIMD/CN1) 1.699x (69.9% slower)
Base64 SIMD decode 104.000 ms
Base64 decode ratio (SIMD/CN1) 1.169x (16.9% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 12.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 38.000 ms
Image applyMask (SIMD on) 45.000 ms
Image applyMask ratio (SIMD on/off) 1.184x (18.4% slower)
Image modifyAlpha (SIMD off) 33.000 ms
Image modifyAlpha (SIMD on) 70.000 ms
Image modifyAlpha ratio (SIMD on/off) 2.121x (112.1% slower)
Image modifyAlpha removeColor (SIMD off) 36.000 ms
Image modifyAlpha removeColor (SIMD on) 33.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.917x (8.3% 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.53x (base 1.22x, +25.2%) 0.55x (base 0.94x, -41.9%) ok
translator (self) 4 0.81x (base 0.83x, -3.1%) 0.53x (base 0.54x, -1.6%) ok
intArithmetic 4 1.10x (base 1.10x, -0.0%) 0.06x (base 0.06x, +2.7%) ok
longArithmetic 4 1.14x (base 1.08x, +5.1%) 0.06x (base 0.05x, +3.4%) ok
mathTranscendental 4 0.78x (base 0.79x, -0.7%) 0.06x (base 0.06x, +3.0%) ok
arraySequential 4 1.45x (base 1.36x, +6.2%) 0.39x (base 0.39x, +0.3%) ok
arrayRandom 4 1.12x (base 1.06x, +5.1%) 0.23x (base 0.23x, +0.7%) ok
objectAllocation 4 1.60x (base 1.56x, +2.4%) 0.28x (base 0.39x, -26.5%) ok
valueEscape 4 0.10x (base 0.10x, +0.3%) 0.05x (base 0.04x, +4.9%) ok
hashMapChurn 4 1.88x (base 1.80x, +4.6%) 0.09x (base 0.09x, -6.7%) ok
stringBuilding 4 1.29x (base 1.22x, +5.7%) 0.32x (base 0.32x, +0.0%) ok
recursion 4 1.41x (base 1.49x, -5.8%) 0.06x (base 0.06x, +1.7%) ok
quicksort 4 1.11x (base 1.13x, -2.3%) 0.12x (base 0.12x, +1.0%) ok

Result: no regression

The inline block named KeyFiles in the wrong package; compiling it caught that.

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

github-actions Bot commented Oct 24, 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)

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

shai-almog and others added 2 commits October 24, 2026 07:47
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mode flag let CodeQL trace the NIST decrypt vector's fixed IV into the
encrypting cipher. Two methods keep the random-IV rule on the method it
governs; the test's rejected-length IV is random too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scheduled ticker could take the ended room first and record it on its
own thread, so a caller reading the match history right after
fastForward found nothing yet (OnlineMatchTest on MySQL).

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

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 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 9V45 96-Core Processor (baseline linux-x64@amd-epyc-9v45-96-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.94x (base 0.92x, +2.4%) 0.69x (base 0.84x, -18.0%) ok
translator (self) 4 0.60x (base 0.64x, -7.0%) 0.57x (base 0.55x, +3.7%) ok
intArithmetic 4 1.00x (base 1.00x, -0.2%) 0.05x (base 0.06x, -0.1%) ok
longArithmetic 4 0.99x (base 0.99x, -0.0%) 0.06x (base 0.07x, -23.0%) ok
mathTranscendental 4 1.21x (base 1.20x, +0.8%) 0.06x (base 0.06x, +3.9%) ok
arraySequential 4 2.79x (base 2.91x, -4.1%) 0.36x (base 0.36x, +0.2%) ok
arrayRandom 4 1.00x (base 1.04x, -3.3%) 0.21x (base 0.23x, -8.0%) ok
objectAllocation 4 1.55x (base 1.61x, -4.1%) 0.27x (base 0.24x, +15.0%) ok
valueEscape 4 0.10x (base 0.12x, -12.8%) 0.04x (base 0.04x, +4.1%) ok
hashMapChurn 4 1.29x (base 1.31x, -1.6%) 0.09x (base 0.09x, +8.4%) ok
stringBuilding 4 1.59x (base 1.58x, +0.9%) 0.26x (base 0.22x, +20.0%) ok
recursion 4 1.36x (base 1.34x, +1.8%) 0.06x (base 0.08x, -25.4%) ok
quicksort 4 1.07x (base 1.06x, +0.5%) 0.11x (base 0.11x, +0.8%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 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.96x (base 1.02x, -6.0%) 0.63x (base 0.93x, -32.0%) ok
translator (self) 4 0.74x (base 0.70x, +6.6%) 0.44x (base 0.43x, +2.0%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.03x (base 0.03x, +4.3%) ok
longArithmetic 4 0.79x (base 0.79x, -0.1%) 0.03x (base 0.03x, +4.8%) ok
mathTranscendental 4 1.09x (base 1.10x, -0.3%) 0.04x (base 0.03x, +9.5%) ok
arraySequential 4 0.35x (base 0.36x, -4.6%) 0.37x (base 0.37x, +0.2%) ok
arrayRandom 4 0.93x (base 0.94x, -0.3%) 0.20x (base 0.20x, +0.5%) ok
objectAllocation 4 1.84x (base 1.77x, +3.8%) 0.37x (base 0.37x, -0.2%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +4.6%) ok
hashMapChurn 4 0.84x (base 0.84x, -0.1%) 0.12x (base 0.12x, +2.2%) ok
stringBuilding 4 1.46x (base 1.57x, -6.6%) 0.26x (base 0.26x, -0.5%) ok
recursion 4 1.44x (base 1.43x, +0.3%) 0.04x (base 0.04x, +2.9%) ok
quicksort 4 1.00x (base 0.99x, +0.9%) 0.10x (base 0.09x, +2.5%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 206 screenshots: 206 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 53ms / native 3ms = 17.6x speedup
SIMD float-mul (64K x300) java 54ms / native 2ms = 27.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 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 72.000 ms
Base64 decode ratio (SIMD/CN1) 1.029x (2.9% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.400x (60.0% faster)
Image applyMask (SIMD off) 19.000 ms
Image applyMask (SIMD on) 19.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) 21.000 ms
Image modifyAlpha removeColor (SIMD on) 14.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.667x (33.3% 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 0.99x (base 1.11x, -10.7%) 0.63x (base 0.75x, -16.7%) ok
translator (self) 4 0.86x (base 0.84x, +2.7%) 0.52x (base 0.51x, +2.2%) ok
intArithmetic 4 1.04x (base 1.04x, +0.0%) 0.06x (base 0.06x, +3.1%) ok
longArithmetic 4 0.79x (base 0.80x, -0.0%) 0.06x (base 0.06x, +3.6%) ok
mathTranscendental 4 0.72x (base 0.72x, -0.4%) 0.07x (base 0.06x, +1.8%) ok
arraySequential 4 0.37x (base 0.46x, -19.0%) 0.39x (base 0.39x, +0.1%) ok
arrayRandom 4 0.94x (base 0.94x, +0.1%) 0.23x (base 0.23x, +0.3%) ok
objectAllocation 4 1.74x (base 1.82x, -4.6%) 0.38x (base 0.43x, -10.8%) ok
valueEscape 4 0.76x (base 0.76x, +0.1%) 0.05x (base 0.05x, +2.2%) ok
hashMapChurn 4 1.00x (base 0.98x, +1.4%) 0.12x (base 0.12x, -1.8%) ok
stringBuilding 4 1.60x (base 1.43x, +12.1%) 0.27x (base 0.27x, -0.6%) ok
recursion 4 1.56x (base 1.46x, +6.3%) 0.07x (base 0.07x, +1.0%) ok
quicksort 4 1.01x (base 1.00x, +0.6%) 0.12x (base 0.12x, +0.7%) ok

Result: no regression

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

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

Benchmark Results

  • Execution Time: 10771 ms

  • Hotspots (Top 20 sampled methods):

    • 12.88% com.codename1.tools.translator.IteratorEscape.mangle (211 samples)
    • 7.33% java.util.ArrayList.indexOf (120 samples)
    • 7.26% java.lang.Object.hashCode (119 samples)
    • 5.68% java.lang.System.identityHashCode (93 samples)
    • 3.36% com.codename1.tools.translator.bytecodes.Invoke.findMethodUp (55 samples)
    • 3.05% com.codename1.tools.translator.BytecodeMethod.equals (50 samples)
    • 2.87% com.codename1.tools.translator.classfile.analysis.Frame.execute (47 samples)
    • 2.63% java.lang.StringBuilder.append (43 samples)
    • 2.26% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (37 samples)
    • 2.01% java.lang.String.equals (33 samples)
    • 1.95% java.util.HashMap.hash (32 samples)
    • 1.71% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (28 samples)
    • 1.40% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (23 samples)
    • 1.40% com.codename1.tools.translator.Parser.cullMethods (23 samples)
    • 1.34% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (22 samples)
    • 1.28% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (21 samples)
    • 1.10% java.io.FileOutputStream.writeBytes (18 samples)
    • 0.98% com.codename1.tools.translator.ByteCodeClass.markDependencies (16 samples)
    • 0.98% java.util.AbstractCollection.containsAll (16 samples)
    • 0.92% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (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.

CodeQL followed the NULL array literal through an encoded PFX into the
IV decode() reads back, and flagged the decrypting Cipher.init. The
Skirmish Initializr template is regenerated for the Rooms fix.

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

shai-almog commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 67ms / native 7ms = 9.5x 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 active (NEON-accelerated)
Base64 CN1 encode 46.000 ms
Base64 CN1 decode 54.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 4.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 50.000 ms
Image applyMask (SIMD on) 53.000 ms
Image applyMask ratio (SIMD on/off) 1.060x (6.0% slower)
Image modifyAlpha (SIMD off) 50.000 ms
Image modifyAlpha (SIMD on) 52.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.040x (4.0% slower)
Image modifyAlpha removeColor (SIMD off) 62.000 ms
Image modifyAlpha removeColor (SIMD on) 54.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.871x (12.9% faster)

ParparVM vs HotSpot (JDK 25): macOS arm64

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

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (HelloCodenameOne) 3 0.78x (base 0.96x, -18.8%) 0.92x (base 0.93x, -0.8%) ok
translator (self) 3 0.58x (base 0.62x, -7.3%) 0.71x (base 0.78x, -8.7%) ok
intArithmetic 3 1.06x (base 1.03x, +2.7%) 0.12x (base 0.12x, +1.9%) ok
longArithmetic 3 1.05x (base 1.03x, +2.2%) 0.12x (base 0.07x, +68.7%) ok
mathTranscendental 3 0.99x (base 1.01x, -1.2%) 0.12x (base 0.12x, +1.3%) ok
arraySequential 3 0.43x (base 0.42x, +1.3%) 0.53x (base 0.53x, +0.3%) ok
arrayRandom 3 0.98x (base 0.99x, -1.0%) 0.33x (base 0.32x, +0.5%) ok
objectAllocation 3 1.06x (base 1.11x, -3.7%) 0.88x (base 0.72x, +21.3%) ok
valueEscape 3 0.50x (base 0.51x, -0.6%) 0.09x (base 0.09x, +0.4%) ok
hashMapChurn 3 1.07x (base 1.18x, -9.2%) 0.07x (base 0.07x, +2.8%) ok
stringBuilding 3 0.96x (base 0.84x, +13.5%) 0.40x (base 0.46x, -13.4%) ok
recursion 3 1.23x (base 1.24x, -0.0%) 0.12x (base 0.12x, +1.1%) ok
quicksort 3 1.01x (base 1.01x, -0.4%) 0.11x (base 0.11x, +1.9%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 67000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 52000 ms
Test Execution 431000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 102ms / native 4ms = 25.5x speedup
SIMD float-mul (64K x300) java 156ms / native 3ms = 52.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 138.000 ms
Base64 CN1 decode 215.000 ms
Base64 native encode 1937.000 ms
Base64 encode ratio (CN1/native) 0.071x (92.9% faster)
Base64 native decode 1343.000 ms
Base64 decode ratio (CN1/native) 0.160x (84.0% faster)
Base64 SIMD encode 60.000 ms
Base64 encode ratio (SIMD/CN1) 0.435x (56.5% faster)
Base64 SIMD decode 60.000 ms
Base64 decode ratio (SIMD/CN1) 0.279x (72.1% faster)
Base64 encode ratio (SIMD/native) 0.031x (96.9% faster)
Base64 decode ratio (SIMD/native) 0.045x (95.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 220.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.005x (99.5% faster)
Image applyMask (SIMD off) 371.000 ms
Image applyMask (SIMD on) 365.000 ms
Image applyMask ratio (SIMD on/off) 0.984x (1.6% faster)
Image modifyAlpha (SIMD off) 388.000 ms
Image modifyAlpha (SIMD on) 374.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.964x (3.6% faster)
Image modifyAlpha removeColor (SIMD off) 496.000 ms
Image modifyAlpha removeColor (SIMD on) 381.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.768x (23.2% faster)

@shai-almog

shai-almog commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 52ms / native 3ms = 17.3x speedup
SIMD float-mul (64K x300) java 54ms / native 3ms = 18.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 57.000 ms
Base64 CN1 decode 89.000 ms
Base64 native encode 904.000 ms
Base64 encode ratio (CN1/native) 0.063x (93.7% faster)
Base64 native decode 360.000 ms
Base64 decode ratio (CN1/native) 0.247x (75.3% faster)
Base64 SIMD encode 57.000 ms
Base64 encode ratio (SIMD/CN1) 1.000x (0.0% slower)
Base64 SIMD decode 76.000 ms
Base64 decode ratio (SIMD/CN1) 0.854x (14.6% faster)
Base64 encode ratio (SIMD/native) 0.063x (93.7% faster)
Base64 decode ratio (SIMD/native) 0.211x (78.9% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 6.000 ms
Image createMask ratio (SIMD on/off) 0.857x (14.3% faster)
Image applyMask (SIMD off) 66.000 ms
Image applyMask (SIMD on) 121.000 ms
Image applyMask ratio (SIMD on/off) 1.833x (83.3% slower)
Image modifyAlpha (SIMD off) 91.000 ms
Image modifyAlpha (SIMD on) 72.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.791x (20.9% faster)
Image modifyAlpha removeColor (SIMD off) 68.000 ms
Image modifyAlpha removeColor (SIMD on) 73.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 1.074x (7.4% slower)

@shai-almog
shai-almog merged commit 44fec92 into master Oct 25, 2026
130 of 133 checks passed
@shai-almog
shai-almog deleted the backend-pki branch October 25, 2026 12:36
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.

RFE: Backend certificate, key-agreement, and keystore APIs

2 participants