Repository navigation
JavaScript port: never read the display canvas back (#6123) - #6124
Conversation
Every touchstart, mousedown and wheel event ran hitTest(), a 1x1 pixel read-back of the display canvas through a worker round trip, even in an application with no native peers, where every caller ignores the answer. Chrome counts getImageData calls per context and after a couple moves the canvas off the GPU for good, so every later frame was rasterized in software: a nine-row form scrolled at ~12fps on a budget Android phone. - hitTest() answers true without probing unless native peers are painted behind the canvas. - Reads that remain (getRGB of a surface, the peer pointer toggle, and the lens/glass/colour-matrix self-region effects) go through readCanvasPixels, which copies the region into a scratch canvas and reads that, so the source canvas is never read in place. - The composited rendering check now fails if a wheel, repeated mouse drags or repeated phone swipes read anything back from the display of its peer-free app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloudflare Preview
|
new ConnectionRequest() asks the platform whether it supports access points, so the test passed only when an earlier test class in the same JVM had installed a port and failed with a NullPointerException whenever surefire ran it first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
|
|
Compared 227 screenshots: 227 matched. |
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows x64Runner CPU: AMD64 Family 26 Model 2 Stepping 1, AuthenticAMD (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux x64Runner CPU: AMD EPYC 7763 64-Core Processor (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
|
Compared 206 screenshots: 206 matched. ParparVM vs HotSpot (JDK 25): Linux arm64Runner CPU: Neoverse-N2 (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
|
Compared 206 screenshots: 206 matched. Benchmark ResultsDetailed Performance Metrics
ParparVM vs HotSpot (JDK 25): Windows arm64Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in
Result: no regression |
Fixes #6123.
Cause.
HTML5Implementation.hitTest()read one pixel back from the display canvas (a worker round trip and agetImageData) on every touchstart, mousedown and wheel event. It did this even in an application with no native peers, where every caller discards the result. Chrome counts readbacks per canvas context and, after a couple, logs "Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true" and moves the canvas off the GPU for good. Every later frame of the full-screen canvas was then drawn in software: about 80 ms a frame on the reporter's Samsung A20e, against 16 ms on an iPhone, since Safari has no such heuristic.Fix.
hitTest()returns true without probing unless native peers are painted behind the canvas.readCanvasPixelsinbrowser_bridge.js:getRGBof a surface, the peer pointer toggle, and the lens, glass and color-matrix self-region effects. It copies the region into a scratchwillReadFrequentlycanvas and reads that, so the source canvas is never read in place. The pixel values are identical, and out-of-bounds pixels read as transparent. The scratch is dropped after any read above 1M pixels.Test.
test-javascript-composited-rendering.mjs, which already drives a peer-free app in CI, now fails if a wheel, repeated mouse drags or repeated phone swipes cause any worker__cn1_surface_read__request or anygetImageDataon the display canvas. The gestures are repeated because the first press of a page never probed: a single gesture passes even with the bug in place.Verified locally.
getImageData. After the fix it reports 0 and 0.verify-javascript-lens-parity.mjs: 0 failures.test-javascript-surface-replay.mjspasses.readCanvasPixelsreturns the same bytes asgetImageDataand does not trigger the warning; a directgetImageDatadoes.Not verified. The frame rate on a physical low-end Android phone. Headless Chrome cannot show the cost of software rasterization.
🤖 Generated with Claude Code