xbox_present: a skipped present after a resize is not a composition failure (and the helper says which step failed) #2652
Closed
leonida/mandy
fiestorra wants to merge 0 commits from
fix/present-planes-failure-detail into main
pull from: fix/present-planes-failure-detail
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2652
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/present-planes-failure-detail"
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?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
This now fixes the failure, not just reports it. Two commits: the diagnostics that found it, and the retry that repairs it.
The failure
xbox_presentfailed on this machine atline 1320(now:1335) with no indication of which step went wrong.present_planesreturnedfalsefor three different reasons and said none of them. It now names the step:The cause
Case F resizes the window (
400x300 -> 200x150 -> 320x240) and asks the next present for a capture. The layer is allowed to skip that present and still report success - its own contract inruntime/src/vulkan_present.hsays "VK_SUCCESSalso covers a skipped present (minimised window) and one the surface reported out of date" - and when it does it setscaptured_ = false(:511), soread_back()refuses (:366:if (!capture_ || !capture_ptr_ || !captured_) return false;).So the test demanded a capture from a present the layer may legitimately skip. The test's own comment at
:1316shows the author expected the size to lag after a resize, but what it did not tolerate is a skipped capture.The change
In
present_planes, when the read-back fails, present once more and try again:The retry runs only on the failing path, so a passing present is untouched.
Tested
On this machine, where the failure reproduced before the change:
Re-verified on the current
main(1d22590b9) after the tree moved, because a fix measured against an older base can stop being true:and the same binary failed three times at
line 1335before it, and no other C++ test fails in either run.Not tested
Nothing outside this machine. The disposal is the interesting part: a real desktop may never hit the skip, and this change is a no-op there - it only fires when the read-back fails, which is precisely the case that used to turn into a false composition failure.
The extra commit at the tip (no longer carried)
The branch used to carry
a3b5ebea1(test(semantic): align computed-I/J f16 interp oracle…), added only becausesemantic-testswas red onmainfor that oracle and every branch cut frommaininherited it.mainnow has the same edit asc717967d0, so a rebase drops the commit and this pull request no longer touchestests/semantic/test_interp_computed_ij_fallback.py- the diff is only what this change actually needs.AI-assisted: yes - DeepSeek v4.1 (flash) as the coding agent, with a separate reviewer agent reading the change before submission. Where and on what: the measurements above were taken on Windows 11 with MSVC 19.44.35226 on an RTX 4090 (NVIDIA driver 621.24) where a C++ or GPU path is involved; Python and docs cases need none of it.
Written with an AI assistant.
Rebased onto
main452d1d1b6and now carries the one commitmainis missing, like my other pull requests:The change itself is unchanged and still verified on this machine (
xbox_presentbuilds and, where it applies, passes 3/3 after the rebase).Written with an AI assistant.
Independent
xbox_present_test.exeA/B on452d1d1band GitHub merge5952b59d(e93efd8b). CachyOS, Wine 11.22 and headless Gamescope, Win64 clang-cl 23.1.5 Release (/MD),LEONIDA_PRESENT_PLANE1=0. Counts are the test process exits and completion markers.b8486b4a)MEASURED. The base failed at the first resize capture in case F. #2652 retried once at each of the three resizes. With #2507 present, all runs finished with zero helper retries. Both patches apply cleanly together.
MEASURED, negative control. On the second iteration of the first resize, I fed the size checker a byte count one texel short after a successful readback from a present that advanced the shown counter. The existing helper reported a skipped present, retried, and the full test passed 3/3 per GPU. The same control failed at the readback on both GPUs in 3/3 runs when I allowed the retry only in case F and only if
xbox.presenter().presented()stayed unchanged. That scoped variant passed 3/3 per GPU with the probe off and recovered all three actual resize skips with a fresh frame token on each retry.grabchecks both capture and byte count/extent. The shown counter is a way to preserve that check for frames the presenter did show. If the fixture is meant to require a shown frame, the scoped retry keeps that behavior. #2507 separately keeps the already copied frame readable afterOUT_OF_DATE.Synthetic fixtures only. AI-assisted with OpenAI Codex.
Re-verified on the current
main(1d22590b9), because both the tree and the test have moved since the first measurement.mainalone, whole suite rebuilt and run here:With this branch applied (
8cb7875ce), the same test:So
main's only C++ failure is still this one, and the retry still turns it green after the tree moved - which is the part that could have quietly stopped being true whenmainpicked up the sample-location and image-store changes.Nothing else changed in the branch: the diagnostics in the first commit and the one-shot retry in the second are what they were, and the 539-test run shows no new failure anywhere else.
Written with an AI assistant.
Re-verified after the rebase onto
main20fe0c754, on this machine (Windows 11, MSVC 19.44.35226): the diff no longer carries the interp-oracle commit (mainhas it asc717967d0), and what is left still passes.What I did not test: the rest of the change, and anything the rebase did not touch. This confirms the rebase kept the change working, not that the change is correct - that is what the review and the CI are for.
Written with an AI assistant.
Independent check on Windows/NVIDIA (not the author), at
cce63b232.mainb17b22d33,ctest -R "^xbox_present$"fails atline 1320withVK_ERROR_FORMAT_NOT_SUPPORTEDon this machine (RTX 4070 Ti SUPER, driver 621.01).LEONIDA_PRESENT_PLANE1=0, it gets past the resize/composition path that used to fail at line 1320 and reaches the real-time loop.It then fails at
line 1554:real time: 30 frames at 60 Hz in 6980 ms (ideal 500). That is this machine's display being asleep, not the PR:nvidia-smireportsdisplay_active: Disabledandpowercfg /requestshasDISPLAY: None, so DWM throttles presents to ~4 Hz. The 60 Hz assertion cannot be judged until the display is active.Net: the resize/composition fix is confirmed here; the remaining failure is environmental. A run with an active desktop should confirm the pacing assertion.
AI-assisted: yes (opencode).
Measured end to end on the current
main:xbox_presentfails, and with this PR's test change it passes. This is the independent confirmation of the failure KelboLive described, run as part of a full suite rather than the single test.A full
ctestonmain0b6e0e3bc, Release, serial, this machine:And the single test, both ways:
So the red is not flaky and not this machine: it is one test in the suite on today's
main, it fails deterministically in 2 seconds, and your change is what turns it green.What that means for the merge decision, which is yours:
maincurrently has a failing test, so the "leave it, it may be the machine" reading is not available - the-11is a format refusal, not a timeout or a scheduling artefact, and it happens at the resize-and-compose path the comment above line 1318 describes.What I could not test: the other half of your report -
real time: 30 frames at 60 Hz in 6980 mson your display - because this machine's present path did not reach the frame-rate assertion at all before the change, and after it the test passes in 2 s. So the timing failure you saw is a different machine's display, and I have no opinion on it.AI-assisted: yes - DeepSeek v4.1 (flash) ran the suite and the single test on the machine above.
Written with an AI assistant.
finding: re-verified on today's
main, and the fix gets further but does not reach green: the pixel cases now printok, and the process still exits 1.main10bed9ff2, the two commits cherry-picked (merge-base20fe0c754), MSVC Release, RTX 4090:What the fix did, and it is a real improvement: the
[rt] d3d12: present failed (VkResult -11)lines that made this test unreadable are gone, and the six cases that used to die now pass. Two days ago onb7a1be296the same binary failed 7 of 7 withVkResult -11; now none of those appear.What it still fails on, and I have four runs to show it is not one thing:
So on one run the 2-plane composite present (
PresentX(2, two, nullptr)) movedcomposed_presents()when the check says plane 1 has no overlay flag and it should not; and on three runs the binary exits 1 after the lastokwithout saying why.composed_presentshas not changed between the merge base and today (git log -Sfinds no commit touching it), so this is notmaindrift.What I could not do: name the third path.
EXPECTisif (!(c) { fprintf(stderr, "line %d: %s"); return 1; })andmain's three returns all print, so a silent exit 1 does not come from any of them - it is either a crash after the last case or areturn 1I have not found, and I stopped rather than guess.What I would suggest: the failing
composed_presentscheck is worth its own look because it is an exact equality on a counter, and the three silent runs are worth a--onlythat runs one case at a time. My earlier verification of this pull request said "all green" - that was onb7a1be296, and it no longer is.AI-assisted: yes - DeepSeek v4.1 (flash), four runs and a build.
Written with an AI assistant.
Narrowed further, so whoever picks this up starts where I stopped rather than where I started.
The file has exactly two
return 1, and both print:And the three end paths print too (
validation errors,known ... skipped,xbox_present_test: all cases pass). In the three silent runs, none of those five lines appears anywhere in either stream.Where the binary actually stops:
So it dies somewhere between L623 and L1553 without going through any exit path in
main. That is either a crash whose code PowerShell reports as 1, or an exit inside a helper the test calls.What that leaves as candidates, in the order I would look:
EXPECTinside aboolhelper. The macro isreturn 1- in a function returningbool, that isreturn true, and the caller reads it as success while the message goes to stderr. That cannot produce a silent run, so it is not this, but it is worth knowing the macro behaves differently in aboolhelper than inmain.PresentX(2, two, nullptr)itself: the one run that printed a line gotline 634, which is the assertion AFTER that call returned S_OK. The silent runs may be dying inside the call.DestroyWindow,UnregisterClassW), which is after the lastokand before the summary - but the summary lines are earlier than that, so this does not fit either.I am not going to guess further:
#2652's own change makes the six cases pass and that is a real improvement over the sevenVkResult -11failures I measured onb7a1be296. What it does not do yet is turn the binary green on today'smain, and the silent exit is the thing to chase.AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
finding: this pull request no longer fixes anything on
main: the failure it was written for is gone, and the failure that is there now is the same with and without it.mainf918e5145, rebuilt from scratch for this:And with this branch applied, two hours ago on
640b0d0df:So the two trees fail identically at L634, and the
VkResult -11lines are gone from both. Something betweenb7a1be296(where I measured sevenpresent failed (VkResult -11)and noline 634) and today'smainfixed the present path, and it was not this branch - this branch only names the failure more clearly, which is why it looked like a fix.What I am now recommending, and I would rather correct myself than leave it: close this, and open the L634 failure as its own item. The assertion is exact and narrow:
A 2-plane composite present is incrementing
composed_presents()when the check says plane 1 lacks the overlay flag and it should not.composed_presentshas not changed betweenb7a1be296and today (git log -Sfinds no commit), so the counter is not what moved - the present path that calls it did.And the three-runs-in-four silent exit is a second finding: no
line N:and none ofmain's three end-path prints, so it exits somewhere that prints nothing. Both are worth their own look and neither is this branch's.AI-assisted: yes - DeepSeek v4.1 (flash), which reported this as an improvement two hours ago and is correcting itself after rebuilding
main.Written with an AI assistant.
finding: both arms of the test are identical with and without this branch, and the reason I kept seeing a difference is that I was running the wrong one.
ctestdoes not run this binary plainly - it sets an environment variable first, which I only found by askingctest -N -V:And there are two different failures, one per arm. Measured on
mainf918e5145rebuilt from scratch, then with this branch applied:Identical, line for line, in both arms. So this branch changes no outcome at all. The
VkResult -11lines I reported as gone this morning were gone because I had run the arm that does not produce them - the one without the variable - and theremainalso does not produce them.That is the third version of this report, and the two earlier ones were wrong for the same reason: I compared a run against a run, without checking which arm each one was.
ctestsets a variable, my shell did not, and the difference I attributed to the pull request was the difference between the two arms.What this branch is worth: its
present_planeshelper names the step a failingEXPECTcame from, which makes the output readable. That is a real improvement to the diagnostic and it is not a fix.What the two failures need, and neither is this branch: the 2-plane composite present incrementing
composed_presents(no variable), and whatever makesvkCreateSwapchainKHR/present returnVK_ERROR_DEVICE_LOSTwithLEONIDA_PRESENT_PLANE1=0. The second is the onectestsees and the one that has been red all day.I would still close this as a fix and keep the helper if it is useful, but whoever reopens it should start from the two arms above.
AI-assisted: yes - DeepSeek v4.1 (flash), which reported this pull request as a fix twice and is correcting itself twice.
Written with an AI assistant.
closed: both arms of
xbox_presentare identical with and without this branch, so it fixes nothing, and I would rather close it than leave a pull request open that claims a fix it does not make.The measurement, on
mainf918e5145rebuilt from scratch and again with this branch applied:ctestsetsLEONIDA_PRESENT_PLANE1=0(whichctest -N -Vshows and I did not look at until three reports in), so the arm it sees is the second one, and it has been red all day for a reason this branch does not touch.What the branch did do: its
present_planeshelper names the step a failingEXPECTcame from, which is a real improvement to the output. The branch stays pushed asrefs/pull/2652/head; if that helper is worth lifting, it can be taken from there without the "fix" framing.The two failures, for whoever picks them up, and neither is in this branch:
presenter().composed_presents()when the check says plane 1 has no overlay flag.composed_presentshas not changed sinceb7a1be296(git log -Sfinds no commit), so the present path that calls it is what moved.LEONIDA_PRESENT_PLANE1=0: fivepresent failed (VkResult -11)and one assertion, which is the armctestruns.Where to track them: #2464 is the game-run work and already carries this test; #2570 is the coordination issue. I did not open a new issue for either because I do not know which of the two a maintainer considers the bug and which the test's expectation - the counter or the call site.
AI-assisted: yes - DeepSeek v4.1 (flash), which reported this pull request as a fix twice and closed it after measuring both arms.
Written with an AI assistant.