Skip to content

Fix for SIMD alloca regression#4842

Merged
shai-almog merged 2 commits into
masterfrom
fixed-alloca-regression-in-simd-image-mask
May 1, 2026
Merged

Fix for SIMD alloca regression#4842
shai-almog merged 2 commits into
masterfrom
fixed-alloca-regression-in-simd-image-mask

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

The bytecode compliance checker treats `array.length` and `array[i]`
expressions on a Simd alloca array as alloca-tainted. Including them in
string-concat'd error messages emits invokedynamic / Integer.valueOf
calls on those tainted values, which the checker (correctly) flags as
forbidden non-Simd consumers.

Restructure the alloca-direct phase to use only constant fail()
messages and pure-control-flow boolean checks. The image-scale repro
phase is unaffected because its arrays come from heap-backed
Image.getRGB().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 1, 2026

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

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 74000 ms
Simulator Boot (Run) 2000 ms
App Install 18000 ms
App Launch 13000 ms
Test Execution 289000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1668.000 ms
Base64 CN1 encode 1940.000 ms
Base64 encode ratio (CN1/native) 1.163x (16.3% slower)
Base64 native decode 1025.000 ms
Base64 CN1 decode 1314.000 ms
Base64 decode ratio (CN1/native) 1.282x (28.2% slower)
Base64 SIMD encode 443.000 ms
Base64 encode ratio (SIMD/native) 0.266x (73.4% faster)
Base64 encode ratio (SIMD/CN1) 0.228x (77.2% faster)
Base64 SIMD decode 487.000 ms
Base64 decode ratio (SIMD/native) 0.475x (52.5% faster)
Base64 decode ratio (SIMD/CN1) 0.371x (62.9% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 71.000 ms
Image createMask (SIMD on) 19.000 ms
Image createMask ratio (SIMD on/off) 0.268x (73.2% faster)
Image applyMask (SIMD off) 187.000 ms
Image applyMask (SIMD on) 91.000 ms
Image applyMask ratio (SIMD on/off) 0.487x (51.3% faster)
Image modifyAlpha (SIMD off) 191.000 ms
Image modifyAlpha (SIMD on) 102.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.534x (46.6% faster)
Image modifyAlpha removeColor (SIMD off) 258.000 ms
Image modifyAlpha removeColor (SIMD on) 147.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.570x (43.0% faster)
Image PNG encode (SIMD off) 1396.000 ms
Image PNG encode (SIMD on) 1375.000 ms
Image PNG encode ratio (SIMD on/off) 0.985x (1.5% faster)
Image JPEG encode 706.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 1, 2026

Compared 86 screenshots: 86 matched.

Native Android coverage

  • 📊 Line coverage: 9.90% (5379/54356 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 7.76% (26368/339581), branch 3.60% (1172/32588), complexity 4.55% (1419/31201), method 7.97% (1162/14572), class 13.07% (255/1951)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.90% (5379/54356 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 7.76% (26368/339581), branch 3.60% (1172/32588), complexity 4.55% (1419/31201), method 7.97% (1162/14572), class 13.07% (255/1951)
    • 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 988.000 ms
Base64 CN1 encode 219.000 ms
Base64 encode ratio (CN1/native) 0.222x (77.8% faster)
Base64 native decode 589.000 ms
Base64 CN1 decode 225.000 ms
Base64 decode ratio (CN1/native) 0.382x (61.8% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • Tests: 644 total, 0 failed, 2 skipped

Benchmark Results

  • Execution Time: 10298 ms

  • Hotspots (Top 20 sampled methods):

    • 24.49% java.lang.String.indexOf (444 samples)
    • 18.92% com.codename1.tools.translator.Parser.isMethodUsed (343 samples)
    • 16.99% java.util.ArrayList.indexOf (308 samples)
    • 4.91% java.lang.Object.hashCode (89 samples)
    • 4.47% com.codename1.tools.translator.ByteCodeClass.markDependent (81 samples)
    • 3.03% java.lang.System.identityHashCode (55 samples)
    • 2.81% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (51 samples)
    • 1.93% com.codename1.tools.translator.ByteCodeClass.updateAllDependencies (35 samples)
    • 1.60% com.codename1.tools.translator.BytecodeMethod.appendMethodSignatureSuffixFromDesc (29 samples)
    • 1.54% com.codename1.tools.translator.Parser.generateClassAndMethodIndexHeader (28 samples)
    • 1.38% com.codename1.tools.translator.ByteCodeClass.calcUsedByNative (25 samples)
    • 1.10% com.codename1.tools.translator.BytecodeMethod.optimize (20 samples)
    • 0.94% java.lang.StringBuilder.append (17 samples)
    • 0.66% com.codename1.tools.translator.Parser.cullMethods (12 samples)
    • 0.66% com.codename1.tools.translator.BytecodeMethod.appendCMethodPrefix (12 samples)
    • 0.61% com.codename1.tools.translator.BytecodeMethod.isMethodUsedByNative (11 samples)
    • 0.55% com.codename1.tools.translator.ByteCodeClass.markDependencies (10 samples)
    • 0.55% java.lang.StringCoding.encode (10 samples)
    • 0.50% com.codename1.tools.translator.BytecodeMethod.appendMethodC (9 samples)
    • 0.44% java.lang.StringBuilder.toString (8 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog shai-almog merged commit 21aec7a into master May 1, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant