Skip to content

Fix Worker-to-main-thread console forwarding for JavaScript pipeline#4736

Merged
shai-almog merged 9 commits intojavascript-port-initial-workfrom
copilot/fix-javascript-pipeline-timeout
Apr 13, 2026
Merged

Fix Worker-to-main-thread console forwarding for JavaScript pipeline#4736
shai-almog merged 9 commits intojavascript-port-initial-workfrom
copilot/fix-javascript-pipeline-timeout

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

  • Diagnose iOS regression: Cn1ssDeviceRunner.finalizeTest() calls emitFallbackScreenshotChunk(testName) which emits a 1x1 placeholder PNG using the class simple name (e.g. "AffineScale") — this creates duplicate streams with wrong names that don't match reference screenshots (e.g. "graphics-affine-scale")
  • Root cause: emitFallbackScreenshotChunk runs for every test with shouldTakeScreenshot()==true, on ALL platforms, even when Cn1ssDeviceRunnerHelper.emitCurrentFormScreenshot already captured the real screenshot
  • Fix: Remove the unconditional emitFallbackScreenshotChunk call and the dead helper methods from finalizeTest — the real screenshot is already captured via BaseTest.createForm()onShowCompleted()emitCurrentFormScreenshot()
  • Verify brace balance and no syntax errors
  • Validation passed (code review + CodeQL clean)

Copilot AI and others added 2 commits April 12, 2026 02:17
printToConsole() and emitDiagLine() now forward output via
postMessage so that Playwright page.on('console') captures
System.out.println and CN1SS chunk data from the Worker.

browser_bridge.js detects cn1Started from Worker log messages.
Playwright script exits early on CN1SS:SUITE:FINISHED.

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ba4cf2eb-f26f-49de-b5cf-33d60b64f177

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…calls, extract constant

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ba4cf2eb-f26f-49de-b5cf-33d60b64f177

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 12, 2026

iOS screenshot updates

Compared 36 screenshots: 35 matched, 1 updated.

  • Sheet — updated screenshot. Screenshot differs (1179x2556 px, bit depth 8).

    Sheet
    Preview info: Preview provided by instrumentation.
    Full-resolution PNG saved as Sheet.png in workflow artifacts.

Benchmark Results

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

Detailed Performance Metrics

Metric Duration
Simulator Boot 0 ms
Simulator Boot (Run) 1000 ms
App Install 3000 ms
App Launch 6000 ms
Test Execution 153000 ms
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1401.000 ms
Base64 CN1 encode 3021.000 ms
Base64 encode ratio (CN1/native) 2.156x (115.6% slower)
Base64 native decode 1115.000 ms
Base64 CN1 decode 1332.000 ms
Base64 decode ratio (CN1/native) 1.195x (19.5% slower)

Copilot AI requested a review from shai-almog April 12, 2026 05:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 12, 2026

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 441 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 10782 ms

  • Hotspots (Top 20 sampled methods):

    • 22.92% java.lang.String.indexOf (437 samples)
    • 18.20% com.codename1.tools.translator.Parser.isMethodUsed (347 samples)
    • 15.10% com.codename1.tools.translator.Parser.addToConstantPool (288 samples)
    • 11.27% java.util.ArrayList.indexOf (215 samples)
    • 4.25% java.lang.Object.hashCode (81 samples)
    • 2.67% java.lang.System.identityHashCode (51 samples)
    • 1.84% com.codename1.tools.translator.BytecodeMethod.equals (35 samples)
    • 1.52% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (29 samples)
    • 1.31% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (25 samples)
    • 1.26% com.codename1.tools.translator.Parser.getClassByName (24 samples)
    • 1.21% com.codename1.tools.translator.BytecodeMethod.optimize (23 samples)
    • 1.21% com.codename1.tools.translator.ByteCodeClass.markDependent (23 samples)
    • 0.89% java.lang.StringBuilder.append (17 samples)
    • 0.68% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (13 samples)
    • 0.63% com.codename1.tools.translator.Parser.cullMethods (12 samples)
    • 0.63% com.codename1.tools.translator.BytecodeMethod.isMethodUsedByNative (12 samples)
    • 0.58% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (11 samples)
    • 0.58% sun.nio.fs.UnixNativeDispatcher.open0 (11 samples)
    • 0.52% java.io.FileOutputStream.open0 (10 samples)
    • 0.52% com.codename1.tools.translator.ByteCodeClass.isDefaultInterfaceMethod (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.

…ity for typed arrays

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/86e83ee8-794d-45d7-8666-cca8d2701acc

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…t8ClampedArray to inferFn

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ede5220b-d007-4fb6-860a-248673dd964b

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 12, 2026

JavaScript port screenshot updates

Compared 30 screenshots: 0 matched, 30 missing references.

  • BrowserComponent — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/BrowserComponent.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as BrowserComponent.png in workflow artifacts.

  • ImageViewerNavigationModes — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/ImageViewerNavigationModes.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as ImageViewerNavigationModes.png in workflow artifacts.

  • MainActivity — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/MainActivity.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as MainActivity.png in workflow artifacts.

  • Sheet — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/Sheet.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as Sheet.png in workflow artifacts.

  • TextAreaAlignmentStates — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/TextAreaAlignmentStates.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as TextAreaAlignmentStates.png in workflow artifacts.

  • ToastBarTopPosition — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/ToastBarTopPosition.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as ToastBarTopPosition.png in workflow artifacts.

  • graphics-affine-scale — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-affine-scale.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-affine-scale.png in workflow artifacts.

  • graphics-clip — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-clip.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-clip.png in workflow artifacts.

  • graphics-draw-arc — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-arc.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-arc.png in workflow artifacts.

  • graphics-draw-gradient — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-gradient.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-gradient.png in workflow artifacts.

  • graphics-draw-image-rect — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-image-rect.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-image-rect.png in workflow artifacts.

  • graphics-draw-line — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-line.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-line.png in workflow artifacts.

  • graphics-draw-rect — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-rect.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-rect.png in workflow artifacts.

  • graphics-draw-round-rect — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-round-rect.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-round-rect.png in workflow artifacts.

  • graphics-draw-shape — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-shape.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-shape.png in workflow artifacts.

  • graphics-draw-string-decorated — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-draw-string-decorated.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-draw-string-decorated.png in workflow artifacts.

  • graphics-fill-arc — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-arc.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-arc.png in workflow artifacts.

  • graphics-fill-polygon — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-polygon.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-polygon.png in workflow artifacts.

  • graphics-fill-rect — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-rect.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-rect.png in workflow artifacts.

  • graphics-fill-round-rect — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-round-rect.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-round-rect.png in workflow artifacts.

  • graphics-fill-shape — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-shape.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-shape.png in workflow artifacts.

  • graphics-fill-triangle — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-fill-triangle.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-fill-triangle.png in workflow artifacts.

  • graphics-rotate — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-rotate.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-rotate.png in workflow artifacts.

  • graphics-scale — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-scale.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-scale.png in workflow artifacts.

  • graphics-stroke-test — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-stroke-test.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-stroke-test.png in workflow artifacts.

  • graphics-tile-image — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-tile-image.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-tile-image.png in workflow artifacts.

  • graphics-transform-camera — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-transform-camera.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-transform-camera.png in workflow artifacts.

  • graphics-transform-perspective — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-transform-perspective.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-transform-perspective.png in workflow artifacts.

  • graphics-transform-rotation — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-transform-rotation.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-transform-rotation.png in workflow artifacts.

  • graphics-transform-translation — missing reference. Reference screenshot missing at /home/runner/work/CodenameOne/CodenameOne/scripts/javascript/screenshots/graphics-transform-translation.png.

    No preview available for this screenshot.
    Full-resolution PNG saved as graphics-transform-translation.png in workflow artifacts.

… failures to warnings

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/ae5b0454-7080-4003-9dfb-eed23a6b9843

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
… OffscreenCanvas

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/b7fa2e59-a288-4ae6-9bea-d304c7f0bda8

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…enshot streams on iOS/Android

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/7d97f49d-a86e-44a0-b878-6a1bd7be1140

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 12, 2026

Android screenshot updates

Compared 36 screenshots: 34 matched, 2 updated.

  • Sheet — updated screenshot. Screenshot differs (320x640 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.

  • ValidatorLightweightPicker — updated screenshot. Screenshot differs (320x640 px, bit depth 8).

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

Native Android coverage

  • 📊 Line coverage: 7.78% (4098/52646 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.09% (20206/331686), branch 2.94% (940/32004), complexity 3.65% (1120/30648), method 6.41% (917/14311), class 10.44% (198/1896)
    • 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
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1492.000 ms
Base64 CN1 encode 1715.000 ms
Base64 encode ratio (CN1/native) 1.149x (14.9% slower)
Base64 native decode 1253.000 ms
Base64 CN1 decode 650.000 ms
Base64 decode ratio (CN1/native) 0.519x (48.1% faster)

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.

2 participants