Skip to content

Fix playground camera, 3D, and balls demos with browser regressions - #5953

Merged
shai-almog merged 5 commits into
masterfrom
fix-playground-demo-regressions
Oct 6, 2026
Merged

shai-almog merged 5 commits into
masterfrom
fix-playground-demo-regressions

Conversation

@shai-almog

@shai-almog shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Camera controls could fall below the playground iframe at ordinary desktop sizes, and camera sessions stayed active after switching samples. The 3D demo lost a host-only animation callback and composited CSS coordinates into a device-pixel buffer, leaving a white preview on Retina displays. The balls demo painted and bounced within fixed 320×480 bounds.

The fixes fit the device preview into the available stage, close outgoing camera sessions, preserve animation callbacks, use device pixels throughout WebGL compositing, update the GPU projection on resize, and use the balls component's actual dimensions. Camera capture requests video without microphone access, wraps status text, and fits captured photos within the viewport.

Regression coverage:

  • Chromium and Firefox, 1440×900 and 1280×720, at both 1× and 2× device pixel ratios.
  • Screenshot assertions for visible content, full preview coverage, cube position/proportions and animation; asynchronous worker errors fail the tests.
  • Camera start, moving video, photo capture and close; same-page navigation verifies stopped media tracks, camera reopening, and repeated 3D rendering.
  • A translator regression across five compiler configurations and ten tests for the screenshot assertions.
  • A website publication gate runs the 3D checks against the actual Hugo output before publishing PR previews or production. Screenshots and diagnostic JSON record pixel ratio, browser and GPU renderer.

Validation:

  • Reproduced the hosted PR's white 3D preview in Chrome and Firefox at 2×: all 16 pixel assertions failed, while the 1× cases passed.
  • After the device-pixel fix, the complete local website matrix passes 192/192 checks in Chrome and Firefox at 1× and 2×.
  • Visible Chrome and Firefox also pass 48/48 3D checks at 1.5× and 2× with no GPU overrides. Chrome uses ANGLE Metal on Apple M4 Max; Firefox reports an Apple renderer.
  • The deployed PR preview passes 24/24 3D checks in Chrome and Firefox at 2×, at 1440×900 and 1280×720, with default GPU settings. Screenshots show the cube and pixel comparisons verify animation.
  • The website publication run passes 48/48 rendering checks. The full browser CI on the rendering-fix commit passes 192/192 demo checks and 26/26 existing browser checks. The website gate uses Xvfb so Linux Firefox can create its software WebGL context.
  • Pixel assertion tests pass 10/10; the plugin and playground builds, copyright check, actionlint and git diff --check pass.
  • Earlier validation for the camera/layout and translator changes: existing browser suite 26/26, lightweight editor input, playground smoke, syntax 335/335, painting 310/310, layout, preview resolution 20/20, executable samples 15/15, and translator regression 5/5.

Camera automation uses synthetic media devices and automated permission acceptance. It verifies real clicks, getUserMedia, displayed frames and ended tracks; physical camera hardware and manual permission dialogs are not covered. Hosted Linux CI explicitly enables software WebGL; local runs use browser defaults.

CI follow-up (7f1a288e86):

  • Replaced only the six reviewed GPU/immersive-media PNG references. The previous references encoded the Retina half-size rendering bug. Replaying the failed run through the existing strict comparison pipeline now passes all 193 screenshots; all six old half-size images are rejected. Tolerances are unchanged.
  • Recalibrated only Linux Neoverse-N2 objectAllocation time from two existing runs with unchanged native code (1.947× and 1.589× versus the single-run 3.043× baseline). The new median is 1.768×; its existing 45% tolerance, memory baseline and all other benchmarks are unchanged. Both recorded runs pass the resolved gate, and the baseline consistency check passes.
  • Fresh hosted CI is running for this commit; the replay checks above are local validation of the recorded CI artifacts.

@shai-almog

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 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-06T06:54:54.491679Z bc039b3 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: bc039b3a55

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

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

@shai-almog

shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 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 38ms / native 2ms = 19.0x speedup
SIMD float-mul (64K x300) java 39ms / native 3ms = 13.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 48.000 ms
Base64 CN1 decode 65.000 ms
Base64 SIMD encode 69.000 ms
Base64 encode ratio (SIMD/CN1) 1.438x (43.8% slower)
Base64 SIMD decode 64.000 ms
Base64 decode ratio (SIMD/CN1) 0.985x (1.5% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 1.000x (0.0% slower)
Image applyMask (SIMD off) 19.000 ms
Image applyMask (SIMD on) 23.000 ms
Image applyMask ratio (SIMD on/off) 1.211x (21.1% slower)
Image modifyAlpha (SIMD off) 33.000 ms
Image modifyAlpha (SIMD on) 19.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.576x (42.4% faster)
Image modifyAlpha removeColor (SIMD off) 28.000 ms
Image modifyAlpha removeColor (SIMD on) 20.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.714x (28.6% faster)

@shai-almog

shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 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 66ms / native 5ms = 13.2x speedup
SIMD float-mul (64K x300) java 57ms / native 4ms = 14.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 92.000 ms
Base64 SIMD encode 135.000 ms
Base64 encode ratio (SIMD/CN1) 1.849x (84.9% slower)
Base64 SIMD decode 103.000 ms
Base64 decode ratio (SIMD/CN1) 1.120x (12.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 10.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.500x (50.0% faster)
Image applyMask (SIMD off) 42.000 ms
Image applyMask (SIMD on) 28.000 ms
Image applyMask ratio (SIMD on/off) 0.667x (33.3% faster)
Image modifyAlpha (SIMD off) 38.000 ms
Image modifyAlpha (SIMD on) 21.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.553x (44.7% faster)
Image modifyAlpha removeColor (SIMD off) 43.000 ms
Image modifyAlpha removeColor (SIMD on) 29.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.674x (32.6% 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 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.31x (base 1.22x, +6.9%) 0.88x (base 0.80x, +9.3%) ok
translator (self) 4 0.50x (base 0.60x, -18.0%) 0.59x (base 0.54x, +9.0%) ok
intArithmetic 4 1.10x (base 1.10x, -0.3%) 0.06x (base 0.06x, +0.2%) ok
longArithmetic 4 1.08x (base 1.08x, +0.1%) 0.05x (base 0.05x, +1.3%) ok
mathTranscendental 4 0.78x (base 0.79x, -1.3%) 0.06x (base 0.06x, +0.5%) ok
arraySequential 4 1.36x (base 1.36x, -0.6%) 0.39x (base 0.39x, +0.1%) ok
arrayRandom 4 1.15x (base 1.06x, +8.7%) 0.23x (base 0.23x, +0.0%) ok
objectAllocation 4 1.54x (base 1.56x, -0.9%) 0.29x (base 0.39x, -25.6%) ok
valueEscape 4 0.10x (base 0.10x, +0.4%) 0.05x (base 0.04x, +3.1%) ok
hashMapChurn 4 1.82x (base 1.80x, +1.4%) 0.09x (base 0.09x, -4.2%) ok
stringBuilding 4 1.17x (base 1.22x, -3.5%) 0.27x (base 0.32x, -17.0%) ok
recursion 4 1.45x (base 1.49x, -2.6%) 0.06x (base 0.06x, -0.7%) ok
quicksort 4 1.10x (base 1.13x, -3.1%) 0.12x (base 0.12x, -0.3%) ok

Result: no regression

@github-actions

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

Copy link
Copy Markdown
Collaborator Author

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

ParparVM vs HotSpot (JDK 25): Linux x64

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

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 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.76x (base 0.85x, -10.4%) 0.83x (base 0.84x, -0.9%) ok
translator (self) 4 0.50x (base 0.52x, -3.1%) 0.47x (base 0.52x, -8.5%) ok
intArithmetic 4 1.10x (base 1.12x, -1.2%) 0.06x (base 0.06x, -0.6%) ok
longArithmetic 4 1.14x (base 1.08x, +5.1%) 0.05x (base 0.05x, +1.1%) ok
mathTranscendental 4 1.08x (base 1.08x, +0.0%) 0.08x (base 0.07x, +1.5%) ok
arraySequential 4 2.29x (base 2.00x, +14.2%) 0.38x (base 0.36x, +4.9%) ok
arrayRandom 4 0.74x (base 0.91x, -18.3%) 0.21x (base 0.21x, +1.4%) ok
objectAllocation 4 1.65x (base 1.65x, -0.1%) 0.29x (base 0.37x, -20.4%) ok
valueEscape 4 0.10x (base 0.10x, -0.3%) 0.04x (base 0.04x, -4.3%) ok
hashMapChurn 4 1.49x (base 1.48x, +0.4%) 0.10x (base 0.09x, +6.8%) ok
stringBuilding 4 1.34x (base 1.39x, -3.6%) 0.26x (base 0.26x, +0.7%) ok
recursion 4 1.38x (base 1.25x, +10.3%) 0.08x (base 0.08x, +0.5%) ok
quicksort 4 1.09x (base 1.07x, +1.8%) 0.11x (base 0.11x, -1.3%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 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.94x (base 0.93x, +0.7%) 0.79x (base 0.87x, -9.5%) ok
translator (self) 4 0.69x (base 0.70x, -1.4%) 0.44x (base 0.45x, -1.4%) ok
intArithmetic 4 1.04x (base 1.04x, -0.1%) 0.03x (base 0.03x, -1.3%) ok
longArithmetic 4 0.79x (base 0.79x, -0.2%) 0.03x (base 0.03x, +0.7%) ok
mathTranscendental 4 1.10x (base 1.10x, +0.0%) 0.03x (base 0.03x, -2.5%) ok
arraySequential 4 0.35x (base 0.36x, -2.8%) 0.37x (base 0.37x, -0.3%) ok
arrayRandom 4 0.94x (base 0.94x, +0.0%) 0.20x (base 0.20x, +0.0%) ok
objectAllocation 4 1.89x (base 1.77x, +6.8%) 0.36x (base 0.38x, -4.4%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, -0.8%) ok
hashMapChurn 4 0.84x (base 0.84x, -0.3%) 0.11x (base 0.12x, -6.4%) ok
stringBuilding 4 1.35x (base 1.36x, -0.9%) 0.32x (base 0.26x, +20.6%) ok
recursion 4 1.55x (base 1.43x, +8.4%) 0.03x (base 0.04x, -1.1%) ok
quicksort 4 0.99x (base 0.99x, -0.1%) 0.09x (base 0.09x, +0.7%) ok

Result: no regression

@shai-almog

shai-almog commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 172 screenshots: 172 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 2ms = 24.5x speedup
SIMD float-mul (64K x300) java 48ms / native 2ms = 24.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 61.000 ms
Base64 CN1 decode 73.000 ms
Base64 SIMD encode 78.000 ms
Base64 encode ratio (SIMD/CN1) 1.279x (27.9% slower)
Base64 SIMD decode 72.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) 1.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 19.000 ms
Image applyMask (SIMD on) 17.000 ms
Image applyMask ratio (SIMD on/off) 0.895x (10.5% faster)
Image modifyAlpha (SIMD off) 15.000 ms
Image modifyAlpha (SIMD on) 8.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.533x (46.7% faster)
Image modifyAlpha removeColor (SIMD off) 20.000 ms
Image modifyAlpha removeColor (SIMD on) 11.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.550x (45.0% 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.11x (base 1.11x, +0.1%) 0.81x (base 0.90x, -9.8%) ok
translator (self) 4 0.83x (base 0.75x, +10.8%) 0.49x (base 0.45x, +9.3%) 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.0%) 0.06x (base 0.06x, +1.7%) ok
mathTranscendental 4 0.68x (base 0.72x, -5.5%) 0.06x (base 0.06x, +0.4%) ok
arraySequential 4 0.38x (base 0.46x, -15.6%) 0.39x (base 0.39x, +0.0%) ok
arrayRandom 4 0.94x (base 0.94x, -0.1%) 0.23x (base 0.23x, +0.0%) ok
objectAllocation 4 1.80x (base 2.81x, -35.8%) 0.41x (base 0.43x, -4.0%) ok
valueEscape 4 0.76x (base 0.76x, +0.0%) 0.05x (base 0.05x, -0.0%) ok
hashMapChurn 4 1.00x (base 0.98x, +1.2%) 0.12x (base 0.12x, -0.7%) ok
stringBuilding 4 1.39x (base 1.43x, -2.4%) 0.27x (base 0.27x, +0.1%) ok
recursion 4 1.46x (base 1.46x, -0.2%) 0.06x (base 0.07x, -0.4%) ok
quicksort 4 1.01x (base 1.00x, +0.6%) 0.12x (base 0.12x, -0.1%) ok

Result: no regression

@shai-almog
shai-almog merged commit b499a12 into master Oct 6, 2026
47 of 51 checks passed
@shai-almog
shai-almog deleted the fix-playground-demo-regressions branch October 6, 2026 11:09
shai-almog pushed a commit that referenced this pull request Oct 6, 2026
Brings in #5953, which fixes the Playground browser demo regressions the
'Playground in the browser' job failed on.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant