fix(agc): allow opting out of the separate presentation queue #24931
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24931"
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?
Imported from boykopovar/AnyPS5. Originally posted by vgpastor on 2026-11-21T11:28:31Z.
What
Add
APS5_NO_PRESENT_QUEUE, a presence flag selecting the existing main-graphics-queue presentation path under the GPU mutex. A separate presentation queue remains the default when available. Queue planning, requested counts and priorities are preserved.This is an opt-in workaround for the FIFO device loss reproduced in #19798. It can block draw work while a present waits; the driver or synchronization cause remains unresolved. The option and its limits are recorded in the environment reference and a technical-debt fragment. There are no GPU-model or title-specific rules.
Tested
Windows 11 Pro 10.0.26300, NVIDIA GeForce GTX 1060 3GB, NVIDIA 581.80, Intel i7-12700F, WinLibs GCC 15.2.0 UCRT r7, RelWithDebInfo. Khronos validation 1.4.363 (SDK 1.4.363.1).
Fresh paired builds and serial
ctest --test-dir build-local -R '^video_out_flip' -j 1 -Von main133008c0ee976fe44ada669a332edc9c7f088074and this branch6a385ddd5c06e67600a6e0350bca64f9face9b53:APS5_NO_PRESENT_QUEUE=1All three logs contain zero
VUID-lines and no missing-validation-layer messages. Some tests exercise CPU/error paths without creating a Vulkan device; their inclusion does not imply one layer insertion per test. With the option enabled the separate queue is not selected; both controls retain it.With the option enabled, overlay, padstatus, aftergpu and eop_aftergpu each pass five consecutive runs: 20 executions, 20 validation-layer insertions, zero VUIDs and no device loss. Common settings:
ANYPS5_GPU=NVIDIA ANYPS5_PRESENT_MODE=fifo ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_HOST_REPORT=1 APS5_GPU_CHECKPOINTS=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer VK_LOADER_LAYERS_DISABLE=VK_LAYER_OBS_HOOK.Independent confirmation by @miura16 on the equivalent pre-rebase head
3199aeeb34: GTX 1060 6GB, NVIDIA 582.78, Windows 11 Pro 10.0.22631, Release, validation 1.4.363. The six reported modes pass with the option; overlay, padstatus, aftergpu and eop_aftergpu fail without it; the overlay/padstatus repeat passes all ten executions, with zero VUIDs. This is their report, not a second GPU tested locally: https://github.com/boykopovar/AnyPS5/issues/19798#issuecomment-7060530198Independent coverage on newer NVIDIA and AMD GPUs reported by @Jirka135: Windows 11 Enterprise 10.0.26300, Ryzen 7 9800X3D, GCC 15.2.0 Release, this PR merged with
--no-ffonto main8b40357971. On both NVIDIA GeForce RTX 5090 (617.42) and AMD Radeon(TM) Graphics gfx1036 iGPU (32.0.21045.29003), each of main, PR with the option unset, and PR withAPS5_NO_PRESENT_QUEUE=1passes all 29 tests in six of six fresh CTest runs per arm/GPU: three with validation 1.4.369 and three without. Each layered run has 28 layer insertions, no missing layer and zero VUIDs. Separate-queue selection counts are 27 for main/default and zero for the opt-out. These GPUs already pass on main; this is reported regression coverage for both routes, not a reproduction of the Pascal loss. It was not executed on our local machine: https://github.com/boykopovar/AnyPS5/pull/24931#issuecomment-7063268208Historical equivalent-guard Calculator3D evidence is pinned separately to
b7aa85703e/ diagnostic revision02e894a86bb4: a 25-second FIFO capture with real presents and no device loss; the launcher intentionally ended it. It is not a title run on this new head: https://github.com/boykopovar/AnyPS5/issues/19798#issuecomment-7058203314check_conventions.py --base origin/mainandgit diff --checkpass. The full branch overlap check and manual comparison of any shared files are recorded with the evidence. Read-only code review found no substantive issue.The overlap scan covered 2,186 open PRs and could not automatically compare 73 conflicting branches. All 73 were then inspected by SHA/merge-base: no other change implements the opt-out or changes this guard/retrieval block. #18173 and #22190 add
QueueAccessaround main-queue presentation for asynchronous submissions; no required dependency was identified, but combining those paths needs revalidation. #13863/#13920 change compute-queue planning while preserving the presentation subplan. These combinations were inspected, not tested together.At the tested main snapshot
133008c0ee, two unrelated full-tree checks failed:env_reference.py --checkdid not recognize the capturedAPS5_TRACE_ALL_PHASESkey, anddebt_fold.py --checkrejected a stale libwebrtc fragment selector. Both have since been fixed upstream by #24928 and #24945, with independent Windows confirmations recorded on those PRs. The historical logs remain pinned to the revisions actually run. The new presentation option is recognized by the scanner and documented.Verbose paired logs, XML summaries, the source patch, commands, build-artifact hashes, the overlap review and a SHA-256 manifest are published here: https://gist.github.com/vgpastor/0dd5ab4093af4c7e5019178b7a394af4. All 18 published files were downloaded and verified byte-for-byte against the reviewed packet. Only local paths and UTF-8/BOM representation were normalized; the raw local originals remain unchanged.
Independent GTX 1070 confirmation by @tesivo on exact head
6a385ddd5c06e67600a6e0350bca64f9face9b53: report. NVIDIA 582.78, Windows 10.0.26340, WinLibs GCC 15.2.0 r7, validation 1.4.363. The full focused suite is 29/29 withAPS5_NO_PRESENT_QUEUE=1and 25/29 with it unset; the same overlay, padstatus, aftergpu and eop_aftergpu modes fail in the control. Overlay and padstatus also pass ten repeated executions in total with the option. The contributor reports zero VUIDs.The GTX 1070 present-mode controls cover overlay and padstatus: both pass with immediate and mailbox while the option is unset. fifo_latest_ready was not tried. The contributor corrects the first-present account: two presents complete before loss at the third (sometimes observed one submission later). In the full unset suite, overlay/padstatus end at the 30 s CTest timeout after logging fatal device loss; that terminal outcome is distinct from a prompt abort.
The full runtime suite and performance effects remain unverified. The opt-in workaround does not establish a general Pascal fix or close #19798.
Paired GTX 1060 test of #24931: FIFO now reaches a match with the option
Middle Ages Ping Pong
PPSA28319, content01.000.000, public release ZIP SHA-2566426468091b42f6512a456004e47a0807ae83fc2af82a4408bef8a51103fbd48. Windows 11 Pro build 26300, i7-12700F, NVIDIA GTX 1060 3GB / 581.80, WinLibs GCC 15.2.0 UCRT r7, RelWithDebInfo.Fresh main is
42120ad25c2e7102edb22e2be5a8f42f08dcd2c1. I cherry-picked #24931's exact code head6a385ddd5c06e67600a6e0350bca64f9face9b53onto that base, producing local test revision99de21524199262867e4df692b46be5feeeb328c. This is the PR's patch on a newer base, not a title execution at the older PR head. The only production source change between the arms is the existingplan.presentopt-out guard.ANYPS5_PRESENT_MODE=fifovkQueueSubmit graphicsresult-4, invalid write at0x0, exit3221226505.APS5_NO_PRESENT_QUEUEabsentAPS5_NO_PRESENT_QUEUE=10-1, ball and paddles; the left paddle position changes between middle/end captures. 3,850 presents in recorded summary intervals.All arms use the same converted executable, SHA-256
06b702f867b0f1c19df0084ad87474b7cf679770b59eaf7cb576568419a1fad9, the same package and scripted pad sequence. The two patched arms use the same 46-file runtime snapshot. Separate presentation family 0 queue 2 is logged once in each control and zero times with the option.Forced Vulkan,
ANYPS5_NO_SHADER_CACHE=1, Khronos validation 1.4.363 and loader logging are enabled. Layer insertion is verified in all three logs, with no missing-layer message. Each failed control has 20 validation error messages (four fence/command-buffer VUIDs, five each; 40 textual VUID lines including spec URLs), explicitly annotated as afterVK_ERROR_DEVICE_LOST; they do not identify the original cause. The enabled arm has zeroVUID-lines and no device loss, but retains fourstorage image ... destroyed with GPU results pendingwarnings during controlled close.This supports avoiding the reproduced FIFO title failure with the option on this GPU. It is not a general Pascal fix, long-session stability result or performance comparison; tracing/capture/import recording are active, audio is dummy, and physical-controller state may coexist with scripted input. Original reports, pad reads, traces, captured frames and per-arm runtime hashes are retained locally.
Title-thread report
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T11:34:43Z.
Review: APPROVED
Reviewed — looks good
The reviewed change preserves the existing queue plan and selects the main graphics queue for presentation when
APS5_NO_PRESENT_QUEUEis present; the evidence supports merging.What I ran
No commands or tests were run in this review. I inspected the prepared diff and targeted source at head
6a385ddd5c06e67600a6e0350bca64f9face9b53; base ismainand no merged preview was checked.repo_read.pywas not available as an executable command here.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all three changed files in
manifest.json’s reviewed list:core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp,docs/dev/ENVIRONMENT.md, anddocs/dev/debt/changes/agc-main-queue-presentation.md. The oversized C++ file was read through the pinned reader. No files were listed as excluded in the manifest;files.jsonwas unavailable in the review folder. Runtime tests, builds, and the author-reported hardware results were not independently verified.To get this to a good state
Nothing is required.