Skip to content

test(agc): split agc_driver_flat_apertures by shader instead of by row - #3830

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
winstrex:fix/agc-flat-apertures-kernel-parts
Oct 11, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
winstrex:fix/agc-flat-apertures-kernel-parts

Conversation

@winstrex

Copy link
Copy Markdown
Contributor

What

agc_driver_flat_apertures is split into parts by shader instead of by row, and into 14 parts instead of 6. On CI's lavapipe the slowest part goes from 83–117 s to 29 s.

Since #3217 the six parts take 71–117 s each on every Linux CI run of main (part 0 took 116.8 s in run 38140296210, 3 s under the 120 s timeout). The time is not in the recompiler but in pipeline creation: on lavapipe each atomic64 shader takes about 10 s to compile and each atomic32 shader about 4 s. A row's kernel depends only on the operation and width (the target only changes the addresses in the table), so the shared, private and guest rows of one operation compile the same shader, and once one process has compiled it, later ones get it in a fraction of a second (most likely from Mesa's disk cache). With every sixth row per part, the three rows of an operation land in three different parts (16 operations per target), and when those parts start together each compiles the shader cold.

Now each distinct (kernel, wave size) pair is numbered in row order and goes to part number % parts, so all its rows run in the same process and each shader is compiled once per run: 38 shaders for the 126 rows. With no argument the executable still runs every row.

Note for #3291: the part numbers there (_1, _2, _4) refer to the old split and now cover different rows.

Tested

Linux CI on my fork (build.yml workflow_dispatch, merged into main a11c8f7, lavapipe):

slowest part sum of parts ctest step
main (38140296210) 116.8 s 452 s 6.4 min
8 parts (38157004408) 38.3 s 275 s 4.7 min
12 parts (38157578783) 30.7 s 257 s 4.7 min
14 parts, this PR (38157587048) 29.4 s 273 s 4.7 min

With 14 parts no part gets the slow-test warning. The Linux and Windows jobs fail only on tests that also fail on main at that commit (agc_driver_emulated_color_compare, agc_driver_image_plane_address_on_line_implicit_lod and guest_kernel_stack_protect on Linux; windows_exceptions, guest_kernel_sys and guest_filesystem on Windows).

How the cause was found: per-row timing in a throwaway build showed the cost in Dispatch/WaitIdle (213 s) rather than in Recompile (17 s), and the same operation took ~10 s in the first part to run it and 0.2–0.5 s in later ones. Running the parts one at a time (RESOURCE_LOCK) or two at a time (PROCESSORS 2) did not fix it: the first parts to run still took 60–117 s.

Every row is in exactly one part, since its part is its shader's number modulo the part count. Windows 11, WinLibs GCC 15.2.0 r7, NVIDIA RTX 5070 Ti: the parts that finish report the expected row counts; on this GPU some parts stop with "still pinned by GPU work", as parts of the old split do on main (#3291).

tools/check_conventions.py and tools/check_test_registration.py pass.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

Rows that run the same kernel at the same wave size compile the same
pipeline, so each part now takes whole groups of them, and the test is
split into fourteen parts. Each shader is compiled once per CI run
instead of in up to three parts at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added build agc libSceAgc* labels Oct 11, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked: the 14 parts cover each of the 126 rows exactly once (per-part counts sum to 126, same as the no-argument run), all agc_driver_flat_apertures_0..13 pass on a build of this PR merged onto current main, and the libSceAgcDriver ctest scope is green. The lavapipe timings are from your fork run; merging once CI is green.

@adriadam10
adriadam10 merged commit 6407626 into boykopovar:main Oct 11, 2026
13 checks passed
@winstrex
winstrex deleted the fix/agc-flat-apertures-kernel-parts branch October 11, 2026 23:23
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