Skip to content

Take the shader dispatch loops out on Samsung Xclipse (#224) - #227

Merged
YuutaTsubasa merged 1 commit into
mainfrom
claude/issue-224-xclipse
Oct 20, 2026
Merged

YuutaTsubasa merged 1 commit into
mainfrom
claude/issue-224-xclipse

Conversation

@YuutaTsubasa

Copy link
Copy Markdown
Owner

Issue #224: Galaxy A55 (SM-A556E, Exynos 1480, Xclipse 530, driver 24.0.539) stays at "PREPARING PIPELINES 0 OF 455" and Android eventually kills the game for low memory (exit reason 3).

Cause

Firebase Test Lab's a55xzh (Galaxy A55, Android 16, Xclipse 530, driver 24.0.545) reproduces it with the 0.10.14 APK's graphics self test. The driver's shader compiler (logcat tag GSC) spends 209 s on the first recipe's vertex shader (eaf61b182ad92401, which has XenosRecomp's while(true) switch(pc) dispatch loop). Resident memory grows past 550 MB, then the compiler asserts in SCAssembler.cpp SCGenerateLongBranch and Compiler.cpp Compile. On the player's phone the low-memory killer ends the game before that.

Bisection on the A55 (self-test scenarios 9-13, 60 s limit per recipe):

Scenario Result
as the device says stuck at recipe 0, 550 MB
SFR_TEST_DISPATCH_LOOP=1 455/455 in 14.2 s, slowest recipe 253 ms
SFR_TEST_NO_DESCRIPTOR_INDEXING=1 stuck at recipe 0
SFR_TEST_NO_DEVICE_ADDRESS=1 stuck at recipe 0
SFR_TEST_NO_CLIP_DISTANCE=1 stuck at recipe 0

Fix

  • The dispatch-loop rewrite (spirv_dispatch_loop.h, already on for Apple since Take XenosRecomp's dispatch loops out of the shaders on Apple (M1 race 6.5 to 60 fps) #192) is now also on for Vulkan vendor 0x144d (Samsung Xclipse). SFR_TEST_DISPATCH_LOOP=0 still keeps the loops (launcher Test options: "Rewrite shader dispatch loops: Off"). Other GPUs are unchanged.
  • Pipeline preparation can now be diagnosed from game.log:
    • A recipe that takes more than 5 s is logged as PIPELINE_PREWARM slow recipe=<n> of=<total> step=shaders|pipeline vs= ps= seconds= resident_mb=, and logged again at 10, 20, 40 s and so on.
    • A progress= line is written every 10 s.
    • The complete= line now names the slowest recipe.
    • On Android these lines also go to logcat.
    • SFR_PIPELINE_PREWARM_TRACE=1 logs every recipe. SFR_PIPELINE_PREWARM_TIMEOUT=<s> ends the process when one recipe takes longer than that; it is for the self test.
  • Self-test scenarios 9-14 (GraphicsTestActivity) only prepare the pipelines, with tracing and the timeout on. Each scenario tries one shader rewrite.
  • The test-option hint now mentions Xclipse. docs/vulkan.md has the details.

Verification

Firebase Test Lab, APK from this branch, scenarios 9 (as the device says), 3 (draw with every pipeline) and 14 (loops forced back on):

Device Scenario 9 Scenario 3 Scenario 14
Galaxy A55 (a55xzh, Xclipse 530) 455/455 in 18.2 s 455 drawn, no hang, ok=1 stuck at recipe 0 again (as expected)
Galaxy S24 (SC-51E, Adreno 750) 455/455 in 9.2 s 455 drawn, ok=1 455/455
Pixel 10a (stallion, Mali-G715) 455/455 in 10.3 s 455 drawn, ok=1 455/455

Local checks:

  • Windows: ctest 163/165 passed. native_shader_abi and native_resolution are not built by build_tools, and CI excludes them too.
  • Linux (WSL, lavapipe): ctest 159/159 passed.
  • Python unittest: 356 tests OK, 11 skipped.
  • The Android arm64 build passes.

Not tested

  • A real race on an Xclipse device: picture and frame rate with the rewrite on a non-Apple GPU. The self test's draws only show that every pipeline draws without a hang.
  • Other Xclipse GPUs (920/940/540) and other driver versions.

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings October 20, 2026 19:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

On a Galaxy A55 (Xclipse 530, driver 24.0.539/545) the game stayed at
"PREPARING PIPELINES 0 OF 455": the driver's compiler spent 209 s and
over 550 MB on the first pipeline's vertex shader, which has XenosRecomp's
while/switch(pc) dispatch loop, then asserted in SCGenerateLongBranch;
the player's phone killed the game for low memory first. Firebase Test
Lab's a55xzh reproduces it. With spirv_dispatch_loop.h's rewrite (on for
Apple since #192) all 455 pipelines prepare in 14-18 s and the self test
draws with each; no descriptor indexing, no device address and no clip
distance all still hang at recipe 0. So the rewrite is now on for vendor
0x144d too; SFR_TEST_DISPATCH_LOOP=0 still keeps the loops.

Pipeline preparation now names a recipe that takes over 5 s (index,
step, shader hashes, resident memory, again at 10, 20, 40 s...), logs
the count every 10 s and the slowest recipe at the end, also to logcat
on Android. SFR_PIPELINE_PREWARM_TRACE=1 logs every recipe and
SFR_PIPELINE_PREWARM_TIMEOUT=<s> ends the process on a stuck one; the
self test's scenarios 9-14 use them to try each shader rewrite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YuutaTsubasa
YuutaTsubasa force-pushed the claude/issue-224-xclipse branch from a0e7d18 to 20f340d Compare October 20, 2026 19:59
@YuutaTsubasa
YuutaTsubasa merged commit cb9c13a into main Oct 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants