Skip to content

test(agc): cover incomplete GPU timing batch completion - #6514

Open
JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:test/gpu-timing-incomplete-batch
Open

JJenkx wants to merge 1 commit into
boykopovar:mainfrom
JJenkx:test/gpu-timing-incomplete-batch

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What

Add real-queue regression coverage for the timestamp-query hang fixed by #6363. The new incomplete-range case opens two timing ranges, deliberately omits the first range's end timestamp, completes the second and submits the batch. Batch completion callbacks must run and the completed-batch record must remain available. Complete batches before and after the incomplete batch must still report valid GPU timings. A separate all-complete case provides a passing control.

This PR adds tests only. The runtime fix #6363 merged into main on 2026-10-18; its implementation and authorship remain in that PR. Reproduction source including that fix is available on the validation branch.

The test checks the selected queue's timestamp support and returns skip 77 if unavailable. CTest enables GPU profiling and bounds either case to 15 seconds. Vulkan specifies that querying unavailable results without WAIT may return VK_NOT_READY: vkGetQueryPoolResults.

Tested

Arch Linux, Ryzen 9 7950X, Release with bundled dependencies, historical baseline main b7cedd900d67a94453b8a45eec9b5623532a0441.

Source RX 6650 XT / RADV lavapipe
main + these tests complete passes; incomplete times out at 15 s both pass
main + these tests + #6363 (44d31ef9d) both pass both pass

Both Vulkan drivers are Mesa 26.2.4-arch1.1; lavapipe uses LLVM 23.1.1. The test executable is byte-identical between the final negative control and fixed runs (SHA-256 6d851fd74156f7f36c75f59ec4111ce6e2d906697a0d6c5adfd34035c7bcbab5); only the runtime library changes. This catches a RADV failure that the software driver does not reproduce.

Independent Apple GPU results from jotitadev: on an Apple M2 Max, macOS 27.2, x86-64 under Rosetta 2, both cases passed with and without #6363 using MoltenVK 1.4.2 and MoltenVK main plus SPIRV-Cross #2704. This was their macos-port build at b7eb6b6b plus ImportWatched and this test diff (8e3755364), with a queue-family accessor adjustment; it was not a run of upstream main. They report VK_NOT_READY returning immediately for incomplete queries even with WAIT. These collaborator results extend the driver comparison but do not provide a negative control on Apple or replace the RADV reproduction. I did not run this Apple configuration.

Full libs and agc_driver_recorder_tests build passed. On the fixed validation source, four tests pass with zero skips on each driver: agc_gpu_timing_complete, agc_gpu_timing_incomplete, agc_unchanged_cpu_stamps, agc_recorder_read_list. Conventions, test registration and whitespace checks pass. No native-title or Windows run and no performance claim.

Refresh after #6363 merged

Rebased the single test commit onto main 659230f7b676e8c848d70640f823342be6704526 as e5e603d161f4ab1a0fcd81f0647c4cfd782a9a56. Full libs and agc_driver_recorder_tests build passed. Under VK_LAYER_KHRONOS_validation, five checks pass with zero skips on RADV (0.16 s total) and lavapipe (0.20 s total): both timing cases, unchanged CPU stamps, recorder read list and recorder device selection. The historical negative control above remains separate from this current-main positive run. No native-title or performance claim.

The overlap tool reports no comparable collisions. It cannot compare 53 already-conflicting PRs sharing the registration/recorder files; their changed lines were separately scanned and none changes the timing APIs or these timestamp cases.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (fix(agc): read GPU timing queries without waiting on unwritten ones #6363 merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.4-arch1.1, Arch Linux; lavapipe Mesa 26.2.4-arch1.1, LLVM 23.1.1, Arch Linux
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6451 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6606 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6701 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7258 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@jotitadev jotitadev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Apple GPU run of the new tests, with and without #6363.

Machine: Apple M2 Max, 32 GB, macOS 27.2, x86-64 build under Rosetta 2.
Method: macos-port @ b7eb6b6 + ImportWatched + this PR's diff (head 8e3755364), not main. The port's test Device has no context.queueFamily, so Timestamps() reads the family index the test Device already picks. No other change to the test. #6363 applied at 44d31ef9d for the second run.
Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), and MoltenVK main + SPIRV-Cross #2704. Driver checked with VK_LOADER_DEBUG=driver.

MoltenVK reports timestampValidBits = 64 on the queue, so neither case skips. Both cases run their 3 rounds.

Source MoltenVK 1.4.2 MoltenVK main
port + these tests complete passes; incomplete passes both pass
port + these tests + #6363 both pass both pass

Every run finishes in under 2 s; the 15 s timeout never comes close.

To see why there is no hang, I temporarily logged the vkGetQueryPoolResults result in Recorder::readGpuTiming. Without #6363, so still with VK_QUERY_RESULT_WAIT_BIT, MoltenVK returns VK_NOT_READY for the incomplete round in about 0.01 ms instead of blocking on the unwritten query. The complete rounds return VK_SUCCESS. With #6363 the results are the same: complete rounds still return VK_SUCCESS and keep their timings without the wait bit.

So Apple behaves like lavapipe here: the incomplete case does not fail without #6363, and the negative control only reproduces on RADV. That matches the PR description; this adds a third driver to it.

GPUs tested: Apple M2 Max, MoltenVK 1.4.2 and MoltenVK main (+ SPIRV-Cross #2704), macOS 27.2.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

@JJenkx

JJenkx commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Temporarily closing this dependent draft to stay within the 20-open-PR author limit while submitting a verified Linux SDK allocator ownership fix for Silksong (PPSA12544, discussion #1519). This test remains useful and still depends on #6363; closing it does not mean the test or issue is resolved. The branch test/gpu-timing-incomplete-batch and the recorded RADV, lavapipe, and collaborator macOS results are preserved here. I will revisit reopening when a slot becomes available.

@JJenkx JJenkx closed this Oct 15, 2026
@JJenkx JJenkx reopened this Oct 19, 2026
@JJenkx
JJenkx marked this pull request as ready for review October 19, 2026 00:46
@JJenkx
JJenkx force-pushed the test/gpu-timing-incomplete-batch branch from 8e37553 to e5e603d Compare October 19, 2026 00:46
@github-actions github-actions Bot added build agc libSceAgc* labels Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants