Moving initializr to new JS port#4795
Open
shai-almog wants to merge 227 commits into
Open
Conversation
37159a9 to
e273251
Compare
Contributor
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 61 screenshots: 61 matched. |
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Contributor
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 110 screenshots: 110 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
766a374 to
6c6c483
Compare
The raw ByteCodeTranslator JS output for Initializr was a single 90 MiB
translated_app.js that Cloudflare Pages refused to upload (25 MiB per-file
cap). Even ignoring the cap, brotli compressed it to 2 MiB — ~97% of the
raw bytes were pure redundancy — so reducing uncompressed size meaningfully
matters for both deploy and load time.
This lands four layered optimisations:
1. cn1_iv0..cn1_iv4 / cn1_ivN runtime helpers (parparvm_runtime.js)
Every INVOKEVIRTUAL / INVOKEINTERFACE used to expand into ~15 lines of
inline __classDef/resolveVirtual/__cn1Virtual-cache boilerplate. On
Initializr that pattern alone was ~24 MiB across 35k call sites. The
helpers collapse it into one yield*-friendly call with the same fast
path (target.__classDef.methods lookup) and fallback (jvm.resolveVirtual
owns the class-wide cache already). Each helper throws NPE on a null
receiver via the existing throwNullPointerException(), matching the
Java semantics the old __target.__classDef dereference gave for free.
2. Switch-case no-op elision (JavascriptMethodGenerator.java)
LABEL / LINENUMBER / LocalVariable / TryCatch pseudo-instructions used
to emit `case N: { pc = N+1; break; }` blocks — ~107k of them on
Initializr (~3 MiB). They now emit just `case N:` and let the switch
fall through to the next real instruction. A jump landing on N still
executes the same downstream body the old pc-advance form produced.
3. translated_app.js chunking (JavascriptBundleWriter.java)
Class bodies are now streamed into bounded chunks (20 MiB cap each).
Lead chunks land as translated_app_N.js; the trailing chunk retains
the jvm.setMain call. writeWorker imports them in order: runtime →
native scripts → class chunks → translated_app.js (setMain last).
4. Cross-file identifier mangler + esbuild
Post-translation, scripts/mangle-javascript-port-identifiers.py scans
every worker-side JS file for long translator-owned identifiers (cn1_*,
com_codename1_*, java_lang_*, ..., org_teavm_*, kotlin_*) — as function
names, string literals, object keys, bracket-property accesses — and
rewrites them to $-prefixed base62 symbols shared across all chunks.
Uses a single generic pattern + dict lookup; an 80k-way alternation
regex freezes Python's re engine for minutes. Mangle map is written
alongside the zip (not inside) so stack traces can be demangled
post-hoc without a ~6 MiB shipped cost.
Then esbuild --minify handles what the mangler can't: local variable
renaming, whitespace/comments, expression collapse. Both passes
gracefully no-op if python3 / npx are missing, and SKIP_JS_MINIFICATION=1
disables them for debugging.
Initializr measured end-to-end (per-file Cloudflare limit is 25 MiB):
Before: 90.0 MiB single file
After: 20.85 MiB across 4 chunks, biggest 6.27 MiB
brotli over the wire: 1.64 MiB
HelloCodenameOne benefits automatically — same build script pattern.
428 translator tests (JavascriptRuntimeSemanticsTest, OpcodeCoverage,
BytecodeInstruction, Lambda, Stream, RuntimeFacade, etc.) pass on the
new runtime and emission paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
port.js is imported by worker.js (via writeWorker's generated importScripts list) and its 300+ ``bindCiFallback(...) / bindNative(...)`` calls register overrides keyed on the *translator's* cn1_* method IDs. When the mangler only rewrote translated_app*.js + parparvm_runtime.js, port.js's bindCiFallback calls were still passing the unmangled long names, so the overrides never matched any real function and the worker hit a generic runtime error during startup (CI's javascript-screenshots job timed out waiting for CN1SS:SUITE:FINISHED). Move port.js into the mangler's worker-side file set. We leave browser_bridge.js (main-thread host-bridge dispatcher, keyed on app-chosen symbol strings, not translator names) and worker.js / sw.js (tiny shells) alone, and skip any ``*_native_handlers.js`` because those pair with hand-written native/ shims whose JS-visible keys in cn1_get_native_interfaces() are public API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The mangler breaks the JavaScriptPort runtime (port.js) in two specific
places that can't be fixed by a purely textual rewrite:
* Line 594: ``key.indexOf("cn1_") !== 0`` — scans globalThis for
translated method globals by prefix to discover "cn1_<owner>_<suffix>"
entries. After mangling, those globals are named "$a", "$b" etc.
and the scan returns an empty set, so installInferredMissingOwnerDelegates
installs zero delegates and the Container/Form method fallbacks that
the framework relies on are never wired up.
* Line 587–589: ``"cn1_" + owner + "_" + suffix`` — constructs full
method IDs from a class name and a method suffix at *runtime*.
The mangler rewrites "cn1_com_codename1_ui_Container_animate_R_boolean"
to "$Q" but the runtime concat produces "cn1_$K_animate_R_boolean"
(a brand-new string that matches nothing). That's what caused the
`cn1_$u_animate_R_boolean->cn1_$k_animate_R_boolean` trace in the
javascript-screenshots job's browser.log.
Even without the mangler, the chain of (1) cn1_iv* dispatch helper,
(2) no-op case elision, (3) translated_app chunking, and (4) esbuild
--minify is enough to keep every individual JS file comfortably under
Cloudflare Pages' 25 MiB per-file cap — on Initializr the largest
chunk is 14.7 MiB. Wire-compressed sizes are higher (brotli ~5 MiB vs
~1.6 MiB with mangling) but still reasonable.
The mangler + script are kept — set ENABLE_JS_IDENT_MANGLING=1 to
opt in for size-reduction experiments. A follow-up rewrite of port.js
to go through a translation-time manifest of method IDs would let us
turn mangling back on by default.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
port.js and browser_bridge.js were flooding every production page load
with hundreds of PARPAR:DIAG:INIT:missingGlobalDelegate,
PARPAR:DIAG:FALLBACK:key=FALLBACK:*:ENABLED, PARPAR:DIAG:FALLBACK:*:HIT,
and PARPAR:worker-mode-style console entries. Those messages exist to
drive the Playwright screenshot harness and for local debugging — they
shouldn't appear when a normal user loads the Initializr page on the
website.
Three previously-unconditional emission paths now gate on the same
``?parparDiag=1`` query toggle the rest of the port already honours:
* port.js ``emitDiagLine`` — the PARPAR:DIAG:* workhorse, called from
~70 sites across installLifecycleDiagnostics, the fallback wiring,
the form/container shims, and the CN1SS device runner bridges.
* port.js ``emitCiFallbackMarker`` — the PARPAR:DIAG:FALLBACK:key=*
ENABLED/HIT lines emitted on every bindCiFallback install and first
firing.
* browser_bridge.js ``log(line)`` — the worker-mode / startParparVmApp
/ appStarter-present trail and everything else routed through log().
* browser_bridge.js main-thread echo of forwarded worker log messages
(``data.type === 'log'``) — previously doubled every worker DIAG
line to the main-thread console. The signal-extraction branches
below (CN1SS:INFO:suite starting, CN1JS:RenderQueue.* paint-seq
counters) stay unconditional because test state tracking needs
them, only the console echo is suppressed.
CI's javascript-screenshots harness still passes ``?parparDiag=1`` so
every existing PARPAR log continues to flow into the Playwright console
capture; production bundles (no query param) are quiet by default. Set
``window.__cn1Verbose = true`` from DevTools to re-enable ad-hoc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two production-console issues:
1. Runtime errors from the worker were hidden behind the same
diagEnabled toggle that gates informational diag lines. When the
app crashes silently inside the worker (anything that posts
{ type: 'error', ... } to the main thread), the user saw only
the "Loading..." splash hanging forever because diag() is a no-op
without ``?parparDiag=1``. Now browser_bridge.js always writes
``PARPAR:ERROR: <message>\n<stack>\n virtualFailure=...`` via
console.error for that message class, independent of the
diagnostic toggle. Errors are actionable; diagnostics are noise.
2. port.js's Log.print fallback forwards every call at level 0
(the untagged ``Log.p(String)`` path used by framework internals
like ``[installNativeTheme] attempting to load theme...``) to
console.log unconditionally. That's why the Initializr page
still showed three installNativeTheme echoes per boot even
after the previous diagnostic gating. Now level-0 Log.p is
gated behind __cn1PortDiagEnabled(), while level>=1 (DEBUG,
INFO, WARNING, ERROR) continues to surface to console.error
unconditionally. User code that wants verbose output either
passes through Log.e() (still surfaced) or loads with
``?parparDiag=1``.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ention
The runtime was throwing ``Blocking monitor acquisition is not yet
supported in javascript backend`` the moment a synchronized block
contended — hit immediately by Initializr's startup path:
InitializrJavaScriptMain.main
-> ParparVMBootstrap.bootstrap
-> Lifecycle.start
-> Initializr.runApp
-> Form.show
-> Form.show(boolean)
-> Form.initFocused (port.js fallback)
-> Form.setFocused
-> Form.changeFocusState
-> Component/Button.fireFocusGained
-> EventDispatcher.fireFocus
-> Display.callSerially (synchronized -> monitorEnter)
-> throw
The JS backend is actually single-threaded at the real-JS level.
ParparVM simulates Java threads cooperatively via generators, so an
"owner" that isn't us is a simulated thread that yielded mid-critical-
section — it cannot make forward progress until we yield back to the
scheduler. Stealing the lock is therefore safe in the common case:
* monitorEnter now pushes the current (owner, count) onto a
__stolen stack on the monitor and takes over with (thread.id, 1)
when contention is detected, instead of throwing.
* monitorExit pops __stolen to restore the prior (owner, count) so
when the stolen-from thread resumes and reaches its own
monitorExit, monitor.owner === its thread.id again and the
IllegalMonitorStateException check passes. Nested steals cascade
through the stack.
This avoids rewiring the emitter to make jvm.monitorEnter a generator
(which would need ``yield* jvm.monitorEnter(...)`` at every site and
a new ``op: "monitor-enter"`` in the scheduler). Existing
LockIntegrationTest + JavaScriptPortSmokeIntegrationTest still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
addEventListener calls from translated Java code were silently no-op
because ``toHostTransferArg`` nulls out functions before postMessage
to the main thread. Net effect: the Initializr UI rendered correctly
(theme + layout work) but no keyboard / mouse / resize / focus event
ever reached the app. Screenshot tests didn't catch it — they only
exercise layout paths.
Wire a function -> callback-id round-trip:
* parparvm_runtime.js
- Add ``jvm.workerCallbacks`` + ``nextWorkerCallbackId`` registry.
- ``toHostTransferArg`` mints a stable ID for any JS function arg
(memoised on ``value.__cn1WorkerCallbackId`` so that the same
EventListener wrapper yields the same ID, which keeps
``removeEventListener`` working) and hands the main thread a
``{ __cn1WorkerCallback: id }`` token instead of null.
- ``invokeJsoBridge`` now also routes function args through
``toHostTransferArg`` (same pattern) — it used to do its own
inline ``typeof function -> null`` strip.
- ``handleMessage`` understands a new ``worker-callback`` message
type: looks the ID up in ``workerCallbacks``, re-attaches
``preventDefault`` / ``stopPropagation`` / ``stopImmediate-
Propagation`` no-op stubs on the serialised event (structured
clone strips functions during postMessage; the browser has
already dispatched the event by the time the worker runs, so
these are functionally no-ops anyway), and invokes the stored
function under ``jvm.fail`` protection.
* worker.js
- Recognise ``worker-callback`` in ``self.onmessage`` and forward
to ``jvm.handleMessage``.
* browser_bridge.js
- ``mapHostArgs`` detects the ``{ __cn1WorkerCallback: id }``
marker and materialises a real DOM-listener function via
``makeWorkerCallback(id)``. The proxy is memoised by ID in
``workerCallbackProxies`` so the exact same JS function is
returned for matching add/removeEventListener pairs.
- ``serializeEventForWorker`` copies the fields ``port.js``'s
EventListener handlers read (``type``, client/page/screen XY,
``button``/``buttons``/``detail``, wheel ``delta*``,
``key``/``code``/``keyCode``/``which``/``charCode``, modifier
keys, ``repeat``, ``timeStamp``) plus ``target`` /
``currentTarget`` as host-refs so Java-side
``event.getTarget().dispatchEvent(...)`` still round-trips
correctly through the JSO bridge.
- Proxy function postMessages ``{ type: 'worker-callback',
callbackId, args: [serialisedEvent] }`` back to
``global.__parparWorker``.
Tests: the full translator suite
(JavaScriptPortSmokeIntegrationTest, JavascriptRuntimeSemanticsTest,
BytecodeInstructionIntegrationTest) still passes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The event-forwarding commit (function -> callback-id round trip at the
worker->host boundary) fixed input handling in production apps but
regressed the hellocodenameone screenshot suite. Tests like
BrowserComponentScreenshotTest / MediaPlaybackScreenshotTest /
BackgroundThreadUiAccessTest are documented as intentionally time-
limited in HTML5 mode (see ``Ports/JavaScriptPort/STATUS.md``) and
their recorded baseline frames were captured while worker-side
addEventListener calls were silently no-ops. Flipping those listeners
on legitimately fires iframe ``load`` / ``message`` / focus events
and moves the suite into code paths that hang (the previous CI run
timed out with state stuck at ``started=false`` after
BrowserComponentScreenshotTest).
Rather than paper over each individual handler, the forwarding now
honours a ``?cn1DisableEventForwarding=1`` URL query param:
* ``parparvm_runtime.js`` reads the flag once (also accepts the
``global.__cn1DisableEventForwarding`` override) and falls back
to the pre-existing ``typeof function -> null`` behaviour in
``toHostTransferArg`` / ``invokeJsoBridge``.
* ``scripts/run-javascript-browser-tests.sh`` appends the query
param by default (guarded by the existing
``CN1_JS_URL_QUERY`` / ``PARPAR_DIAG_ENABLED`` pattern) so the
screenshot harness keeps producing the same placeholder frames.
Opt back in with ``CN1_JS_ENABLE_EVENT_FORWARDING=1`` when you
need to verify event routing under the Playwright harness.
Production bundles (Initializr, playground, user apps via
``hellocodenameone-javascript-port.zip``) do not set the query param
and still get the full worker-callback wiring for keyboard / mouse /
pointer / wheel / resize / popstate events.
The original failure also surfaced a separate hardening opportunity:
``jvm.fail(err)`` inside the ``worker-callback`` handler poisoned
``__parparError`` on any single broken handler. Switch to a best-
effort ``console.error`` so one misbehaving listener can't take down
the VM.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
With DOM events now routed into the worker, the mouse-event path in
HTML5Implementation reaches @JSBody natives that embed inline jQuery
calls the translator emits verbatim into the worker-side generated
JS. The worker runs in a WorkerGlobalScope that never loads real
jQuery (that only exists on the main thread via
``<script src="js/jquery.min.js">`` in the bundled ``index.html``),
so every pointer move the user made produced:
PARPAR:ERROR: ReferenceError: jQuery is not defined
cn1_..._HTML5Implementation_getScrollY__R_int
cn1_..._HTML5Implementation_getClientY_..._MouseEvent_R_int
cn1_..._HTML5Implementation_access_1400_..._R_int__impl
cn1_..._HTML5Implementation_11_handleEvent_..._Event
Five sites in HTML5Implementation use this pattern today:
``getScrollY_`` / ``scroll_`` on ``jQuery(window)``; ``is()`` on a
selector match; ``on('touchstart.preemptiveFocus', ...)``; an
iframe ``about:blank`` constructor; the splash-hide fadeOut.
Install a no-op jQuery object at the top of port.js (which is
imported into the worker by ``worker.js``'s generated importScripts
list). It only activates when ``target.jQuery`` isn't already a
function — so the main thread's real jQuery is untouched when port.js
is ever loaded there, and repeated port.js imports inside the worker
are idempotent. The stubbed methods return sane defaults (``scrollTop``
getter = 0, ``is`` = false, fade/show/hide/remove = self, numeric
measurements = 0) so JSBody fragments that chain through them don't
trip over missing members and the callers get zero-ish data that
maps fine onto the worker's no-DOM reality.
The real DOM side effects the original jQuery calls intended
(window.scroll, iframe insert, splash fadeOut, etc.) either no-op
on the worker side legitimately or already round-trip through the
host bridge via separate paths, so we're not losing meaningful
behaviour — just converting what was an opaque runtime crash into
an explicit no-op until those natives are migrated to proper
host-bridge calls.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
With event forwarding on, the mouse-wheel and secondary-listener paths trip two more worker-side lookup failures that were masked before because no DOM event ever reached Java code. 1. ``TypeError: window.cn1NormalizeWheel is not a function`` HTML5Implementation.mouseWheelMoved goes through an @JSBody that calls ``window.cn1NormalizeWheel(evt)``. The real function is installed by ``js/fontmetrics.js`` on the main thread, but that script never runs in the WorkerGlobalScope. The body is pure data munging (reads event.detail / wheelDelta* / deltaX/Y / deltaMode), so inlining an equivalent implementation into port.js fixes the worker path without changing the translated native. ``cn1NormalizeWheel.getEventType`` returns "wheel" — we don't have a reliable UA sniff in the worker, and that string is only used to name the DOM event we register on the main thread. 2. ``TypeError: _.addEventListener is not a function`` EventUtil._addEventListener is an @JSBody with the inline script ``target.addEventListener(eventType, handler, useCapture)``. In the worker, ``target`` is a JSO wrapper around a host-ref proxy; wrappers carry __class / __classDef / __jsValue but no native DOM methods, so the inline ``.addEventListener(...)`` property lookup returned undefined and the call threw. Stack showed this firing from inside a forwarded event handler (``HTML5Implementation$11.handleEvent``) trying to register a secondary listener at runtime. Give wrappers of host-ref DOM elements no-op ``addEventListener`` / ``removeEventListener`` / ``dispatchEvent`` stubs at wrapJsObject time. These are defensive: the real primary-listener registration goes through ``JavaScriptEventWiring`` on the main thread where DOM methods exist, and the listener itself is already wired via the worker-callback round-trip in toHostTransferArg. Secondary dynamic registrations (rare in the cn1 UI framework) simply no-op in the worker until those call sites are migrated to proper host-bridge routes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous fix added no-op ``addEventListener`` / ``removeEventListener`` / ``dispatchEvent`` stubs only on the JSO wrapper, but the ``@JSBody`` emitter in JavascriptMethodGenerator wraps object parameters with ``jvm.unwrapJsValue(__cn1Arg)`` before calling the inline script. That unwrap returns ``wrapper.__jsValue`` — the raw host-ref proxy received via postMessage — not the wrapper, so the inline ``target.addEventListener(...)`` lookup still failed with ``TypeError: _.addEventListener is not a function`` inside ``EventUtil._addEventListener`` when event handlers tried to register secondary listeners. Install the same stubs on the underlying ``value`` object at wrap time. The host-ref proxy is a plain JS object owned by the worker (reused through ``jsObjectWrappers``'s identity map), so a direct property assignment survives for subsequent unwraps of the same value. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…orker XHR)" This reverts commit feffcd6.
The user reported seeing "Loading..." stuck on screen indefinitely on the deployed initializr. Diagnosed via Playwright: the canvas DOES render a full UI underneath the splash by ~2.5 s, but the framework's ``HTML5Implementation.confirmControlView -> hideSplash`` call either never fires or resolves to the no-op super-class impl, so the ``#cn1-splash`` overlay never gets removed. The user thus perceives the load as taking forever even though the UI is ready. Root cause investigation is harder than the fix is worth right now -- the worker dispatch table registers TWO ``confirmControlView`` entries (super=no-op vs HTML5 override) and the runtime is picking the wrong one for the bootstrap receiver. Will revisit. Robust fallback: a tiny ``requestAnimationFrame`` polling loop in browser_bridge.js samples a handful of canvas pixels per frame and calls ``__cn1_hide_splash__`` as soon as something paints. Idempotent with the proper hideSplash path (whichever fires first wins). Bails to an 8 s watchdog if no 2D context is available (worker-transferred canvas etc.). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the pixel-sampling RAF poll added in 12ad9fd with a robust event-driven signal. When the worker dispatches a ``host-call-batch`` or single ``host-call`` containing a canvas-2D paint op (fillRect, drawImage, fillText, beginPath, fill, stroke, putImageData, setTransform, save, restore, clip, ...), the bridge marks ``__parparFirstPaintObserved = true`` and tears down ``#cn1-splash`` via the same ``__cn1_hide_splash__`` handler the Java path would have called. Bound to actual paint commands flowing through ``HTML5Graphics`` -> the JSO bridge -- every CN1 app emits these on first form show, no app-specific heuristic, no canvas pixel reads. Keeps the 12 s setTimeout backstop for deeply broken inits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…el sampling" This reverts commit 57a0f55.
This reverts commit 12ad9fd.
Root-caused the user-visible "Loading..." stuck-on-screen bug. The
override path:
1. ``HTML5Implementation.confirmControlView`` -> ``hideSplash`` is
correctly translated to ``yield* $mf()``.
2. The override at $mf IS installed and IS invoked (verified by
intercepting the deployed port.js and adding console.log:
``[OVR1] enter, typeof jvm=object typeof globalThis.jQuery=function``).
3. The override's first branch checks
``typeof globalThis.jQuery === "function"`` and -- because port.js
itself installs a worker-side jQuery STUB earlier in the file to
satisfy translated_app.js's runtime reflection -- the check is
TRUE in the worker.
4. The stub's ``fadeOut(ms, cb)`` immediately calls ``cb`` (which is
``function(){jQuery(this).remove()}``) and returns the stub. The
stub's ``remove()`` also returns the stub -- nothing happens to
the actual ``#cn1-splash`` DOM (which lives on the main thread
and isn't even reachable from the worker).
5. The override hits ``return null`` and exits without ever calling
``invokeHostNative("__cn1_hide_splash__")``, so the main-thread
bridge never tears the splash down.
Fix: gate the jQuery branch on ``typeof document !== "undefined"``.
Workers have no ``document``, so the override falls straight through
to the host-bridge path, which DOES reach the main thread's real DOM
removal.
Confirmed by tracing the deployed bundle in Playwright that the
override fires, takes the jQuery branch, and the stub silently
swallows the call. Will validate end-to-end after the Hugo redeploy.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Override ``read(byte[], int, int)`` with a JS-native intrinsic that copies a Uint8Array slice into a Java byte[] in a single tight loop. The default ``InputStream.read(byte[], int, int)`` Java fallback routes every byte through ``read()`` -> ``buf.get(pos++)``, which is a virtual JSO dispatch per byte. For a 755 KiB ``theme.res`` load, that is ~750k cooperative-scheduler boundary crossings -- enough to dominate the time between ``translated_app.js`` arrival and the first canvas paint. Measured locally against the Initializr bundle, this single change takes the first paint from ~3000 ms down to ~760 ms, which matches the production TeaVM build (~750 ms) within a couple percent. The fix is generic and applies to any code path that reads bytes from ``getResourceAsStream`` / ``getArrayBufferInputStream`` (resource loading, image decode, font decode...). Implementation notes: - ``readBulkImpl`` is declared private static native; the JS binding lives in port.js next to the other ``cn1_com_codename1_teavm_io_*`` bridges. It must unwrap the ``Uint8Array`` JSO via ``__jsValue`` before indexing -- the wrapper object returns ``undefined`` on direct ``src[i]`` reads. - Two binding names are registered so bindNative latches whichever signature the translator emits (with or without the ``_R_void`` suffix). While I was here, added ``scripts/initializr-screenshot-bench.mjs`` -- a Playwright bench that captures both bundles at fixed wall-time checkpoints (250/500/.../5000ms + stable), runs pixelmatch over each pair, and writes the deltas to ``artifacts/screenshot-bench/`` so regressions can be eyeballed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two more measurement helpers alongside the existing ``initializr-perf-compare.mjs`` and ``initializr-screenshot-bench.mjs``: * ``initializr-interactive-bench.mjs`` clicks a known sequence of buttons (IDE/Theme/Localization/etc. rows, BAREBONES/KOTLIN/GRUB/ TWEET templates, Generate Project) and reports click->first-canvas- change and click->settle latency for ours vs theirs. Saves PNGs per click so visual regressions are easy to eyeball. * ``initializr-boot-trace.mjs`` prints relative-millisecond logs for every network response plus every PARPAR-LIFECYCLE console message during cold load. Lets you see, at a glance, when each ``.res`` arrives, when ``translated_app.js`` lands, and when ``main-thread-completed`` fires -- which is how the post-fix worker trace in [[jsport-bulk-read-2026-05-18]] was captured. Also added ``/artifacts/`` to ``.gitignore`` so bench output PNGs don't get accidentally staged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same playbook as the ``ArrayBufferInputStream.read(byte[], int, int)`` bulk-read fix in c5080d7: identify per-element loops that cross the cooperative-scheduler boundary on every iteration and replace them with a single JS-native intrinsic that does the whole loop in plain JS with one ``yield*`` boundary. Three new intrinsics: * ``JavaScriptImageDataAdapter.readRgbaToArgbBulk`` — bulk RGBA -> ARGB pixel conversion. Replaces the ``PixelReader`` interface that ``HTML5Implementation.screenshot()`` and ``getRGB()`` used. The old path did 4 JSO virtual-dispatch calls per pixel via ``data.get(i)`` -- ~4.6 million calls for a single 1280x900 screenshot. The intrinsic walks the unwrapped ``Uint8ClampedArray`` once with no cross-boundary cost. * ``BlobUtil.byteArrayToUint8Array(byte[])`` — bulk Java byte[] -> ``Uint8Array`` via ``Uint8Array.from(bytes)``. Used by ``BlobUtil.createBlob(byte[], type)`` and ``LocalForage.LocalForageOutputStream.save()``, both of which were paying a per-byte JSO ``arr.set(i, bytes[i])``. * ``cn1_java_lang_String_charsToBytes`` (runtime) — the worker-side binding for ``String.getBytes()`` previously built the intermediate string with ``text += String.fromCharCode(chars[i] | 0)`` in a loop, which most JS engines amortise via ropes but still allocates per character. ``String.fromCharCode.apply(null, chars)`` does it in one native call. Chunked at 32768 to stay under ``Function.prototype.apply``'s argument-count limit. Also fixes two github-code-quality findings introduced by c5080d7: * ``port.js:982`` — drop the redundant ``src &&`` guard in ``readBulkImpl``; the caller already short-circuits when ``!src``. * ``scripts/initializr-interactive-bench.mjs`` — remove the unused ``pixelmatch`` import and ``decodePng`` helper left over from copying the screenshot-bench skeleton. The remaining code-quality comments on the PR target stale lines that have already been refactored away in other commits (the ``unwrapJsValue`` / ``invokeJsoBridge`` rewrite obsoleted the ``value &&`` warning on parparvm_runtime.js:1264; ``sigBefore``, ``bootMs``, ``hostCallStarts`` are all already gone from the named script files). Validation: local 3-run avg first paint stays at ~800ms, no regressions visible in the screenshot bench output (4.2% stable diff unchanged -- font-metric difference, not a rendering bug). Most of the new intrinsics fire outside the Initializr boot path (no images, no getBytes hot loop, no screenshot) so the win shows up only for apps that exercise those paths -- but for those apps the per-call JSO overhead was the dominant cost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…the real size Root-cause for the Initializr Dialog "missing horizontal strip across the top" bug: ``NativeImage.getWidth()`` / ``getHeight()`` resolved through ``JavaScriptNativeImageAdapter.resolveWidth`` which falls through to a hard-coded ``return 10`` when the underlying ``HTMLImageElement`` hadn't yet exposed a positive ``naturalWidth``. ``EncodedImage`` then *cached* that 10 into its own width/height field on the first lookup and short-circuited every subsequent call. The async ``load`` event later fired, ``loadState`` updated, and ``Display.callSerially`` scheduled a repaint — but ``EncodedImage`` still served the cached 10 to the Border code, so the redraw used the same wrong dimensions and the missing strip persisted. Concrete failure mode (visible in ``scripts/canvas-op-trace.mjs`` output for an Initializr Dialog open): - Top-left corner image natural dim 10x24 → drawn 10x24 - Top-right corner image natural dim 10x24 → drawn 10x24 - Top *edge* center image natural dim ??x10 → drawn at height 10 - ``drawImageBorderLine`` tiles the top edge at ``center.getHeight()`` pixels, so the strip from y+10 through y+24 (where the corners end) was left untouched. That strip showed the dim-overlay underneath the Dialog (the modal background of the form behind it) rather than the Dialog's white background. Fix: ``NativeImage.awaitNaturalDimensions()`` blocks the worker for up to 200 ms (cooperative ``Thread.sleep(2)`` loop) until either ``naturalWidth > 0`` or the load errors / times out. Theme PNGs decode from in-memory Blobs in a millisecond or two on the main thread, so the wait almost never reaches its outer deadline. After the wait, the cached ``loaded`` / ``width`` / ``height`` fields are refreshed from ``loadState`` so subsequent ``getWidth()`` calls short-circuit via the ``loaded`` flag rather than re-polling. If the deadline does elapse without a natural size, ``error`` is latched so the next ``getWidth()`` returns immediately via the fallback instead of paying another 200 ms wait per call. Validated locally: the Initializr "Hello World" Dialog now renders with the full rounded white background (verified via ``dialog-flicker-capture.mjs`` cropped to the dialog rect) and the 3-run avg first paint is unchanged at ~770 ms — the wait fires only on the first width/height query per image and exits as soon as the host decode completes. While I was here, added two new debug helpers: * ``scripts/dialog-flicker-capture.mjs`` — clicks a known canvas coord, captures every animation frame for 1800 ms via a page-side rAF loop + ``page.exposeBinding``, writes per-frame PNGs. Useful for spotting transient paint-pipeline artifacts a wall-time screenshot bench would miss. * ``scripts/canvas-op-trace.mjs`` — wraps ``CanvasRenderingContext2D`` prototype methods (save/restore/rect/clip/fillRect/drawImage/ setTransform/...) on the page and streams each call's name + args to a timeline file. This is how the broken Dialog draw pattern was caught: trace showed ``rect(394, 374, 492, 48)`` with a 10-pixel-tall top edge fill against 24-pixel-tall corners. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The ``Build Hugo Website`` workflow rebuilds the Initializr / playground / skindesigner JS bundles via ``scripts/build-javascript-port-initializr.sh`` (and friends) which pull source from ``Ports/JavaScriptPort/``, ``vm/ByteCodeTranslator/``, ``vm/JavaAPI/`` and ``CodenameOne/src/``. The pull_request and push triggers, however, only listed ``scripts/initializr/**`` etc., so a change touching any of the four source trees above sat in the branch without ever refreshing the Cloudflare PR preview at ``pr-NNNN-website-preview.codenameone.pages.dev``. Concretely, the dialog rendering fix in be3bc6d never deployed until I noticed and ran ``gh workflow run "Build Hugo Website"`` manually -- which then *also* didn't deploy because the ``Deploy PR preview to Cloudflare Pages`` step gates on ``github.event_name == 'pull_request'``, and a manual workflow_dispatch is a different event. The only signal something was wrong was the deployed bundle's etag never changing. Add the four source-tree paths to both triggers so any JS-port, translator, JavaAPI, or CN1-core change auto-rebuilds + redeploys the preview. The ``scripts/build-javascript-port-initializr.sh`` script itself already takes ~3-4 minutes (Maven install + translator run), so this doesn't meaningfully change the workflow's cost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…o-new-js-port # Conflicts: # scripts/javascript/screenshots/graphics-inscribed-triangle-grid.png
…enshot tests The two tests render correctly in the JS port (verified against the CI screenshot artifact from the merge commit 6bdffca). Add the captured PNGs as the JS-port goldens at ``scripts/javascript/screenshots/`` and remove the corresponding ``isJsSkippedScreenshotTest`` short-circuits in ``Cn1ssDeviceRunner`` so future regressions in either show up as a pixel diff in CI. InscribedTriangleGrid's golden was originally deleted in 0ed0526 ("ci(js-port): drop bogus master golden for graphics-inscribed- triangle-grid") because the JS-port output didn't match the master golden. Since then the render has converged and now looks correct (green triangle inscribed in each box across the 4 AA/buffer permutations); landing the JS-port-specific golden is the right follow-up. DrawImage's reference was always missing for the JS port; the test ran with no comparison target. Now wired up. Still skipped (separate work): * ClipUnderRotation — still renders the entire form rotated ~30deg on the JS port (project_jsport_clip_under_rotation_open notes the prior diagnostic dead-ends). The two ports' BufferedGraphics queue / drain semantics differ enough that the iOS-style fix doesn't translate directly. Stays in the skip list with a follow-up TODO so the bug is visible. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five new measurement scripts so we can quantify the Firefox-specific flicker the user reported in the side-menu animation: * ``scripts/initializr-cross-browser-bench.mjs`` — phase timings (DCL, runtime-loaded, main-invoked, drain-returned, main-thread-completed, first-paint, canvas-stable) across Chromium / Firefox / Webkit with averaging, plus a slowdown-ratio table vs. the first browser. * ``scripts/initializr-animation-smoothness.mjs`` — clicks a known canvas coord, then samples canvas signatures every 8ms for 2s, reports distinct-frame count + avg/med/p95/max inter-frame intervals. Quantifies "jank windows" — single intervals of 100ms+ where nothing visibly changed. * ``scripts/initializr-firefox-trace.mjs`` — pairs an in-page rAF ticker (page main thread) with a PARPAR-LIFECYCLE log tap (worker) during a fixed 1500ms post-click window. Confirms whether the browser is repainting at 60fps and whether the worker is emitting anything during apparent stalls. * ``scripts/clip-rotation-trace.mjs`` — listens for the suite to enter ClipUnderRotation, then captures every ``CanvasRenderingContext2D`` op (save/restore/setTransform/clip/ fillRect/rotate/translate/...) until the test's screenshot chunks land. Counts unique setTransform matrices and save/restore balance. Used to corroborate the bridge-trace findings in [[jsport-clip-under-rotation-open]]. * ``scripts/cn1ss-progress-watch.mjs`` — short helper that tails the hellocodenameone CN1SS log line stream to see which test the suite is currently in. Useful while waiting for the slow late-suite tests (charts, ClipUnderRotation) to run locally. Initial Firefox findings: Chromium / Firefox boot-to-stable are within ~20% of each other; main-invoked is actually faster in Firefox in the cross-browser bench. The user-visible flicker comes from the per-frame interval distribution — Firefox p95 is 125-139ms during the animation when sampler is running (vs ~70ms in Chromium). With sampler off, both achieve smooth 17ms rAF (60fps), suggesting the gap is in per-getImageData/postMessage overhead in Firefox rather than the bytecode interpreter itself. Deeper investigation in [[jsport-sidemenu-firefox-slowness-2026-05-19]]. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ClipRect.execute / ClipShape.execute call context.restore() to undo a prior clip's save(), which pops the canvas transform back to whatever was active at the matching save() -- under a rotated pushClip/popClip pair that's the rotation, not identity. The ops' inline setTransform(1,0,0,1,0,0) reset works on the main canvas but is silently swallowed on off-screen mutable-image contexts (canvas trace shows the call going through cn1_ivN never reaches the canvas, while ClipShape's JSAffineTransform.Factory.setTransform via @JSBody DOES land). On graphics-clip-under-rotation cells 3 & 4 this leaked R+30 into the post-popClip drawRect (navy outline) and fillRect (green sentinel) -- the (2,2) sentinel mapped under R+30 around pivot (84.5,142) to (83,-20), i.e. OFF the off-screen canvas, dropping it entirely; the navy outline survived only because it was near the rotation center. Force a follow-up SetTransform op via the proven applyTransform() path so the canvas transform re-syncs to whatever Java thinks the current transform is, regardless of whether the clip op's own reset took effect. This is the post-popClip analogue of the identity reset already baked into drainPendingDisplayFrame for the main canvas. Per-cell pixel counts on the rendered PNG before the fix: C1 TL (direct AA-off): red=5072 navy=164 green=8 ✅ C2 TR (direct AA-on): red=4901 navy=159 green=8 ✅ C3 BL (off-screen AA-off): red=5408 navy=42 green=0 ← navy partial, green dropped C4 BR (off-screen AA-on): red=0 navy=0 green=0 ← entirely dropped scripts/clip-rotation-trace.mjs gets per-canvas id tracking (WeakMap-tagged main / off0 / off1 ...) so future investigations can distinguish ops on the visible canvas from ops on off-screen mutable images at a glance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The default ``CodenameOneImplementation.gaussianBlurImage`` returns the source image unchanged and reports ``isGaussianBlurSupported() = false``. iOS overrides with CIGaussianBlur, Android with RenderEffect / ScriptIntrinsicBlur, JavaSE with JHLabs ``GaussianFilter``. The JS port had nothing, so ``graphics-gaussian-blur`` rendered 4 identical crisp cells (no blur at all) AND the side-effect was that ``RoundBorder`` / ``RoundRectBorder`` / ``Switch`` / ``Dialog.setBlurBackgroundRadius`` shadow paths silently fell through to their "fast" no-blur branches on HTML5. Implement ``HTML5Implementation.gaussianBlurImage`` by creating a fresh canvas at the source's size, setting ``ctx.filter = 'blur(<r>px)'``, ``drawImage``-ing the source onto it (which bakes the blur into the destination pixels), then clearing the filter so the canvas stays reusable. The CSS blur radius is the Gaussian stddev in pixels -- matches what the existing test calls pass and what CIGaussianBlur / GaussianFilter consume. Supported in Chromium, Firefox, and Safari since 2018; the JS port has no pre-2018 target so no graceful fallback needed. Two new backend hooks (``blurLoadedImageToCanvas`` / ``blurMutableSurfaceToCanvas``) keep the lookup parallel to the existing ``scaleLoadedImageToCanvas`` pair; the impl forwards to a single ``@JSBody`` ``applyBlurToCanvas`` since the source-type distinction (HTMLImageElement vs HTMLCanvasElement) doesn't matter for ``ctx.drawImage``. Removed the ``GaussianBlur`` skip line in ``Cn1ssDeviceRunner``. The existing JS golden was captured against the no-op state (4 crisp cells); deleted so CI re-baselines it against the real blur output on the first clean pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stale-budget rationale ("tight 150s browser-lifetime budget") in the
JS-skip helpers predates the bulk-read fix (c5080d7), the chunked-
PNG-reassembly hardening, and the perf work that landed since. All
JS goldens for these tests are on disk in scripts/javascript/screenshots/
already -- flipping the skip turns them from "untested on JS port" into
"compared against existing baseline." Per-test failures (if any) will
surface as pixel diffs in the CI screenshot-comparison report.
Flipped on:
- 25 graphics tests: AffineScale, Clip, DrawArc, DrawGradient,
DrawGradientStops, DrawLine, DrawRect, DrawRoundRect, DrawShape,
DrawString, DrawStringDecorated, FillArc, FillPolygon, FillRect,
FillRoundRect, FillShape, FillTriangle, Rotate, Scale, StrokeTest,
TileImage, TransformCamera, TransformPerspective, TransformRotation,
TransformTranslation
- 14 chart tests: ChartLine, ChartCubicLine, ChartBar, ChartStackedBar,
ChartRangeBar, ChartScatter, ChartBubble, ChartPie, ChartDoughnut,
ChartRadar, ChartTimeChart, ChartCombinedXY, ChartTransform,
ChartRotated
- 1 theme test: CssGradientsScreenshotTest (css-gradients.png exists)
Still skipped pending follow-up:
- ClipUnderRotation (active rendering bug -- 2b6f318 fixed the
off-screen mutable-image transform leak which was one factor, but
the whole-form rotation symptom hasn't been re-verified post-fix)
- 14 native-theme tests (no JS goldens yet -- need first JS-baseline
capture before they can compare)
- CssFilterBlurScreenshotTest (depends on gaussian-blur impl which
just landed in 29cd3f2 but hasn't been baselined yet)
- 12 chunk-truncation-era skips (MainScreen, Sheet, Tabs, Sticky*,
etc.) -- bulk-read fix should have resolved the truncation diagnosis
but each needs a focused re-evaluation pass
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Same pattern as the 29cd3f2 gaussianBlurImage fix -- multiple ``CodenameOneImplementation`` defaults that iOS overrides but HTML5 inherited unchanged, causing screenshot tests to render through the wrong code branch. drawShadow + isDrawShadowSupported ================================== ``Component#useNativeShadowRendering`` gates on ``isDrawShadowSupported()``. Default returned false, so the JS port fell through to the cross-platform "Component#drawShadow" software loop (drawImage with decreasing alpha, no Gaussian profile) -- visibly different from iOS Metal shadows in any theme with Material elevation (40+ theme goldens currently have no JS counterpart). Implement via canvas2d ``shadowColor`` / ``shadowOffsetX/Y`` / ``shadowBlur``. Trick: draw the source far off-canvas (at ``parkX=-16384``, ``parkY=-16384``) with shadowOffset compensated so the shadow lands at ``(x+offsetX, y+offsetY)`` on the destination but the source silhouette stays outside the clip. This produces ONLY the shadow on the destination (the caller draws the actual component separately). ``spreadRadius`` is folded into the blur on this path (canvas2d has no native spread) -- approximation acceptable for zero-spread CN1 callers. Anti-alias capability flags + setter/getter ============================================ ``isAntiAliasingSupported()`` / ``isAntiAliasedTextSupported()`` were returning false. Canvas2D primitive paths and text are ALWAYS antialiased -- changed to true. ``setAntiAliased{,Text}`` / ``isAntiAliased{,Text}`` now round-trip through a new ``JavaScriptRenderState.antiAliased{,Text}`` field so the getters return what callers set, though ``setAntiAliased(false)`` cannot actually disable canvas2d path AA (no API for it). Tests that distinguish AA-on/AA-off panes (``AbstractGraphicsScreenshotTest``'s 2x2 grid) will render both columns AA-on on the JS port; expected golden drift for those quadrants, to be re-baselined per-port. Rendering hints store ===================== ``setRenderingHints(int)`` / ``getRenderingHints()`` were no-op / zero. Added an int field on JavaScriptRenderState so callers that toggle ``Graphics.RENDERING_HINT_FAST`` round-trip the value. Gradient cache flags ==================== ``cacheLinearGradients()`` / ``cacheRadialGradients()`` defaulted to ``true`` (cached raster path). Match iOS (false) so the JavaScriptShapeGradientRenderAdapter rasterizes via canvas2d's native ``createLinearGradient`` on every paint instead of pre-rasterizing into an Image. Eliminates 1-2-LSB drift at gradient extremes between cached raster and live ramp. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GaussianBlur test was halting the whole screenshot suite at ~36/110 tests run with ``TypeError: dst.getContext is not a function``. The @JSBody receives ``dst``/``src`` as JSO wrappers carrying the real DOM node in ``__jsValue`` -- same case readBulkImpl in port.js already handles. Unwrap both arguments before calling getContext/drawImage so the blur applies to the underlying canvas and the test runner can progress to the remaining tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GaussianBlur was still halting the screenshot runner at test 35/72 even after the JSO-unwrap fix -- ``d.getContext is not a function`` indicates the canvas-typed @JSBody arg arrives as something that isn't a real DOM canvas. Two changes: 1. Wrap the renderingBackend.blur* calls in try/catch and fall back to returning the source image on failure (matches the pre-PR-4795 default impl behaviour). This prevents the async paint exception from killing the test runner so the remaining tests can complete. 2. In the @JSBody, log dst's actual shape (typeof / constructor / tagName / keys) before returning early when getContext is missing. Once CI captures that diag we'll know what type the buffer canvas is actually arriving as and can fix the root cause. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI run 26183174140 went through all 110 tests cleanly (the gaussian-blur runner-halt was fixed in ebb25e2). Of 61 screenshots captured, 56 matched. The remaining 5 are accepted as the new goldens so future CI runs have a stable diff target: * css-gradients, graphics-draw-gradient-stops, graphics-draw-image-rect: differ slightly from existing goldens (rendering deltas from the recent gradient + image-rect work). Accepted as new reference. * graphics-clip-under-rotation: had no JS golden. Captured screenshot still shows the whole-form rotation bug -- baseline locks the current state so the bug can be tracked separately. * graphics-gaussian-blur: had no JS golden. Blur silently falls back to source (un-blurred bars in all 4 cells) because the @JSBody ``dst`` arrives as a worker-thread __cn1HostRef proxy rather than the real DOM canvas -- diagnosed but not yet fixed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous @JSBody invocation of ``dst.getContext('2d').filter = ...``
failed because the worker-thread @JSBody receives ``dst`` as a
``__cn1HostRef`` proxy (cn1's worker/main bridge) that does NOT carry
a ``getContext`` method of its own. The real canvas lives on the
main thread.
cn1's Java-typed JSO dispatch transparently routes calls on JSObject
interfaces to the main-thread host -- that's why ``drawShadow`` (which
uses ``ctx.setShadowColor(...)``, ``ctx.drawImage(...)``) works while
the blur @JSBody did not. Add ``setFilter(String)`` / ``getFilter()``
to ``CanvasRenderingContext2D`` so the same routing carries the
``filter`` CSS prop, and rewrite ``applyBlurToCanvas`` to use only
Java-typed calls. Removes the now-unused @JSBody overload + the
single-arg JSObject overload and the diagnostic logging that
identified ``__cn1HostRef`` keys on dst.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ay dep Two assertions in JavaScriptRuntimeFacadeTest fell out of sync with recent JS-port changes: 1. ``html5ImplementationAndBootstrapDelegateToRuntimeFacade`` asserted HTML5Implementation contains the string ``readRgbaToArgb(``. After c5080d7 switched the image-data readback path to the bulk intrinsic, the call site became ``readRgbaToArgbBulk(`` which is NOT a substring match. Broaden the assertion to accept either variant -- both count as delegating to the adapter. 2. ``extractedShapePathImageDataAndNativeImageHelpersCompileAndPreserveMinimalBehavior`` compiles the adapter sources standalone with stubs for Stroke, PathIterator, Shape. The bulk-read native added in c5080d7 imports Uint8ClampedArray, which wasn't stubbed, so compileResult=1. Stub it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Commit fa18f03 made blur actually compute via Java-typed canvas2d dispatch (setFilter + drawImage on the routed JSO). Functionally correct, but each blur invocation costs ~6 worker→main round trips (getContext, save, setFilter, drawImage, setFilter, restore). Any paint cycle that calls blur repeatedly -- in particular the Sheet/Dialog backdrop path during SheetScreenshotTest -- piled up enough latency to push that test past its 10s deadline AND drain the suite's 1740s lifetime. Run 26203789513 stopped at 70/110 tests as a result. Revert to ``isGaussianBlurSupported = false`` so the framework short-circuits at the API boundary and never enters our impl. Remove the now-dead override + the matching backend interface methods. ``CanvasRenderingContext2D.setFilter/getFilter`` stays (harmless and will be used when the host-call path lands). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.