Skip to content

fix(agc): give AMD's proprietary driver robustBufferAccess2 again - #8267

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/amd-robust2
Oct 21, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
thuanquang:fix/amd-robust2

Conversation

@thuanquang

@thuanquang thuanquang commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Reverts #7351. AMD's proprietary driver gets robustBufferAccess2 again, so its storage-buffer loads drop their selections like every other driver's (#4048). Fixes #7376.

#7351 kept the feature off on that driver because enabling it broke three tests on an RX 6700 XT. #7376 traced both causes, and both are fixed on main now:

This removes RobustBufferAccess.hpp, its unit test agc_robust_buffer_access, the driver query that fed it, and the AMD sentences in the guest memory load guards debt entry (2627 characters before, 1777 now). The sentence recording #7623's empty-mask test moves to the s_subvector_loop entry: that driver miscompile is still there, and with the feature on it matters on AMD again. @wachi35676 measured it on 32.0.21042.62, and it reproduces on the RX 6700 XT (below). So with this PR, s_subvector_loop_begin is right on AMD's driver only because of #7623's one-compare form, which agc_spirv_subvector_loop_begin (#8274) keeps in place on CI. The sentence now names both driver versions and says the selects are the ones robustBufferAccess2 brings. check_conventions.py warns that both entries are over 1000 characters.

Overlap: #7484 (@AlxcBTW) adds a check right under the line this PR rewrites, and its body relies on the AMD exclusion keeping its path off on AMD's driver. After this PR its AMD gating rests only on robustStorageBufferAccessSizeAlignment, which nobody has measured on AMD. #6177 (@mitul72) rewrites the same assignment. Whichever merges second needs a small rebase; I'm happy to go second.

Tested

Windows 11 26200, RX 6700 XT (gfx1031), AMD driver 32.0.21045.5002, Release, ANYPS5_REQUIRE_VULKAN=1. This head is da5c7a895, rebased onto main 7ce3b1df3. On this head, the 8 tests below pass 3 of 3, the validation layer shows 0 VUID- lines, and the lock-budget check prints robustBufferAccess2=1. The other results below are from the earlier head fc9263772 on main 2fee39f1b, and from the same commit on main d0852defa against main d0852defa.

  • agc_driver_lds_mixed_width_atomics_tests --lock-budget prints robustBufferAccess2=0 on main and robustBufferAccess2=1 with this PR. With ANYPS5_REQUIRE_ROBUST2=1 it fails on main and passes with this PR.
  • --repeat until-fail:3: 8 of 8 pass on main and with this PR, on both bases. The 8 are agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex, agc_driver_layered_volume_vertex_no_gpl, agc_driver_subvector_loop, agc_spirv_subvector_loop_begin, agc_driver_lds_mixed_width_atomics, agc_driver_lds_lock_budget and agc_lds_lock_budget.
  • Khronos validation layer, ctest -V on the same 8: 0 VUID- lines on either side. VK_LOADER_DEBUG=layer prints Insert instance layer "VK_LAYER_KHRONOS_validation" in each of the 6 GPU test processes per side, and no was not found but was requested line.
  • Library-mode sequences, each from a renamed copy of the executable so AMD's per-executable pipeline cache starts empty. Each ran twice with ANYPS5_NO_SHADER_CACHE=1 and APS5_NO_PIPELINE_JOURNAL=1, and libraries off means APS5_NO_GPL=1. Every step passes:
    • layered volume: off (--vertex-only), on, on (--vertex-only), off (--vertex-only);
    • layered volume: on, on (--vertex-only), off (--vertex-only), on;
    • agc_driver_subvector_loop_tests: on, off, on, and off, on, off.
  • @wachi35676's check: fix(shader): test an empty exec mask in s_subvector_loop_begin with one compare #7623's ControlFlowInstructions.cpp change reverted locally to the two-compare form, with agc_driver_subvector_loop_tests run from renamed copies. It passes 4 of 4 on main (feature off) and fails 4 of 4 with this PR (feature on) with subvector loop exec kept by the body, initial exec high half: lane 0 exec hi after the loop is 0, expected 4294967295. That is the same failure as on their driver, 32.0.21042.62.

The earlier head 2711f16c7 on main a98590dec also ran the full suite, ctest --parallel 4 --timeout 120. main ran 1711 tests with 4 failures; this PR ran 1710 (without agc_robust_buffer_access) with the same 4:

Other AMD runs of this PR:

Not tested: any 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 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: Fixes AGC: root cause of the AMD proprietary failures behind the robustBufferAccess2 exclusion (#7351) is still open #7376
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200
  • AI-assisted: yes

🤖 Generated with Claude Code

@TheSovietWaffle

Copy link
Copy Markdown
Contributor

Second AMD proprietary-driver data point: RTX 3080 (NVIDIA 617.42) and AMD Radeon RDNA 2 iGPU (1002:164e, 32.0.21045.5002), Windows 10 Pro 22H2, WinLibs GCC 15.2.0, Release. agc_driver_lds_lock_budget, agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex, agc_driver_layered_volume_vertex_no_gpl, agc_driver_subvector_loop and agc_driver_lds_mixed_width_atomics pass 3 of 3 on both GPUs with this head (2711f16c7), and also on main 01e5f8f19. So this iGPU did not show the failures you list for the RX 6700 XT, and the change does not break anything on it either.

AI-assisted: yes (Claude Code).

@LeandroLP23

Copy link
Copy Markdown
Contributor

An RDNA 3.5 data point on a different AMD driver branch: this PR works on a Radeon 860M as well.

Setup: Radeon 860M (1002:1114, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0, Release, ANYPS5_REQUIRE_VULKAN=1. main d50ec76 against main + this PR (2711f16, clean merge).

  • The feature is on. agc_driver_lds_lock_budget prints robustBufferAccess2=0 on main and robustBufferAccess2=1 with this PR. With ANYPS5_REQUIRE_ROBUST2=1 it fails on main and passes with this PR.
  • Named tests. agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex, agc_driver_layered_volume_vertex_no_gpl, agc_driver_subvector_loop, agc_driver_lds_mixed_width_atomics and agc_driver_lds_lock_budget pass 3 of 3 on both trees.
  • Library mode switched against a filled driver cache. I used a renamed copy of agc_driver_layered_volume_draw_tests.exe per sequence, so the driver's per-executable pipeline cache starts empty, with ANYPS5_NO_SHADER_CACHE=1 and APS5_NO_PIPELINE_JOURNAL=1. Libraries were turned off with APS5_NO_GPL=1. Every step exits 0 on both trees:
    • off (--vertex-only), on, on (--vertex-only), off (--vertex-only);
    • on, on (--vertex-only), off (--vertex-only), on.

Not run: the Khronos validation layer, and no title.

AI-assisted: yes (Claude Code)

@wachi35676

Copy link
Copy Markdown
Contributor

One more AMD driver build, plus a measurement the earlier comments don't have: on this driver the #7623 miscompile is reachable again with this PR. Windows 11 26300, AMD Radeon iGPU 1002:13c0 (RDNA 2), AMD Windows driver 32.0.21042.62, wave64 (ANYPS5_GPU=AMD), plus an RTX 5070 Ti (617.42). WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1. Base main 02fb1ce53, head = base + 2711f16c7, same build dir.

Not run: the Khronos validation layer (not installed here) and titles.

AI-assisted: yes (Claude Code); results above were run on this machine.

@thuanquang

Copy link
Copy Markdown
Contributor Author

@wachi35676 thank you, that check was worth doing, and it reproduces on the discrete card. On an RX 6700 XT with 32.0.21045.5002, with #7623's change reverted to the two compares, agc_driver_subvector_loop_tests from renamed copies:

  • main: passes 4 of 4.
  • this PR: fails 4 of 4 with your message: lane 0 exec hi after the loop is 0, expected 4294967295.

So the miscompile is in both driver versions, and with this PR the one-compare form is what keeps s_subvector_loop_begin right on AMD, pinned on CI by #8274's test. The debt sentence this PR moves to the s_subvector_loop entry already tied it to "guest loads use selects", which is what robustBufferAccess2 turns on, but it didn't say so. I reworded it to name both driver versions and the feature.

I rebased the PR on main 2fee39f1b (now fc9263772), reran the tests you named on this head, and added these runs to the description.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
enabling it broke agc_driver_layered_volume_draw, agc_driver_layered_volume_vertex
and agc_driver_subvector_loop on an RX 6700 XT. With boykopovar#7623 and boykopovar#7828 on
main, those tests pass with the feature on, in either library-mode order.
This reverts 48b394d and keeps the record of boykopovar#7623's empty-mask test in
the s_subvector_loop debt entry.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@adriadam10 adriadam10 self-assigned this Oct 21, 2026
@adriadam10
adriadam10 merged commit 95d1768 into boykopovar:main Oct 21, 2026
11 of 12 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the revert against main: no remaining users of RobustBufferAccess.hpp or agc_robust_buffer_access, the debt entries match the code, and the AMD results (RX 6700 XT plus the iGPU/860M runs from @TheSovietWaffle, @LeandroLP23 and @wachi35676) show the three #7351 tests passing with robustBufferAccess2 on; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs fix error Closes an issue (Fixes #N)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AGC: root cause of the AMD proprietary failures behind the robustBufferAccess2 exclusion (#7351) is still open

5 participants