fix(agc): give AMD's proprietary driver robustBufferAccess2 again #8267
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8267"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T07:49:14Z.
What
Reverts #7351. AMD's proprietary driver gets
robustBufferAccess2again, 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
mainnow:agc_driver_layered_volume_drawandagc_driver_layered_volume_vertexfailed after the driver's pipeline cache had been filled by a run in the other library mode, in either direction. #7376 expected #6436, which keys shader modules by library mode, to fix this. #6436 is still open. Since #7828, the device is the same with and withoutAPS5_NO_GPL, and onmainwith #7828 the sequences below pass in both orders. No run here isolates #7828: the only pre-#7828 control fails earlier, at device open, with #7809's fault.agc_driver_subvector_looplost the high half of its wave64 because the driver miscompiled the empty-exec test. #7623 tests the mask with one compare, which the driver compiles correctly.This removes
RobustBufferAccess.hpp, its unit testagc_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 thes_subvector_loopentry: 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_beginis right on AMD's driver only because of #7623's one-compare form, whichagc_spirv_subvector_loop_begin(#8274) keeps in place on CI. The sentence now names both driver versions and says the selects are the onesrobustBufferAccess2brings.check_conventions.pywarns 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 isda5c7a895, rebased ontomain7ce3b1df3. On this head, the 8 tests below pass 3 of 3, the validation layer shows 0VUID-lines, and the lock-budget check printsrobustBufferAccess2=1. The other results below are from the earlier headfc9263772onmain2fee39f1b, and from the same commit onmaind0852defaagainstmaind0852defa.agc_driver_lds_mixed_width_atomics_tests --lock-budgetprintsrobustBufferAccess2=0onmainandrobustBufferAccess2=1with this PR. WithANYPS5_REQUIRE_ROBUST2=1it fails onmainand passes with this PR.--repeat until-fail:3: 8 of 8 pass onmainand with this PR, on both bases. The 8 areagc_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_budgetandagc_lds_lock_budget.ctest -Von the same 8: 0VUID-lines on either side.VK_LOADER_DEBUG=layerprintsInsert instance layer "VK_LAYER_KHRONOS_validation"in each of the 6 GPU test processes per side, and nowas not found but was requestedline.ANYPS5_NO_SHADER_CACHE=1andAPS5_NO_PIPELINE_JOURNAL=1, and libraries off meansAPS5_NO_GPL=1. Every step passes:--vertex-only), on, on (--vertex-only), off (--vertex-only);--vertex-only), off (--vertex-only), on;agc_driver_subvector_loop_tests: on, off, on, and off, on, off.ControlFlowInstructions.cppchange reverted locally to the two-compare form, withagc_driver_subvector_loop_testsrun from renamed copies. It passes 4 of 4 onmain(feature off) and fails 4 of 4 with this PR (feature on) withsubvector 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
2711f16c7onmaina98590decalso ran the full suite,ctest --parallel 4 --timeout 120.mainran 1711 tests with 4 failures; this PR ran 1710 (withoutagc_robust_buffer_access) with the same 4:log_macrosandlog_macros_timestamps: ccache rewrites__FILE__in local builds here.agc_driver_msaa_dcc_clear_4:multisampled DCC target reuse requires watched guest memory.agc_driver_mul_lo_u16_high_half: fixed since by #8280.Other AMD runs of this PR:
1002:164e, 32.0.21045.5002.1002:13c0, 32.0.21042.62.Not tested: any title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by TheSovietWaffle on 2026-10-20T11:10:22Z.
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_loopandagc_driver_lds_mixed_width_atomicspass 3 of 3 on both GPUs with this head (2711f16c7), and also on main01e5f8f19. 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).
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-20T11:56:50Z.
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.maind50ec76daagainstmain+ this PR (2711f16c7, clean merge).agc_driver_lds_lock_budgetprintsrobustBufferAccess2=0onmainandrobustBufferAccess2=1with this PR. WithANYPS5_REQUIRE_ROBUST2=1it fails onmainand passes with this PR.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_atomicsandagc_driver_lds_lock_budgetpass 3 of 3 on both trees.agc_driver_layered_volume_draw_tests.exeper sequence, so the driver's per-executable pipeline cache starts empty, withANYPS5_NO_SHADER_CACHE=1andAPS5_NO_PIPELINE_JOURNAL=1. Libraries were turned off withAPS5_NO_GPL=1. Every step exits 0 on both trees:--vertex-only), on, on (--vertex-only), off (--vertex-only);--vertex-only), off (--vertex-only), on.Not run: the Khronos validation layer, and no title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T12:31:28Z.
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. Basemain02fb1ce53, head = base +2711f16c7, same build dir.agc_driver_lds_lock_budgeton the iGPU printsrobustBufferAccess2=0onmainandrobustBufferAccess2=1with this PR.ctest -R "agc|shader|spirv|recomp" -j6on the iGPU:main833 tests, this PR 832 (agc_robust_buffer_accessremoved). Both fail the same two:agc_driver_mul_lo_u16_high_half(wrote 0xfffe0001, expected 0x00000001, as on your 6700 XT) andagc_driver_sgpr_pattern_fill_keys(which also fails onmainwhen run alone). No new failure. The PR run followed themainrun in the same executables, so the layered-volume and subvector tests started from a driver cache filled with the feature off, and they passed.RTX 5070 Ti: same set, same failures as
main(agc_driver_pass_input_hazard,agc_driver_sgpr_pattern_fill_keys).#7376's library-mode sequences from renamed executables (both orders, twice) and
agc_driver_subvector_loop_testswith libraries on then off and off then on: every step passes onmainand on this PR, the same as @LeandroLP23's 860M runs.The #7623 driver miscompile is also on 32.0.21042.62, and this PR exposes it again. With #7623's
ControlFlowInstructions.cppchange reverted locally (back to two compares), from renamed executables:main(feature off):agc_driver_subvector_looppasses 4 of 4;subvector loop exec kept by the body, initial exec high half: lane 0 exec hi after the loop is 0, expected 4294967295.So on this driver,
s_subvector_loop_beginwith this PR is correct only because of #7623's one-compare form.agc_spirv_subvector_loop_beginfrom #8274, now merged, is what keeps that form in place, since CI skips the device test.Not run: the Khronos validation layer (not installed here) and titles.
AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-20T17:14:51Z.
@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_testsfrom renamed copies:main: passes 4 of 4.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_beginright on AMD, pinned on CI by #8274's test. The debt sentence this PR moves to thes_subvector_loopentry already tied it to "guest loads use selects", which is whatrobustBufferAccess2turns on, but it didn't say so. I reworded it to name both driver versions and the feature.I rebased the PR on
main2fee39f1b(nowfc9263772), reran the tests you named on this head, and added these runs to the description.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-21T18:00:32Z.
Checked the revert against main: no remaining users of
RobustBufferAccess.hpporagc_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 withrobustBufferAccess2on; merged.