Embedded Loopbound WebView flickers rapidly on Android #73
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Opening embedded Loopbound can make the game content flicker rapidly, appearing to disappear and reappear.
This issue records the BookWave / Android WebView half of the investigation. Loopbound's own confirmed render-churn defect remains tracked separately as
alexander/Loopbound#8.Current BookWave host state
Current authoritative
maininspected:3516344c3b16b8b114b6037aa68ecb30fc25d2e4.LoopboundScreen.ktcurrently:WebViewper route/context;AndroidView;https://appassets.androidplatform.net/assets/loopbound/index.htmlonly whileview.url == null;The obvious repeated-
loadUrl()/ repeated-WebView-creation hypothesis was not found.Cross-repository findings
Loopbound itself has confirmed high-frequency UI churn:
useSyncExternalStoresubscribers;Those patterns are old enough that they do not line up well with a newly appearing platform-specific flicker, but they can increase compositor/invalidation pressure.
Strong external match
Chromium issue 513436623 is currently an assigned P1 Mobile>WebView Android bug titled:
Independent reports describe blank/blue/black/corrupted frames in Android WebView. Reports include Android 16/Samsung environments and indicate WebView 146 can be unaffected while 147 and later development builds reproduce the rendering problem.
Because BookWave embeds Loopbound in Android WebView rather than Capacitor/Chrome, this is presently the strongest trigger hypothesis.
Additional BookWave-side risk factors
These are contributors / isolation targets, not established bugs:
AndroidView; this increases the complexity of the composition path.Required device isolation before choosing a permanent mitigation
On one affected device and one exact BookWave APK:
WebView.getCurrentWebViewPackage()package + version.BOOKWAVE_LOOPBOUND_VERSION.WebViewClientpage-start/page-finish logging to prove the page is not repeatedly navigating.Acceptance
Do not close this as “Loopbound rendering” or “WebView bug” by assumption. A fix/mitigation should be based on the matrix above and should demonstrate on physical Android that the visible game no longer flashes while preserving scrolling, save persistence, mini-player usability and offline local-asset loading.
Diagnostic instrumentation is now isolated in PR #74 on branch
mcp/issue-73-webview-diagnostics.Exact diagnostic HEAD:
a7fd3617d6ddd7a27dd7b40c739a7edf7a41ed60Base main:
3516344c3b16b8b114b6037aa68ecb30fc25d2e4The change is observability-only: WebView provider/version, bundled Loopbound SHA, page start/commit/finish counters, hardware/layer state, and render-process-gone logging. Transparency, Haze topology, layer policy, Loopbound rendering, and issue #36 code are unchanged.
A debug APK build is being dispatched with Loopbound pinned to
331aa252753a8279a56c2a44b0ed34963336c3f2and verifyDebug enabled. Physical-device isolation remains required before any mitigation is selected.Additional physical-device observation:
This strengthens the current hypothesis that the trigger is in the Android embedded WebView/compositor/startup composition path rather than a continuously faulty Loopbound React/render loop. Loopbound render churn may still amplify the problem, but a persistent game-side loop alone does not fit the observed 'bad at startup, then settles' shape well.
Next device capture should record:
Do not broaden this into a Loopbound rendering rewrite without evidence.
Deep-dive update — WebView compositor hypothesis
CI / diagnostic PR
PR #74 is now at
4dba6000259d480e75f85c9d55a0f3b1d101a206.The previous failed PR check was not a source failure. The pull-request workflow had been dispatched with issue number
73as the PR number, while the diagnostic branch belongs to PR#74. Preflight correctly rejected that mismatch beforeverifyDebug.While reviewing the instrumentation I also corrected one real architecture problem before rerunning: the first diagnostic commit called
android.util.Logdirectly, but BookWave's logging contract reserves that API forAndroidLogSink. Diagnostics now go through the existing structured/redactedLogger.The corrected run has passed
PR #74 · Preflight;verifyDebugis currently running.External WebView evidence
The active Chromium issue 513436623 is an assigned P1 Android WebView bug titled:
Chromium's current production-supported WebView flag list exposes
DefaultPassthroughCommandDecoderas “Use the passthrough GLES2 command decoder.” Chromium's current field-trial configuration explicitly enables that feature for theandroid_webviewplatform.WebView DevTools documentation is especially relevant: WebView receives A/B rollouts through variations/Finch, and its Flags UI can override a field-trial feature specifically to determine whether an experiment is the root cause of an app regression. Therefore package/version alone is useful but not sufficient evidence: two devices/builds on similar WebView versions can have different variation state.
References:
Revised physical-device isolation order
Keep one exact BookWave APK + one exact bundled Loopbound SHA for each A/B pair.
Baseline diagnostic capture
Direct Finch hypothesis A/B
DefaultPassthroughCommandDecoder;If disabling this feature removes the flicker while everything else is unchanged, that is much stronger causal evidence than changing BookWave rendering first.
Opaque WebView background A/B
Haze isolation A/B
Loopbound Reduce Motion
Per-view software layer
LAYER_TYPE_SOFTWAREas forcing one View through the software pipeline. A change here would strongly implicate the GPU/compositor path, but it is too invasive/performance-sensitive to assume as a permanent fix.Interpretation of the observed “starts bad, then settles” behavior
The fact that the deployed browser version is stable while the embedded WebView can flicker violently on entry and later settle further weakens a simple continuously-running Loopbound React-loop explanation. It does not yet prove Chromium issue 513436623, because that issue is described as continuous flickering and BookWave's symptom may be transient.
The most discriminating next evidence is therefore the same-device Finch flag A/B plus the new navigation counters. Do not perform a broad Loopbound or BookWave rendering rewrite until those tests are available.
CI follow-up: the structured-logger conversion exposed one compile error in the diagnostic branch:
RenderProcessGoneDetail.rendererPriorityAtExitmust be invoked as a method. This is fixed in102bef18128262e2eeb184091b4d6be6fa94ee8a.Current PR #74 HEAD:
102bef18128262e2eeb184091b4d6be6fa94ee8aCurrent main/base:
91a742291144204aa1c61403c424a0b4999c27c8Actions run 209 is checking that exact HEAD. Its preflight has passed and
verifyDebugis running. No mitigation/rendering behavior has been added; PR #74 remains instrumentation-only.Physical-device update from the diagnostic branch:
d48fcd9bc9997e00732c4557657e825911bb4de1; current base is32e554dacdb79ddc866027c84cbcd5789283de7b.Interpretation:
Before closing #73 or implementing a permanent workaround, reproduce with several cold starts of the same exact APK. If flicker stays absent, capture the diagnostic provider/version + Loopbound SHA and compare against the previously affected build/device state. If possible, test the prior known-flickering APK again on the same device; if that is now also stable, the strongest explanation shifts toward WebView/platform/experiment state rather than BookWave source changes.