Skip to content

Test the surface size wait and its 60-frame give-up - #51

Merged
Xget7 merged 2 commits into
mainfrom
android-surface-fallback-test
Oct 20, 2026
Merged

Xget7 merged 2 commits into
mainfrom
android-surface-fallback-test

Conversation

@Xget7

@Xget7 Xget7 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

The rotation fix's wait-then-give-up decision moves out of VulkanSurface into a class with no Vulkan or Android types.

 presentation/
+├── SurfaceSizeWait.h      # window size, stale count -> wait / rebuild / giveUp
 └── VulkanSurface.cpp      # asks it, does the Vulkan calls and the logging
rebuildWhenSurfaceReportsWindowSize
  reported = vkGetPhysicalDeviceSurfaceCapabilitiesKHR   # empty when the query fails
  switch sizeWait_.check(reported)
    wait    -> return
    rebuild -> LOGI, rebuildOrDrop
    giveUp  -> LOGW, rebuildOrDrop, sizeWait_.adopt(swapchain size)

Behaviour and log lines are as in #45, kMaxStaleChecks is still 60.
CI compiles and runs the test on the host, in the same build job step pattern as WorldFrameCompletionTest.

Evidence

  • Before: the decision had no test.
    With the class stubbed, SurfaceSizeWaitTest fails: Assertion failed: (wait.pending(kPortrait)) ... line 19.
    After: it exits 0.
convergesAtOnce:      window L, caps L                  -> rebuild
waitsThenRebuilds:    caps P x10 then L                 -> wait x10, rebuild
failedQueryIsStale:   no caps, then L                   -> wait, rebuild
givesUp:              caps P x60 -> wait, 61st          -> giveUp; adopt(P) -> not pending
lastWaitingFrame:     caps P x59, then L                -> rebuild
restartsAfterGiveUp / matchResetsCount / newResizeResetsCount
  • Where it ran: the Mac only. The decision logic runs on the host; no physical device was attached, so the real rotation on a phone has not been re-checked.
  • Checks: scripts/lint-cpp.sh clean (includes the arm64 splatkit_android_tests link); ANDROID-SPIRV hashes equal the baseline; Gradle :splatkit:assembleRelease :app:assembleRelease :splatkit:testDebugUnitTest succeeds; host WorldFrameCompletionTest and SurfaceSizeWaitTest exit 0. The new CI step "Check surface size wait on host" runs in the build job.

Merge Danger

Door: Two-way.

Blast Radius: Android

A mistake would show as a stuck or wrongly sized swapchain after rotating a phone, which is the check to repeat on the Mi 9.

@Xget7
Xget7 force-pushed the android-surface-fallback-test branch from 12afbf5 to 3c40b5b Compare October 20, 2026 22:15
@Xget7
Xget7 merged commit 313b167 into main Oct 20, 2026
24 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.

1 participant