test(shader): split the flat and global loads test to keep it within CI's time limit #689

Merged
adriadam10 merged 1 commit from upstream-pr/689 into main 2026-10-05 18:51:42 +00:00
adriadam10 commented 2026-10-05 15:34:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T15:34:05Z.


What

agc_driver_flat_global_loads (from #547) takes 56 s on main's Linux CI and 73 s cold on CI's lavapipe locally, about half the 120 s ctest timeout. On CI's lavapipe (LLVM 20) almost all of that is compiling the BDA reads. Every load in the test uses an offset or misaligned address, so each one emits the byte path, and the cost grows with the width: about 3 s for a byte or dword load and about 7 s for an unaligned dwordx4, measured one by one.

The test is split into six tests, one kernel each, grouped by that cost. The 20 loads, the 32 rows and the region bytes are unchanged:

Test Loads
GlobalLoads ubyte, sbyte, ushort, sshort, dword, SGPR-base dword, the second ubyte
GlobalLoadsX2X3 dwordx2, dwordx3
GlobalLoadsX4 dwordx4
FlatLoads, FlatLoadsX2X3, FlatLoadsX4 the same split of the flat kernel

Each load reads only its own lane's addresses into its own registers, so splitting the kernel doesn't change any result. The expected values are the HW outputs of #547 for the registers each test loads, plus the sentinel elsewhere, and the generator asserts this for every row. The 6 KiB region moved to FlatGlobalLoadsRegion.hpp next to the tests, like VulkanTestDevice.hpp, so it isn't copied six times.

The total time goes down a little (64 s cold locally, was 73 s), but each test now takes 9 to 12 s, so none comes close to the timeout. Reducing the total would mean dropping loads.

Only tests change.

Tested

  • CI's lavapipe (Ubuntu Mesa 25.2.8, LLVM 20.1.2), cold with no shader cache: 11, 12, 9, 11, 12 and 9 s. RADV and local lavapipe: all six pass.
  • Negative checks from #547, run against all six tests: flat offset losing bit 10, global offset not sign-extended, no sign extension, dwordx3 reading 2 dwords, dwordx3 dropping its last dword, a 64-bit VGPR global address taken as an SGPR-base offset: each one fails at least one test. Mapping an unaligned span through the aligned path is still not caught, as on main.
  • Linux (CachyOS, GCC, Release, BUILD_TESTING=ON): full build, ctest 290/293. agc_driver_pixel_helper_lanes, agc_driver_pixel_lds and agc_driver_pixel_lds_lane_slots also fail on main on this machine's RADV.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4747292068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/689). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T15:34:05Z. --- ### What `agc_driver_flat_global_loads` (from #547) takes 56 s on main's Linux CI and 73 s cold on CI's lavapipe locally, about half the 120 s ctest timeout. On CI's lavapipe (LLVM 20) almost all of that is compiling the BDA reads. Every load in the test uses an offset or misaligned address, so each one emits the byte path, and the cost grows with the width: about 3 s for a byte or dword load and about 7 s for an unaligned `dwordx4`, measured one by one. The test is split into six tests, one kernel each, grouped by that cost. The 20 loads, the 32 rows and the region bytes are unchanged: | Test | Loads | | --- | --- | | `GlobalLoads` | `ubyte`, `sbyte`, `ushort`, `sshort`, `dword`, SGPR-base `dword`, the second `ubyte` | | `GlobalLoadsX2X3` | `dwordx2`, `dwordx3` | | `GlobalLoadsX4` | `dwordx4` | | `FlatLoads`, `FlatLoadsX2X3`, `FlatLoadsX4` | the same split of the flat kernel | Each load reads only its own lane's addresses into its own registers, so splitting the kernel doesn't change any result. The expected values are the HW outputs of #547 for the registers each test loads, plus the sentinel elsewhere, and the generator asserts this for every row. The 6 KiB region moved to `FlatGlobalLoadsRegion.hpp` next to the tests, like `VulkanTestDevice.hpp`, so it isn't copied six times. The total time goes down a little (64 s cold locally, was 73 s), but each test now takes 9 to 12 s, so none comes close to the timeout. Reducing the total would mean dropping loads. Only tests change. ### Tested - CI's lavapipe (Ubuntu Mesa 25.2.8, LLVM 20.1.2), cold with no shader cache: 11, 12, 9, 11, 12 and 9 s. RADV and local lavapipe: all six pass. - Negative checks from #547, run against all six tests: flat offset losing bit 10, global offset not sign-extended, no sign extension, `dwordx3` reading 2 dwords, `dwordx3` dropping its last dword, a 64-bit VGPR global address taken as an SGPR-base offset: each one fails at least one test. Mapping an unaligned span through the aligned path is still not caught, as on main. - Linux (CachyOS, GCC, Release, `BUILD_TESTING=ON`): full build, `ctest` 290/293. `agc_driver_pixel_helper_lanes`, `agc_driver_pixel_lds` and `agc_driver_pixel_lds_lane_slots` also fail on `main` on this machine's RADV. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!689
No description provided.