Skip to content

iOS: scan dense codes at 1080p, from raw frames, with close-range focus - #6159

Open
shai-almog wants to merge 1 commit into
masterfrom
ios-scanner-pdf417-quality
Open

shai-almog wants to merge 1 commit into
masterfrom
ios-scanner-pdf417-quality

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Dense PDF417 codes were hard to scan on iPhone while Android read them easily. The iOS camera path had three weaknesses:

  • Resolution. A session opened with no preview size, which is every Vision scanner, ran at 640x480. It now gets 1080p, falling back to 720p. This applies to every session that requests no size, so default still photos are no longer capped at 640x480 either.
  • JPEG re-encoding. Every frame went through a JPEG at quality 0.8, whatever format was requested. A raw request now gets RGBA8888 pixels: iOS captures BGRA and has no NV21. Apple Vision already accepts RGBA8888, and getJpegBytes() encodes lazily on first call. The native RGBA buffer is reused for the life of the session.
  • Close-range focus. While frames are delivered, the camera uses continuous autofocus restricted to near range. It also zooms in to the lens' minimum focus distance (Apple's AVCamBarcode formula, iOS 15+), because recent iPhone Pro main cameras cannot focus closer than about 20 cm. The application's own focus mode and zoom are restored when delivery stops.

CameraFrame.getRawBytes() now documents that a port may answer a raw request in a different raw format, so callers should read getFormat() first.

Still needs a check on a physical recent iPhone: the simulator has no camera.

🤖 Generated with Claude Code

Dense PDF417 codes were hard to read on iPhones while Android read them
easily. Three causes in the iOS camera, none of them new:

- A session opened with no preview size (every Vision scanner) ran at
  640x480. It now gets 1080p, falling back to 720p.
- Frames were always re-encoded as JPEG at quality 0.8, whatever format
  the listener asked for. A raw request now gets the pixels as RGBA8888
  (iOS has no NV21), which Apple Vision already accepts; the JPEG is
  encoded lazily only if asked for.
- Nothing configured focus for close range, and recent iPhone Pro main
  cameras cannot focus closer than ~20cm. While frames are delivered the
  camera now uses continuous near-range autofocus and zooms to the lens'
  minimum focus distance (Apple's AVCamBarcode formula); the application's
  zoom and focus mode are put back when delivery stops.

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

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@github-actions

github-actions Bot commented Nov 2, 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

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

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

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 195 screenshots: 195 matched.

Native Android coverage

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

✅ Native Android screenshot tests passed.

Native Android coverage

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

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 283ms / native 90ms = 3.1x speedup
SIMD float-mul (64K x300) java 107ms / native 66ms = 1.6x 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 61.000 ms
Base64 CN1 decode 68.000 ms
Base64 native encode 368.000 ms
Base64 encode ratio (CN1/native) 0.166x (83.4% faster)
Base64 native decode 239.000 ms
Base64 decode ratio (CN1/native) 0.285x (71.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 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 44ms / native 6ms = 7.3x speedup
SIMD float-mul (64K x300) java 46ms / native 3ms = 15.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 61.000 ms
Base64 CN1 decode 72.000 ms
Base64 SIMD encode 82.000 ms
Base64 encode ratio (SIMD/CN1) 1.344x (34.4% slower)
Base64 SIMD decode 79.000 ms
Base64 decode ratio (SIMD/CN1) 1.097x (9.7% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 8.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.250x (75.0% faster)
Image applyMask (SIMD off) 38.000 ms
Image applyMask (SIMD on) 38.000 ms
Image applyMask ratio (SIMD on/off) 1.000x (0.0% 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) 41.000 ms
Image modifyAlpha removeColor (SIMD on) 23.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.561x (43.9% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

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

1 improvement past the baseline (not a failure; rebaseline to lock it in):

  • recursion on all 4 CPUs: time 0.94x against a 1.20x baseline (-21.6%, tolerance 20%)

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.26x (base 1.07x, +18.0%) 0.68x (base 0.86x, -21.2%) ok
translator (self) 4 0.75x (base 0.79x, -4.9%) 0.53x (base 0.53x, +0.8%) ok
intArithmetic 4 1.02x (base 1.02x, -0.0%) 0.06x (base 0.06x, -2.9%) ok
longArithmetic 4 0.97x (base 0.97x, -0.4%) 0.06x (base 0.05x, +2.9%) ok
mathTranscendental 4 0.89x (base 0.89x, +0.6%) 0.06x (base 0.06x, +2.2%) ok
arraySequential 4 1.51x (base 1.98x, -23.6%) 0.38x (base 0.38x, +0.2%) ok
arrayRandom 4 1.01x (base 1.01x, -0.1%) 0.23x (base 0.23x, +0.5%) ok
objectAllocation 4 0.93x (base 1.22x, -23.5%) 0.39x (base 0.37x, +5.8%) ok
valueEscape 4 0.13x (base 0.13x, +2.5%) 0.05x (base 0.04x, +4.1%) ok
hashMapChurn 4 1.04x (base 1.14x, -9.2%) 0.10x (base 0.10x, +2.7%) ok
stringBuilding 4 1.46x (base 1.42x, +3.1%) 0.27x (base 0.22x, +20.5%) ok
recursion 4 0.94x (base 1.20x, -21.6%) 0.06x (base 0.06x, +2.8%) improved: rebaseline to lock in (time -21.6%)
quicksort 4 1.03x (base 1.07x, -3.4%) 0.12x (base 0.12x, +1.4%) ok

A change that moves performance ON PURPOSE records the new baseline in vm/selfhost/perf-baseline/pr/6159.json, with the reason, from this job's perf-results.json. The rebaseline is then part of this pull request's diff:

python3 vm/selfhost/calibrate-perf-baseline.py --pr 6159 --reason "<why these benchmarks moved>" perf-results.json

Result: no regression (improved past the baseline: consider rebaselining)

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 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 49ms / native 3ms = 16.3x speedup
SIMD float-mul (64K x300) java 49ms / native 4ms = 12.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 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) 2.000 ms
Image createMask ratio (SIMD on/off) 0.400x (60.0% faster)
Image applyMask (SIMD off) 17.000 ms
Image applyMask (SIMD on) 20.000 ms
Image applyMask ratio (SIMD on/off) 1.176x (17.6% 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) 14.000 ms
Image modifyAlpha removeColor (SIMD on) 9.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.643x (35.7% 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.05x (base 1.11x, -5.1%) 0.73x (base 0.75x, -3.3%) ok
translator (self) 4 0.87x (base 0.84x, +3.5%) 0.47x (base 0.51x, -6.9%) ok
intArithmetic 4 1.04x (base 1.04x, +0.0%) 0.06x (base 0.06x, +2.9%) ok
longArithmetic 4 0.80x (base 0.80x, +0.0%) 0.06x (base 0.06x, +3.3%) ok
mathTranscendental 4 0.70x (base 0.72x, -3.1%) 0.07x (base 0.06x, +1.7%) ok
arraySequential 4 0.38x (base 0.46x, -15.8%) 0.39x (base 0.39x, -0.0%) ok
arrayRandom 4 0.94x (base 0.94x, +0.3%) 0.23x (base 0.23x, +0.2%) ok
objectAllocation 4 1.78x (base 1.82x, -2.1%) 0.40x (base 0.43x, -6.3%) ok
valueEscape 4 0.76x (base 0.76x, +0.0%) 0.05x (base 0.05x, +3.6%) ok
hashMapChurn 4 0.99x (base 0.98x, +0.5%) 0.12x (base 0.12x, +0.1%) ok
stringBuilding 4 1.52x (base 1.43x, +6.8%) 0.27x (base 0.27x, +0.0%) ok
recursion 4 1.46x (base 1.46x, -0.4%) 0.07x (base 0.07x, +1.1%) ok
quicksort 4 1.01x (base 1.00x, +0.5%) 0.12x (base 0.12x, +0.6%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 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 9V74 80-Core Processor (baseline linux-x64@amd-epyc-9v74-80-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.90x, +5.3%) 0.81x (base 0.96x, -15.9%) ok
translator (self) 4 0.61x (base 0.63x, -3.1%) 0.50x (base 0.46x, +8.8%) ok
intArithmetic 4 1.10x (base 1.10x, -0.0%) 0.04x (base 0.06x, -30.2%) ok
longArithmetic 4 1.08x (base 1.08x, +0.0%) 0.04x (base 0.06x, -30.2%) ok
mathTranscendental 4 1.09x (base 1.09x, +0.2%) 0.04x (base 0.07x, -38.7%) ok
arraySequential 4 2.89x (base 2.81x, +2.8%) 0.36x (base 0.35x, +1.2%) ok
arrayRandom 4 1.03x (base 1.02x, +0.6%) 0.20x (base 0.21x, -4.6%) ok
objectAllocation 4 1.31x (base 1.21x, +8.9%) 0.31x (base 0.39x, -20.3%) ok
valueEscape 4 0.10x (base 0.10x, +0.9%) 0.03x (base 0.06x, -43.6%) ok
hashMapChurn 4 1.21x (base 1.10x, +10.6%) 0.11x (base 0.10x, +11.2%) ok
stringBuilding 4 1.33x (base 1.49x, -10.5%) 0.31x (base 0.26x, +20.3%) ok
recursion 4 1.25x (base 1.24x, +0.6%) 0.04x (base 0.06x, -29.5%) ok
quicksort 4 1.08x (base 1.07x, +0.9%) 0.10x (base 0.11x, -11.0%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 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.99x (base 1.02x, -3.3%) 0.77x (base 0.66x, +16.8%) ok
translator (self) 4 0.76x (base 0.70x, +9.6%) 0.43x (base 0.43x, +1.0%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.03x (base 0.03x, +4.8%) ok
longArithmetic 4 0.79x (base 0.79x, -0.1%) 0.03x (base 0.03x, +4.9%) ok
mathTranscendental 4 1.09x (base 1.10x, -0.3%) 0.04x (base 0.03x, +9.8%) ok
arraySequential 4 0.42x (base 0.36x, +17.0%) 0.37x (base 0.37x, +0.0%) ok
arrayRandom 4 0.94x (base 0.94x, +0.1%) 0.20x (base 0.20x, +0.9%) ok
objectAllocation 4 2.03x (base 1.77x, +14.9%) 0.36x (base 0.37x, -3.0%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +10.0%) ok
hashMapChurn 4 0.86x (base 0.84x, +2.2%) 0.12x (base 0.12x, +3.3%) ok
stringBuilding 4 1.37x (base 1.57x, -12.8%) 0.32x (base 0.26x, +20.7%) ok
recursion 4 1.43x (base 1.43x, -0.3%) 0.04x (base 0.04x, +3.1%) ok
quicksort 4 1.00x (base 0.99x, +1.1%) 0.09x (base 0.09x, +1.4%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 684 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 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 active (NEON-accelerated)
Base64 CN1 encode 45.000 ms
Base64 CN1 decode 54.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.714x (28.6% faster)
Image applyMask (SIMD off) 84.000 ms
Image applyMask (SIMD on) 73.000 ms
Image applyMask ratio (SIMD on/off) 0.869x (13.1% faster)
Image modifyAlpha (SIMD off) 56.000 ms
Image modifyAlpha (SIMD on) 53.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.946x (5.4% faster)
Image modifyAlpha removeColor (SIMD off) 56.000 ms
Image modifyAlpha removeColor (SIMD on) 48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.857x (14.3% 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.83x (base 0.96x, -13.6%) 0.90x (base 0.93x, -2.9%) ok
translator (self) 3 0.65x (base 0.62x, +4.1%) 0.84x (base 0.78x, +7.8%) ok
intArithmetic 3 1.07x (base 1.03x, +3.3%) 0.12x (base 0.12x, +1.8%) ok
longArithmetic 3 1.08x (base 1.03x, +4.8%) 0.11x (base 0.07x, +63.4%) ok
mathTranscendental 3 0.99x (base 1.01x, -2.1%) 0.12x (base 0.12x, +0.6%) ok
arraySequential 3 0.48x (base 0.42x, +14.4%) 0.53x (base 0.53x, +0.2%) ok
arrayRandom 3 1.02x (base 0.99x, +3.0%) 0.32x (base 0.32x, +0.3%) ok
objectAllocation 3 1.03x (base 1.11x, -7.2%) 0.86x (base 0.72x, +19.0%) ok
valueEscape 3 0.51x (base 0.51x, -0.2%) 0.09x (base 0.09x, -0.6%) ok
hashMapChurn 3 1.08x (base 1.18x, -7.8%) 0.07x (base 0.07x, -1.1%) ok
stringBuilding 3 0.93x (base 0.84x, +10.3%) 0.41x (base 0.46x, -11.2%) ok
recursion 3 1.25x (base 1.24x, +1.0%) 0.12x (base 0.12x, -2.4%) ok
quicksort 3 1.02x (base 1.01x, +0.3%) 0.11x (base 0.11x, -0.4%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 113000 ms
Simulator Boot (Run) 5000 ms
App Install 30000 ms
App Launch 5000 ms
Test Execution 500000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 380ms / native 5ms = 76.0x speedup
SIMD float-mul (64K x300) java 93ms / native 4ms = 23.2x 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 79.000 ms
Base64 CN1 decode 157.000 ms
Base64 native encode 1599.000 ms
Base64 encode ratio (CN1/native) 0.049x (95.1% faster)
Base64 native decode 768.000 ms
Base64 decode ratio (CN1/native) 0.204x (79.6% faster)
Base64 SIMD encode 69.000 ms
Base64 encode ratio (SIMD/CN1) 0.873x (12.7% faster)
Base64 SIMD decode 63.000 ms
Base64 decode ratio (SIMD/CN1) 0.401x (59.9% faster)
Base64 encode ratio (SIMD/native) 0.043x (95.7% faster)
Base64 decode ratio (SIMD/native) 0.082x (91.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.429x (57.1% faster)
Image applyMask (SIMD off) 65.000 ms
Image applyMask (SIMD on) 56.000 ms
Image applyMask ratio (SIMD on/off) 0.862x (13.8% faster)
Image modifyAlpha (SIMD off) 56.000 ms
Image modifyAlpha (SIMD on) 60.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.071x (7.1% slower)
Image modifyAlpha removeColor (SIMD off) 103.000 ms
Image modifyAlpha removeColor (SIMD on) 46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.447x (55.3% faster)

@shai-almog

shai-almog commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

Apple Watch (watchOS / Core Graphics)

Compared 253 screenshots: 252 matched, 1 updated.

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

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

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