test(shader): split the global atomics test to keep it within CI's time limit #688

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

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


What

agc_driver_global_atomics (from #491) takes 29 s on main's Linux CI and 46 s cold on CI's lavapipe locally. It ran one kernel with all 28 atomics three times: wave32, wave64, and once more against a read-only range. Each dispatch recompiles, and CI's lavapipe (LLVM 20) is slow on BDA accesses.

It is now three tests. The opcodes, rows and checks are the same:

  • GlobalAtomics: the 13 32-bit global_atomic_* opcodes, 16 HW rows each, wave32.
  • GlobalAtomics64: the 11 _x2 opcodes, 16 HW rows each, wave32.
  • GlobalAtomicsLanes: the cases that depend on the lanes, as wave32 and wave64: flat_atomic_xor through a 64-bit VGPR address, the contended returning global_atomic_add (sum and distinct prefix sums), the non-returning global_atomic_or under a partial EXEC, and a per-lane non-returning add. Then the read-only dispatch, which must leave the range untouched.

The per-opcode rows depend only on each lane's own address and data, so they run as wave32 only. The wave64 path is still covered by the lanes test, on all 64 lanes. The read-only check used to run all 24 opcodes. Now it runs the lanes kernel, which has a new non-returning global_atomic_add_x2 (per-lane carry into the high dword), so both the 4-byte and the 8-byte write lookups of EmitBdaAtomic hit the read-only range. The add_x2 expected value is the 64-bit sum: add_x2 itself is among the HW-measured opcodes, but this new row was not run on HW.

Only tests change.

Tested

  • CI's lavapipe (Ubuntu Mesa 25.2.8, LLVM 20.1.2), cold with no shader cache: 5 s + 5 s + 4 s, was 46 s. RADV and local lavapipe: all three pass.
  • Negative checks from #491, run against all three tests: cmpswap operand order, x2 comparator offset, inc vs dec, signed vs unsigned min, EXEC ignored, glc return dropped, x2 data width: each one fails at least one of the three. Dropping note_bda_write is still not visible, as on main.
  • Linux (CachyOS, GCC, Release, BUILD_TESTING=ON): full build, ctest 287/290. 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:4747291529 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/688). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T15:34:02Z. --- ### What `agc_driver_global_atomics` (from #491) takes 29 s on main's Linux CI and 46 s cold on CI's lavapipe locally. It ran one kernel with all 28 atomics three times: wave32, wave64, and once more against a read-only range. Each dispatch recompiles, and CI's lavapipe (LLVM 20) is slow on BDA accesses. It is now three tests. The opcodes, rows and checks are the same: - `GlobalAtomics`: the 13 32-bit `global_atomic_*` opcodes, 16 HW rows each, wave32. - `GlobalAtomics64`: the 11 `_x2` opcodes, 16 HW rows each, wave32. - `GlobalAtomicsLanes`: the cases that depend on the lanes, as wave32 and wave64: `flat_atomic_xor` through a 64-bit VGPR address, the contended returning `global_atomic_add` (sum and distinct prefix sums), the non-returning `global_atomic_or` under a partial EXEC, and a per-lane non-returning add. Then the read-only dispatch, which must leave the range untouched. The per-opcode rows depend only on each lane's own address and data, so they run as wave32 only. The wave64 path is still covered by the lanes test, on all 64 lanes. The read-only check used to run all 24 opcodes. Now it runs the lanes kernel, which has a new non-returning `global_atomic_add_x2` (per-lane carry into the high dword), so both the 4-byte and the 8-byte write lookups of `EmitBdaAtomic` hit the read-only range. The `add_x2` expected value is the 64-bit sum: `add_x2` itself is among the HW-measured opcodes, but this new row was not run on HW. Only tests change. ### Tested - CI's lavapipe (Ubuntu Mesa 25.2.8, LLVM 20.1.2), cold with no shader cache: 5 s + 5 s + 4 s, was 46 s. RADV and local lavapipe: all three pass. - Negative checks from #491, run against all three tests: cmpswap operand order, x2 comparator offset, inc vs dec, signed vs unsigned min, EXEC ignored, `glc` return dropped, x2 data width: each one fails at least one of the three. Dropping `note_bda_write` is still not visible, as on main. - Linux (CachyOS, GCC, Release, `BUILD_TESTING=ON`): full build, `ctest` 287/290. `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!688
No description provided.