isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

isMaxLengthSupported() answered "supported" when the platform imposed no limit - #5670

Merged
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported
Sep 2, 2026
Merged

isMaxLengthSupported() answered "supported" when the platform imposed no limit#5670
shai-almog merged 1 commit into
masterfrom
fix-video-capture-maxlength-supported

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

VideoCaptureConstraints.isMaxLengthSupported() guarded on the resolved length where its three siblings guard on the preferred one:

predicatefirst clause
isQualitySupported()preferredQuality == 0
isMaxFileSizeSupported()preferredMaxFileSize == 0
isSizeSupported()preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported()maxLength == 0⚠️

That clause means "the caller asked for no constraint, so any resolved value satisfies it". Read off the resolved field it fires in the opposite situation instead: a platform that expresses no duration limit by resolving maxLength to 0 — every platform with no compiler registered, Java SE included, plus any compiler that declines the request — turned a five-second preference into isMaxLengthSupported() == true, and isSupported() with it. A caller asking whether its limit would be honored was told yes precisely when the answer was no.

It also broke the invariant getMaxLength() documents: "This value will be equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."

When the caller genuinely asked for no limit, preferredMaxLength and maxLength are both 0, so the new clause covers that case identically. The clause only ever changed the answer in the broken case.

Blast radius

No framework caller reads the predicate (the only references are the developer guide's snippet and a generated reflection shim), and no test asserted the old behaviour, so nothing depended on it.

Verification

  • The new testMaxLengthUnsupportedWhenResolvedToZero fails on the unfixed code (expected: <false> but was: <true>) and passes after — the other two new cases pass either way, which is what isolates the defect to this one clause.
  • Full core-unittests suite: 6077 tests, 0 failures.
  • SpotBugs over core-unittests: report regenerated, 0 findings.

Found by Codex review on #5664, where the guide chapter documents this API.

🤖 Generated with Claude Code

… no limit
The predicate guarded on the RESOLVED length where its three siblings guard on
the PREFERRED one:
isQualitySupported() preferredQuality == 0 || quality == preferredQuality
isMaxFileSizeSupported() preferredMaxFileSize == 0 || maxFileSize == preferredMaxFileSize
isSizeSupported() preferredWidth == 0 && preferredHeight == 0
isMaxLengthSupported() maxLength == 0 || maxLength == preferredMaxLength
The intent of that first clause is "the caller asked for no constraint, so any
resolved value satisfies it". Reading it off the resolved field makes it fire in
the opposite situation: a platform that expresses "no duration limit" by
resolving maxLength to 0 -- which is every platform with no compiler registered,
Java SE included, and any compiler that declines the request -- turned a
five-second preference into isMaxLengthSupported() == true, and isSupported()
with it. A caller asking whether its limit would be honored was told yes
precisely when the answer was no.
That also broke the invariant getMaxLength() documents: "This value will be
equal to getPreferredMaxLength() iff isMaxLengthSupported() is true."
When the caller asked for no limit, preferredMaxLength and maxLength are both 0,
so the new clause covers that case identically. The clause only ever changed the
answer in the broken case.
No framework caller reads the predicate, and no test asserted the old behaviour,
so nothing depended on it. The developer guide's Video-Capture-Constraints
example already describes the fixed semantics, and its support table already
lists Java SE as having no max-length support.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-09-02T11:26:58.417060Zfb5b823PR opened
ℹ️ 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.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 151 screenshots: 151 matched.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 9.10% (9017/99118 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.88% (46522/523733), branch 3.50% (1739/49629), complexity 3.48% (1842/52924), method 5.34% (1487/27841), class 10.74% (400/3723)
    • 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)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1187 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)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.Frame – 0.00% (0/570 lines covered)

Benchmark Results

Detailed Performance Metrics

MetricDuration
SIMD kernel backendscalar fallback (no native SIMD)
SIMD int-add (64K x300)java 302ms / native 219ms = 1.3x speedup
SIMD float-mul (64K x300)java 193ms / native 165ms = 1.1x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathgated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode74.000 ms
Base64 CN1 decode85.000 ms
Base64 native encode329.000 ms
Base64 encode ratio (CN1/native)0.225x (77.5% faster)
Base64 native decode265.000 ms
Base64 decode ratio (CN1/native)0.321x (67.9% faster)
Image encode benchmark statusskipped (SIMD unsupported)

@github-actions

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)
    • build-hint-catalog: 0 findings (no issues)
    • build-hint-tools: 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.

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog
shai-almog merged commit 045d113 into masterSep 2, 2026
29 checks passed
@shai-almog
shai-almog deleted the fix-video-capture-maxlength-supported branch September 2, 2026 11:55
@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 63ms / native 5ms = 12.6x speedup
SIMD float-mul (64K x300)java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode186.000 ms
Base64 CN1 decode112.000 ms
Base64 native encode823.000 ms
Base64 encode ratio (CN1/native)0.226x (77.4% faster)
Base64 native decode251.000 ms
Base64 decode ratio (CN1/native)0.446x (55.4% faster)
Base64 SIMD encode60.000 ms
Base64 encode ratio (SIMD/CN1)0.323x (67.7% faster)
Base64 SIMD decode45.000 ms
Base64 decode ratio (SIMD/CN1)0.402x (59.8% faster)
Base64 encode ratio (SIMD/native)0.073x (92.7% faster)
Base64 decode ratio (SIMD/native)0.179x (82.1% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)9.000 ms
Image createMask (SIMD on)7.000 ms
Image createMask ratio (SIMD on/off)0.778x (22.2% faster)
Image applyMask (SIMD off)59.000 ms
Image applyMask (SIMD on)65.000 ms
Image applyMask ratio (SIMD on/off)1.102x (10.2% slower)
Image modifyAlpha (SIMD off)54.000 ms
Image modifyAlpha (SIMD on)42.000 ms
Image modifyAlpha ratio (SIMD on/off)0.778x (22.2% faster)
Image modifyAlpha removeColor (SIMD off)57.000 ms
Image modifyAlpha removeColor (SIMD on)46.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.807x (19.3% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 77ms / native 5ms = 15.4x speedup
SIMD float-mul (64K x300)java 83ms / native 3ms = 27.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 native bridgeunavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode172.000 ms
Base64 CN1 decode105.000 ms
Image encode benchmark iterations100
Image createMask (SIMD off)6.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.333x (66.7% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)40.000 ms
Image applyMask ratio (SIMD on/off)0.727x (27.3% faster)
Image modifyAlpha (SIMD off)45.000 ms
Image modifyAlpha (SIMD on)40.000 ms
Image modifyAlpha ratio (SIMD on/off)0.889x (11.1% faster)
Image modifyAlpha removeColor (SIMD off)47.000 ms
Image modifyAlpha removeColor (SIMD on)48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)1.021x (2.1% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot123000 ms
Simulator Boot (Run)1000 ms
App Install21000 ms
App Launch4000 ms
Test Execution582000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 75ms / native 4ms = 18.7x speedup
SIMD float-mul (64K x300)java 131ms / native 3ms = 43.6x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode715.000 ms
Base64 CN1 decode209.000 ms
Base64 native encode1316.000 ms
Base64 encode ratio (CN1/native)0.543x (45.7% faster)
Base64 native decode2221.000 ms
Base64 decode ratio (CN1/native)0.094x (90.6% faster)
Base64 SIMD encode434.000 ms
Base64 encode ratio (SIMD/CN1)0.607x (39.3% faster)
Base64 SIMD decode116.000 ms
Base64 decode ratio (SIMD/CN1)0.555x (44.5% faster)
Base64 encode ratio (SIMD/native)0.330x (67.0% faster)
Base64 decode ratio (SIMD/native)0.052x (94.8% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)15.000 ms
Image createMask (SIMD on)2.000 ms
Image createMask ratio (SIMD on/off)0.133x (86.7% faster)
Image applyMask (SIMD off)103.000 ms
Image applyMask (SIMD on)208.000 ms
Image applyMask ratio (SIMD on/off)2.019x (101.9% slower)
Image modifyAlpha (SIMD off)55.000 ms
Image modifyAlpha (SIMD on)109.000 ms
Image modifyAlpha ratio (SIMD on/off)1.982x (98.2% slower)
Image modifyAlpha removeColor (SIMD off)58.000 ms
Image modifyAlpha removeColor (SIMD on)186.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)3.207x (220.7% slower)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 144 screenshots: 144 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

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

Benchmark Results

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

Build and Run Timing

MetricDuration
Simulator Boot84000 ms
Simulator Boot (Run)1000 ms
App Install36000 ms
App Launch3000 ms
Test Execution572000 ms

Detailed Performance Metrics

MetricDuration
SIMD kernel backendSSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300)java 81ms / native 6ms = 13.5x speedup
SIMD float-mul (64K x300)java 135ms / native 3ms = 45.0x speedup
SIMD kernel correctnessPASS (native result == scalar reference)
Base64 payload size8192 bytes
Base64 benchmark iterations6000
Base64 SIMD byte pathactive (NEON-accelerated)
Base64 CN1 encode388.000 ms
Base64 CN1 decode156.000 ms
Base64 native encode568.000 ms
Base64 encode ratio (CN1/native)0.683x (31.7% faster)
Base64 native decode428.000 ms
Base64 decode ratio (CN1/native)0.364x (63.6% faster)
Base64 SIMD encode125.000 ms
Base64 encode ratio (SIMD/CN1)0.322x (67.8% faster)
Base64 SIMD decode88.000 ms
Base64 decode ratio (SIMD/CN1)0.564x (43.6% faster)
Base64 encode ratio (SIMD/native)0.220x (78.0% faster)
Base64 decode ratio (SIMD/native)0.206x (79.4% faster)
Image encode benchmark iterations100
Image createMask (SIMD off)8.000 ms
Image createMask (SIMD on)1.000 ms
Image createMask ratio (SIMD on/off)0.125x (87.5% faster)
Image applyMask (SIMD off)55.000 ms
Image applyMask (SIMD on)39.000 ms
Image applyMask ratio (SIMD on/off)0.709x (29.1% faster)
Image modifyAlpha (SIMD off)61.000 ms
Image modifyAlpha (SIMD on)74.000 ms
Image modifyAlpha ratio (SIMD on/off)1.213x (21.3% slower)
Image modifyAlpha removeColor (SIMD off)69.000 ms
Image modifyAlpha removeColor (SIMD on)45.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off)0.652x (34.8% faster)

@shai-almog

shai-almog commented Sep 2, 2026

Copy link
Copy Markdown
CollaboratorAuthor

Compared 217 screenshots: 217 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

Sign up for freeto 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

@shai-almog