Skip to content

test(shader): cover the bitwise and unsigned image atomics - #667

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
adriadam10:test/image-atomics-bitwise
Oct 5, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
adriadam10:test/image-atomics-bitwise

Conversation

@adriadam10

Copy link
Copy Markdown
Collaborator

What

image_atomic_and, image_atomic_or, image_atomic_xor, image_atomic_umin and image_atomic_umax are decoded and translated, but no execution test runs them. This adds ImageAtomicsBitwise.cpp with the same shape as ImageAtomics.cpp: each lane swaps its own texel to a, runs the atomic with b and glc, then reads the texel back with image_atomic_add 0 glc. Pins the returned value (a) and the stored value.

The test is a new file, not part of ImageAtomics.cpp, so that it doesn't conflict with #659, which edits that file. Test only, no emulator change.

Rows: 64 lanes. 14 edge pairs (0 and all-ones, 0x7fffffff/0x80000000 to separate unsigned from signed min/max, alternating bit patterns, equal values) plus LCG values. It runs as wave32, as native wave64 and as wave64 split into two wave32 halves (ComputeTarget(32)).

Behaviour measured on HW

RDNA2 (gfx1035, wave32, 32_UINT 2D T#): all 64 rows match the model a & b, a | b, a ^ b, unsigned min/max, and the returned value is the previous texel. main already does this, so no bug was found.

Tested

  • Linux (CachyOS), GCC 16.2.1, Release build on main 53dc19c: full ctest with ANYPS5_REQUIRE_VULKAN=1. The new test passes on RADV, on local lavapipe and on CI's lavapipe (Mesa 25.2.8, 0 s cold). 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 (wave32 lane 32 on a 64-wide subgroup), unrelated.
  • The test fails without each mapping. Swapping umin→smin, umax→smax, and→or, or→xor or xor→or in MemoryInstructionDispatch.cpp fails it on RADV and lavapipe.
  • Not tested: Windows, NVIDIA, a title.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the agc libSceAgc* label Oct 5, 2026
@oneandonlydean
oneandonlydean merged commit bbc6f42 into boykopovar:main Oct 5, 2026
3 checks passed
@adriadam10
adriadam10 deleted the test/image-atomics-bitwise branch October 6, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants