Skip to content

test(agc): split the runtime buffer span tests by wave size and coherence - #22123

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
domx4q:fix/agc-runtime-buffer-spans-split
Nov 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
domx4q:fix/agc-runtime-buffer-spans-split

Conversation

@domx4q

@domx4q domx4q commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

agc_driver_runtime_buffer_spans_x{2,3,4}_{spans,reference} each ran all 112 cases in one process: 2 wave sizes × 2 GLC settings × 2 barrier settings × 14 cases. On the Linux job, which runs ctest in parallel on lavapipe, x3_spans and x4_spans time out at 30 s. x2_spans took 22.6 s in run 43841416406, and run 43834891663 also timed out x2_spans and x4_reference. In run 43878956391 on main 7c444b7, x4_spans timed out again and x3_spans took 14.1 s, while the three _reference tests took 1.5 to 2.0 s.

Almost all of that time is the Vulkan pipeline compile of each case's dispatch. In one x4 --check-spans run on lavapipe with no Mesa cache, timed case by case, ShaderRecompiler::Recompile took 0.78 s in total and Dispatch + WaitIdle took 29.0 s for the 112 cases. The cost is spread evenly over wave size, GLC and barrier (3.0 to 4.2 s per combination). CONTRIBUTING.md asks to split such a test instead of raising its timeout.

  • RuntimeBufferSpans.cpp takes an optional wave size (32 or 64) and GLC selection (0 or 1) after the mode and runs only that quarter. Any other value fails with invalid wave size or invalid coherence selection. A selection that leaves no case fails with no case selected. With no selection, the executable runs every case as before.
  • agc_driver_runtime_buffer_spans_tests.cmake registers each test as four tests, ..._x{2,3,4}_{spans,reference}_wave{32,64}_glc{0,1}, 24 in place of 6. Environment, TIMEOUT 30 and skip code are unchanged. _fault_stop and _fault_barrier are unchanged.
  • No case or check is removed: the four quarters of each test run 28 cases each, 112 together. Per component count, the logs show 224 cases (112 --check-spans + 112 --reference), the same as before.

Tested

Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, Intel i9-14900KF, main 7c444b7.

CI-like contention (16 cores, lavapipe threads set to 16, no Mesa cache):
taskset -c 0-15 env MESA_SHADER_CACHE_DISABLE=true LP_NUM_THREADS=16 ANYPS5_GPU=llvmpipe ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build -R '^agc_driver_runtime_buffer_spans_' -j <N> --timeout 120

main this PR
-j 8 x3_spans and x4_spans Timeout 30.0 s, x2_spans 24.8 s 26/26 pass, slowest 12.6 s (x4_spans_wave64_glc1)
-j 15 x4_spans Timeout 30.0 s, x3_spans 25.9 s 26/26 pass, slowest 19.6 s (x4_spans_wave32_glc0)

At -j 15, main ran 8 tests at once and this PR 26, so the PR side had more contention.

AGC protocol, once per side and per configuration: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_driver_runtime_buffer_spans_' -V, on the RTX 4090 and on lavapipe. lavapipe also ran a second time under bwrap with /dev/udmabuf unopenable, as on the runner. main: 8/8 pass on all three. This PR: 26/26 pass on all three. Every log shows Insert instance layer "VK_LAYER_KHRONOS_validation", and none contains was not found but was requested by env var VK_INSTANCE_LAYERS. No log on either side has a VUID- line. Validation layer 1.4.363.1.

Mutation checks:

  • Each quarter still checks results. With the expected value of the first output word flipped in Run, all 8 x2 quarters fail.
  • 2 --check-spans 48 exits 1 with invalid wave size, and 2 --check-spans 32 x exits 1 with invalid coherence selection.

python3 tools/check_conventions.py --base origin/main passes. Full ctest was not run.

Overlap

python3 tools/pr_overlap.py --names agc_driver_runtime_buffer_spans_tests RuntimeBufferSpans: not declared on main, no open PR.
python3 tools/pr_overlap.py --branch fix/agc-runtime-buffer-spans-split: #21641 changes the same lines of agc_driver_runtime_buffer_spans_tests.cmake. It raises these six tests to TIMEOUT 60 instead. Measured with the command above at -j 15, it passes with x3_spans at 36.5 s and x4_spans at 44.8 s, which the "Report tests slower than 30 s" step flags. Only one of the two can merge as is.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, NVIDIA 620.70.06, Arch Linux (kernel 7.3.4); lavapipe (llvmpipe), Mesa 26.2.7 with LLVM 23.1.4, GALLIUM_OVERRIDE_CPU_CAPS=avx, Arch Linux (kernel 7.3.4)
  • AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added build agc libSceAgc* labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 21641 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake L11-18

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 15456 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 21924 core/libs/prx/libSceAgcDriver/tests/execution/RuntimeBufferSpans.cpp
PR 22434 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 22647 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake
PR 22692 core/libs/prx/libSceAgcDriver/tests/execution/RuntimeBufferSpans.cpp
PR 27133 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake

@domx4q
domx4q force-pushed the fix/agc-runtime-buffer-spans-split branch from 72ae977 to b79da5a Compare November 17, 2026 09:15
@maskym

maskym commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head b79da5aba8, merged alone into main e069a7562f (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. main itself fails to compile one test on Windows at this commit (UploadCacheReadOnlyFlush.cpp:177, setenv; #19899 fixes it), so both trees were built with ninja -k 0.

Validation-layer protocol on main and on this PR (ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation 1.4.366, VK_LOADER_DEBUG=error,warn,layer, ctest -R '^(agc|guest_video_out|video_out|pad_sdl)' --parallel 4 -V):

Tree Passed Layer inserted was not found but was requested VUID- set
main 2050/2054 1856 0 none
this PR 2069/2072 1874 0 identical

agc_driver_upload_cache_read_only_flush is Not Run on both trees because of the main build break above. No new validation errors and no new failures. The failures on this PR's tree (agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch) also fail on main here; rerun alone on this PR's tree they pass 0 of 3 times. agc_driver_store_over_untracked failed in the main run but passed in this PR's run.

The tests this PR adds or changes (agc_driver_runtime_buffer_spans, agc_driver_runtime_buffer_spans_fault_barrier, agc_driver_runtime_buffer_spans_fault_stop, agc_driver_runtime_buffer_spans_x2_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x2_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x2_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x2_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x2_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x2_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x2_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x2_spans_wave64_glc1, agc_driver_runtime_buffer_spans_x3_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x3_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x3_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x3_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x3_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x3_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x3_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x3_spans_wave64_glc1, agc_driver_runtime_buffer_spans_x4_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x4_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x4_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x4_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x4_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x4_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x4_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x4_spans_wave64_glc1) pass in the full validation-layer run. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@rafaconvaitis

Copy link
Copy Markdown
Contributor

Windows + AMD run; I found no AMD run in the description or in the comments. Head b79da5aba8 merged alone onto main 9a50e1014e with git merge --no-ff (clean merge).

Setup: Windows 11 25H2 (build 26200), AMD Radeon 760M integrated graphics (1002:15bf, Vulkan device name Radeon 5), AMD Software 26.11.2 (driver 32.0.32029.2010, Vulkan 1.4.359), selected with ANYPS5_GPU=Radeon, WinLibs GCC 15.2.0 r7 UCRT, Release, BUILD_TESTING=ON, Khronos validation layer 1.4.363 (LunarG SDK 1.4.363.1). Only the focused test targets were built; the other execution tests were left out with ANYPS5_AGC_EXECUTION_TESTS.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R '^(<the 27 test names of this comment>)$' -V -j 1, 3 runs per side.

test main this PR
24 tests (names below) not in main passes 3/3
agc_driver_runtime_buffer_spans passes 3/3 passes 3/3
agc_driver_runtime_buffer_spans_fault_barrier passes 3/3 passes 3/3
agc_driver_runtime_buffer_spans_fault_stop passes 3/3 passes 3/3
  • This PR changes tests only, so there is no negative control to run.
  • VUID- lines: 0 in the main and PR logs. Every run logs Selected GPU name=Radeon 5 vendor=0x1002 device=0x15bf and Insert instance layer "VK_LAYER_KHRONOS_validation", and none logs was not found but was requested.
Test names

24 tests: agc_driver_runtime_buffer_spans_x2_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x2_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x2_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x2_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x2_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x2_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x2_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x2_spans_wave64_glc1, agc_driver_runtime_buffer_spans_x3_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x3_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x3_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x3_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x3_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x3_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x3_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x3_spans_wave64_glc1, agc_driver_runtime_buffer_spans_x4_reference_wave32_glc0, agc_driver_runtime_buffer_spans_x4_reference_wave32_glc1, agc_driver_runtime_buffer_spans_x4_reference_wave64_glc0, agc_driver_runtime_buffer_spans_x4_reference_wave64_glc1, agc_driver_runtime_buffer_spans_x4_spans_wave32_glc0, agc_driver_runtime_buffer_spans_x4_spans_wave32_glc1, agc_driver_runtime_buffer_spans_x4_spans_wave64_glc0, agc_driver_runtime_buffer_spans_x4_spans_wave64_glc1

AI-assisted: yes (build and runs scripted with an AI assistant, on the hardware above).

@Colewiz7

Copy link
Copy Markdown
Contributor

Head b79da5aba8 merged onto main 0a025bd3c6 as 2d2373f334, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6406 on the 7900 XT, the 2066 GPU ones on the iGPU), new failures vs main none none
-R '^agc' ( tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main.

AI-assisted: yes

@MarcZX10 MarcZX10 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.

Reviewed — looks good

The changed test selection and CTest registration are consistent with the stated goal, and the inspected code shows no blocking defect.

What I ran

Reviewed head b79da5aba8f76ff8c8dbace922b178b304e321b6. I did not run commands or tests in this review environment. The author reports test runs on main and this PR, plus convention and mutation checks; these are not runs I performed.

Results

Check Result Note
Changed code review passed Both changed files read
Tests in this review not run No command execution available
Author-reported checks not run Reported in the PR description

Negative control

Not run in this review. The author reports mutation checks that flipped an expected output and verified invalid wave and coherence arguments fail.

Findings

Blocking

None.

Non-blocking

None.

Sources

The changed CMake registration splits each component and mode across the four wave and coherence combinations while retaining the environment, skip code, timeout, and Windows path setup (core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake:10-17). The executable validates selections, filters the loops, and rejects an empty selection (core/libs/prx/libSceAgcDriver/tests/execution/RuntimeBufferSpans.cpp:245-263). CMake test registration at the reviewed commit, runtime selection at the reviewed commit.

Not verified

No tests or conventions checks were run in this review. The PR description reports that the full CTest suite was not run. Read both reviewed files: core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_runtime_buffer_spans_tests.cmake and core/libs/prx/libSceAgcDriver/tests/execution/RuntimeBufferSpans.cpp; no changed files were excluded.

To get this to a good state

Nothing is required.

@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head b79da5aba8, applied with git apply on main fd4aeed483 together with the other 29 PRs of one batch (#18156, #21208, #22013, #22795, #23226, #23385, #24324, #24533, #24582, #24690, #24693, #17553, #19619, #20085, #21081, #19682, #22529, #22572, #22662, #23479, #23787, #24568, #15330, #21249, #21630, #21713, #22040, #23490, #24394). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
agc_driver_runtime_buffer_spans, agc_driver_runtime_buffer_spans_fault_barrier, agc_driver_runtime_buffer_spans_fault_stop and 3 more (6 tests, matched by name to the test file this PR changes) all pass all pass

Whole batch: the full ctest -j 12 (6540 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Traced to other PRs of the batch, each by reverting it and testing again: #17553 (guest_memory); none is in this PR's area. The 2143 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

…ence

Each agc_driver_runtime_buffer_spans_x{2,3,4}_{spans,reference} test ran
all 112 cases (2 wave sizes x 2 coherence settings x 2 barrier settings
x 14 cases) in one process. Almost all of the time is the Vulkan
pipeline compile of each case's dispatch (about 230 ms per case on
lavapipe, under 1 s of recompile in total), so on the Linux CI runner,
which runs ctest in parallel on lavapipe, x3_spans and x4_spans went past
the 30 s limit and x2_spans took 22.6 s.

The test executable takes an optional wave size (32 or 64) and coherence
(0 or 1) after the mode and runs only that quarter; ctest registers the
four quarters of each test as _wave{32,64}_glc{0,1}. The quarters run the
same 112 cases per test as before. With no selection the executable
still runs every case.
@domx4q
domx4q force-pushed the fix/agc-runtime-buffer-spans-split branch from b79da5a to 96bc66f Compare November 24, 2026 14:05

@MarcZX10 MarcZX10 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.

Reviewed — looks good

The split preserves the full case matrix while letting each registered test cover one wave size and coherence setting; no blocking defect was found in the changed code.

What I ran

  • Reviewed head 96bc66f125762fe05c79bb134ba87be5d72fd3ed.
  • Read description.md, commits.md, manifest.json, diff.patch, and both changed files in full through repo_read.py.
  • No commands or tests were run by me; the test and mutation results in the PR description are author-reported.

Results

Check Result Note
Changed-code review passed Both changed files read in full
Tests run by reviewer not run Author reports targeted runs; full ctest not run

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • I did not independently run the reported lavapipe, Vulkan validation, or mutation checks.
  • files.json was not available as a review-folder document; the manifest lists both changed files as included, and both were read in full.

To get this to a good state

Nothing is required.

@oneandonlydean
oneandonlydean merged commit 1e8e830 into boykopovar:main Nov 27, 2026
14 checks passed
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.

7 participants