fix(shader): split a BDA span read's in-place loads from its fallback #4759

Merged
fdfawef324 merged 1 commit from upstream-pr/4759 into main 2026-10-13 04:00:48 +00:00
fdfawef324 commented 2026-10-12 20:58:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-12T20:58:31Z.


What

Fixes #3291. Resubmits #3289 (closed by the intake bot) by its author, rebased onto current main.

On an RTX 3060 (Windows, driver 591.86) a dispatch that reads guest memory through read_bda_span never finishes when its lanes split between the span's in-place dword loads and its per-dword byte fallback (which calls read_bda_dword_bytes). Windows resets the GPU and the device is lost. How the tests then fail depends on where the loss is observed. Most tests fail in teardown: the lost batch keeps its lease, so the teardown waits 60 s for the pinned guest allocation and aborts with guest allocation ... is still pinned by GPU work or an import. agc_driver_pixel_interlock instead fails after a few seconds with vkDeviceWaitIdle: Vulkan result -4 (VK_ERROR_DEVICE_LOST) and never reaches the pin wait.

The hang is not general to NVIDIA. The reports in #3291 show:

  • karanvora2599, RTX 4060 Laptop GPU, Windows, driver 591.86: the same tests fail on main (device lost after about 20 s, then the 60 s lease wait), and all 15 BDA tests pass with this change (tested as b54fe623, the same code patch).
  • MojoisDev, RTX 5060, Linux, driver 590.48.01: the flat-load test reproduces the pinned-allocation abort on main, and the nine originally failing tests pass with this change (tested as 338917245, the same code patch). 21 of the 22 affected tests pass three serial repeats; the remaining failure, agc_driver_wave32_subgroup, is reported there as a separate problem. A RADV cross-check passes all 22.
  • AchrafReyani, RTX 4070 Laptop GPU, Windows, driver 616.92: the hang does not reproduce on main, and the change causes no regression there (356 of 356 tests pass).
  • Amoenus, RTX 5080, Windows, driver 610.62: agc_driver_flat_apertures_* parts time out on main, but this change was never tested there, and the APS5_BDA_BYTE_READS=1 control also times out. That failure is unresolved and may be a different problem; this PR does not claim to fix it.

The two paths were the arms of one OpSelectionMerge selection inside the DontInline function. They are now two selections, the loads under the span's condition and the fallback under its negation, each producing a zero vector on the lane that does not take it, and the result is chosen after both. Every lane still runs exactly the loads, page-table lookups, fault records and invocation stops it ran before, so no RDNA instruction semantics change; only the SPIR-V control-flow shape does (SPIR-V 2.11 structured control flow). The recompiler emits SPIR-V 1.3 for every stage except mesh shaders (1.4), and OpSelect can only choose between composite values with a scalar condition from 1.4 on, so the final join stays a selection.

The driver-side cause is not known, so the shape is recorded in docs/dev/debt/shader.md (code comments are not allowed), so that it is not folded back into one selection.

#3655 (open, RADV page-table walk inlining) changes the same lines of SpirvBdaRead.cpp for another reason; whichever merges second rebases. #4224 carried this commit and was closed because it was not its author's.

Tested

  • OS Windows Server 2025, GPU RTX 3060 (driver 591.86 = 32.0.15.9186), GCC 15.2 (winlibs), Release -O3. All runs below are on this machine unless stated otherwise.
  • Red on main 3e0e01f35 with the fix reverted (ANYPS5_NO_SHADER_CACHE=1, ctest -j 4): 9 of the 23 affected tests fail. agc_driver_flat_loads, agc_driver_flat_loads_x2_x3, agc_driver_flat_loads_x4, agc_driver_global_loads, agc_driver_global_loads_x2_x3, agc_driver_global_loads_x4, agc_driver_flat_apertures_2 and agc_driver_flat_apertures_5 abort after 64.2 to 70.6 s on the 60 s pin wait. agc_driver_pixel_interlock fails after 6.3 s with vkDeviceWaitIdle: Vulkan result -4.
  • Green with the fix, same base and settings: all 23 (agc_driver_(flat|global)_loads*, agc_driver_pixel_interlock, agc_driver_flat_apertures_0 to _13, agc_driver_bda_device, agc_driver_bda_span_reads) pass in 52.3 s at -j 4, the slowest in 18.6 s.
  • Full library, ctest -R "^(agc_|shader_)" -j 4 with ANYPS5_SHADER_CACHE_DIR set to a new empty directory (most of these tests also set ANYPS5_NO_SHADER_CACHE=1 themselves):
    • on 3e0e01f35: 444 of 444 pass (agc_driver_stencil_ref_export skipped), 199.6 s, slowest test 16.0 s (agc_driver_prepared_shaders_debug_failure). An earlier run of the same set failed agc_driver_scalar_swappc_fetch once (302.7 s, then a vertex value mismatch); it passed alone, in 8 of 8 repeats and in this rerun.
    • after rebasing onto 44ab0c39e: 443 of 444 pass, 270.4 s, slowest test 29.6 s (agc_driver_swap_alt_blend) while other jobs shared the GPU. agc_driver_depth_storage_reuse failed once with vkWaitForFences graphics: Vulkan result 2 (VK_TIMEOUT) after 10.7 s; it passed 8 of 8 repeats alone. All 23 affected tests passed in this run.
  • Rebased onto main 42496c5e5 (one more AGC texture change, no shader change) and rechecked there: the 23 affected tests pass in 33.0 s at -j 4 with ANYPS5_NO_SHADER_CACHE=1, the slowest in 21.4 s (agc_driver_flat_apertures_8).
  • Linux CI on main (lavapipe, run 38301611844 on 3e0e01f35) passes these tests without the change, so the hang does not reproduce on lavapipe and CI passes either way. This comes from CI, not from a run on this machine.
  • python -I tools/check_conventions.py --base upstream/main: passed.
  • Not tested with 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 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
  • Unblocks: none
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4834916324 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4759). Originally posted by [fdfawef324](https://github.com/fdfawef324) on 2026-10-12T20:58:31Z. --- ### What Fixes #3291. Resubmits #3289 (closed by the intake bot) by its author, rebased onto current `main`. On an RTX 3060 (Windows, driver 591.86) a dispatch that reads guest memory through `read_bda_span` never finishes when its lanes split between the span's in-place dword loads and its per-dword byte fallback (which calls `read_bda_dword_bytes`). Windows resets the GPU and the device is lost. How the tests then fail depends on where the loss is observed. Most tests fail in teardown: the lost batch keeps its lease, so the teardown waits 60 s for the pinned guest allocation and aborts with `guest allocation ... is still pinned by GPU work or an import`. `agc_driver_pixel_interlock` instead fails after a few seconds with `vkDeviceWaitIdle: Vulkan result -4` (`VK_ERROR_DEVICE_LOST`) and never reaches the pin wait. The hang is not general to NVIDIA. The reports in #3291 show: - karanvora2599, RTX 4060 Laptop GPU, Windows, driver 591.86: the same tests fail on `main` (device lost after about 20 s, then the 60 s lease wait), and all 15 BDA tests pass with this change (tested as b54fe623, the same code patch). - MojoisDev, RTX 5060, Linux, driver 590.48.01: the flat-load test reproduces the pinned-allocation abort on `main`, and the nine originally failing tests pass with this change (tested as 338917245, the same code patch). 21 of the 22 affected tests pass three serial repeats; the remaining failure, `agc_driver_wave32_subgroup`, is reported there as a separate problem. A RADV cross-check passes all 22. - AchrafReyani, RTX 4070 Laptop GPU, Windows, driver 616.92: the hang does not reproduce on `main`, and the change causes no regression there (356 of 356 tests pass). - Amoenus, RTX 5080, Windows, driver 610.62: `agc_driver_flat_apertures_*` parts time out on `main`, but this change was never tested there, and the `APS5_BDA_BYTE_READS=1` control also times out. That failure is unresolved and may be a different problem; this PR does not claim to fix it. The two paths were the arms of one `OpSelectionMerge` selection inside the `DontInline` function. They are now two selections, the loads under the span's condition and the fallback under its negation, each producing a zero vector on the lane that does not take it, and the result is chosen after both. Every lane still runs exactly the loads, page-table lookups, fault records and invocation stops it ran before, so no RDNA instruction semantics change; only the SPIR-V control-flow shape does ([SPIR-V 2.11 structured control flow](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#_structured_control_flow)). The recompiler emits SPIR-V 1.3 for every stage except mesh shaders (1.4), and `OpSelect` can only choose between composite values with a scalar condition from 1.4 on, so the final join stays a selection. The driver-side cause is not known, so the shape is recorded in `docs/dev/debt/shader.md` (code comments are not allowed), so that it is not folded back into one selection. #3655 (open, RADV page-table walk inlining) changes the same lines of `SpirvBdaRead.cpp` for another reason; whichever merges second rebases. #4224 carried this commit and was closed because it was not its author's. ### Tested - OS Windows Server 2025, GPU RTX 3060 (driver 591.86 = 32.0.15.9186), GCC 15.2 (winlibs), Release -O3. All runs below are on this machine unless stated otherwise. - Red on `main` 3e0e01f35 with the fix reverted (`ANYPS5_NO_SHADER_CACHE=1`, `ctest -j 4`): 9 of the 23 affected tests fail. `agc_driver_flat_loads`, `agc_driver_flat_loads_x2_x3`, `agc_driver_flat_loads_x4`, `agc_driver_global_loads`, `agc_driver_global_loads_x2_x3`, `agc_driver_global_loads_x4`, `agc_driver_flat_apertures_2` and `agc_driver_flat_apertures_5` abort after 64.2 to 70.6 s on the 60 s pin wait. `agc_driver_pixel_interlock` fails after 6.3 s with `vkDeviceWaitIdle: Vulkan result -4`. - Green with the fix, same base and settings: all 23 (`agc_driver_(flat|global)_loads*`, `agc_driver_pixel_interlock`, `agc_driver_flat_apertures_0` to `_13`, `agc_driver_bda_device`, `agc_driver_bda_span_reads`) pass in 52.3 s at `-j 4`, the slowest in 18.6 s. - Full library, `ctest -R "^(agc_|shader_)" -j 4` with `ANYPS5_SHADER_CACHE_DIR` set to a new empty directory (most of these tests also set `ANYPS5_NO_SHADER_CACHE=1` themselves): - on 3e0e01f35: 444 of 444 pass (`agc_driver_stencil_ref_export` skipped), 199.6 s, slowest test 16.0 s (`agc_driver_prepared_shaders_debug_failure`). An earlier run of the same set failed `agc_driver_scalar_swappc_fetch` once (302.7 s, then a vertex value mismatch); it passed alone, in 8 of 8 repeats and in this rerun. - after rebasing onto 44ab0c39e: 443 of 444 pass, 270.4 s, slowest test 29.6 s (`agc_driver_swap_alt_blend`) while other jobs shared the GPU. `agc_driver_depth_storage_reuse` failed once with `vkWaitForFences graphics: Vulkan result 2` (`VK_TIMEOUT`) after 10.7 s; it passed 8 of 8 repeats alone. All 23 affected tests passed in this run. - Rebased onto `main` 42496c5e5 (one more AGC texture change, no shader change) and rechecked there: the 23 affected tests pass in 33.0 s at `-j 4` with `ANYPS5_NO_SHADER_CACHE=1`, the slowest in 21.4 s (`agc_driver_flat_apertures_8`). - Linux CI on `main` (lavapipe, run 38301611844 on 3e0e01f35) passes these tests without the change, so the hang does not reproduce on lavapipe and CI passes either way. This comes from CI, not from a run on this machine. - `python -I tools/check_conventions.py --base upstream/main`: passed. - Not tested with a title. ### Checklist - [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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Unblocks: none - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-12 21:07:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T21:07:37Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3655 core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp L182-199, L201-203
#3891 docs/dev/debt/shader.md L102
#4156 docs/dev/debt/shader.md L102
#4396 docs/dev/debt/shader.md L102
#4397 docs/dev/debt/shader.md L102
#4422 docs/dev/debt/shader.md L102
#4423 docs/dev/debt/shader.md L102
#4424 docs/dev/debt/shader.md L102
#4520 docs/dev/debt/shader.md L102
#4521 docs/dev/debt/shader.md L102
#4522 docs/dev/debt/shader.md L102
#4523 docs/dev/debt/shader.md L102
#4566 docs/dev/debt/shader.md L102
#4599 docs/dev/debt/shader.md L102
#4718 docs/dev/debt/shader.md L102
#4740 docs/dev/debt/shader.md L102
#4749 docs/dev/debt/shader.md L102
#4760 docs/dev/debt/shader.md L102
#4806 docs/dev/debt/shader.md L102
#4813 docs/dev/debt/shader.md L102
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132625953 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4759#issuecomment-6132625953). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T21:07:37Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3655 | `core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp` [L182-199](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp#L182-L199), [L201-203](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp#L201-L203) | | | | #3891 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4156 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4396 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4397 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4422 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4423 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4424 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4520 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4521 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4522 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4523 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4566 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4599 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4718 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4740 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4749 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4760 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4806 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | | | #4813 | `docs/dev/debt/shader.md` [L102](https://github.com/boykopovar/AnyPS5/blob/6124bf063f6348e4451ad0b9c67f82acec5bc1c2/docs/dev/debt/shader.md#L102) | | |
johnohhh1 commented 2026-10-12 23:12:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnohhh1 on 2026-10-12T23:12:29Z.


Tested this on an RTX 5070, Linux, NVIDIA 595.99.02. All 23 affected tests pass on both the baseline and with this PR applied, with zero skips or timeouts. The original hang does not reproduce on this GPU/driver combination, and I observed no regression from the patch in these tests.

  • Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, GCC 15.2.0, Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON.
  • Baseline: 43e3a70f8143f014f621c48abbdb137fffd7346e.
  • Patched: the same base plus f1b2e605e7597603f716abb3cc2924db5d5db8b3, applied without conflicts. The local patch ID matches the PR.
  • Tests: agc_driver_(flat|global)_loads*, agc_driver_pixel_interlock, agc_driver_flat_apertures_0–_13, agc_driver_bda_device, and agc_driver_bda_span_reads.
  • Serial execution, 30-second timeout, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, explicit RTX 5070 selection and NVIDIA Vulkan ICD. Logs confirm the selected GPU.

Each version completed one 23-test run. The slowest test was agc_driver_bda_device at about 8.1 seconds in both. NVIDIA's driver cache remained at its default; no performance claim. No game title or full graphics-suite testing.

This adds RTX 5070 / 595.99.02 coverage to the no-reproduction side of #3291. It does not independently confirm the fix for the original hang. Build settings, hashes, JUnit results and verbose logs were retained for both runs.

AI-assisted validation and report: Codex. Tested the existing PR patch.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134398215 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4759#issuecomment-6134398215). Originally posted by [johnohhh1](https://github.com/johnohhh1) on 2026-10-12T23:12:29Z. --- Tested this on an RTX 5070, Linux, NVIDIA 595.99.02. All 23 affected tests pass on both the baseline and with this PR applied, with zero skips or timeouts. The original hang does not reproduce on this GPU/driver combination, and I observed no regression from the patch in these tests. - Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, GCC 15.2.0, Release, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`. - Baseline: `43e3a70f8143f014f621c48abbdb137fffd7346e`. - Patched: the same base plus `f1b2e605e7597603f716abb3cc2924db5d5db8b3`, applied without conflicts. The local patch ID matches the PR. - Tests: `agc_driver_(flat|global)_loads*`, `agc_driver_pixel_interlock`, `agc_driver_flat_apertures_0`–`_13`, `agc_driver_bda_device`, and `agc_driver_bda_span_reads`. - Serial execution, 30-second timeout, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, explicit RTX 5070 selection and NVIDIA Vulkan ICD. Logs confirm the selected GPU. Each version completed one 23-test run. The slowest test was `agc_driver_bda_device` at about 8.1 seconds in both. NVIDIA's driver cache remained at its default; no performance claim. No game title or full graphics-suite testing. This adds RTX 5070 / 595.99.02 coverage to the no-reproduction side of #3291. It does not independently confirm the fix for the original hang. Build settings, hashes, JUnit results and verbose logs were retained for both runs. AI-assisted validation and report: Codex. Tested the existing PR patch.
kr4y4 commented 2026-10-13 06:41:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-13T06:41:38Z.


On an RTX 4070 Laptop GPU with NVIDIA 595.97, this change causes the hang it fixes on 591.86. agc_driver_bda_span_reads and agc_driver_pixel_interlock lose the device on main ea2bbefb2, and both pass with SpirvBdaRead.cpp as it was before this PR.

Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU (NVIDIA 595.97) and an Intel Raptor Lake-S iGPU (32.0.101.6790). I ran the 23 affected tests from the description with ANYPS5_NO_SHADER_CACHE=1, --repeat until-fail:3 and --parallel 4:

NVIDIA 595.97 Intel
main ea2bbefb2 agc_driver_bda_span_reads and agc_driver_pixel_interlock fail 23 of 23
main ea2bbefb2 with SpirvBdaRead.cpp from f1b2e605e^ 23 of 23, slowest 2.8 s 23 of 23
  • The failing runs print [gpu] recorded batch still running on the GPU after 5 s, then the same at 10, 15 and 20 s. After that they fail with vkWaitForFences recorder: Vulkan result -4 (span reads) and vkDeviceWaitIdle: Vulkan result -4 (pixel interlock). Windows logged an nvlddmkm event 153 at each failure, and the display reset. agc_driver_bda_device also failed in some of these runs, while the device was lost.
  • The same happened before the merge, with this branch merged into main 495bf91a0, in a full-suite run and in a rerun of the three tests. main 495bf91a0 itself passed all 1023 on both GPUs.
  • Each full-suite run that lost the device also had one guest_video_out_* test time out. On the Intel iGPU, the full suite on ea2bbefb2 passes 1038 of 1038.

So on 595.97 the split selections hang and the single selection doesn't, the reverse of 591.86. The description reports no regression with 616.92 on the same GPU model, so this depends on the driver version. I can run a candidate shape on 595.97 if that helps.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6139879773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4759#issuecomment-6139879773). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-13T06:41:38Z. --- On an RTX 4070 Laptop GPU with NVIDIA 595.97, this change causes the hang it fixes on 591.86. `agc_driver_bda_span_reads` and `agc_driver_pixel_interlock` lose the device on `main` ea2bbefb2, and both pass with `SpirvBdaRead.cpp` as it was before this PR. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU (NVIDIA 595.97) and an Intel Raptor Lake-S iGPU (32.0.101.6790). I ran the 23 affected tests from the description with `ANYPS5_NO_SHADER_CACHE=1`, `--repeat until-fail:3` and `--parallel 4`: | | NVIDIA 595.97 | Intel | |---|---|---| | `main` ea2bbefb2 | `agc_driver_bda_span_reads` and `agc_driver_pixel_interlock` fail | 23 of 23 | | `main` ea2bbefb2 with `SpirvBdaRead.cpp` from f1b2e605e^ | 23 of 23, slowest 2.8 s | 23 of 23 | - The failing runs print `[gpu] recorded batch still running on the GPU after 5 s`, then the same at 10, 15 and 20 s. After that they fail with `vkWaitForFences recorder: Vulkan result -4` (span reads) and `vkDeviceWaitIdle: Vulkan result -4` (pixel interlock). Windows logged an `nvlddmkm` event 153 at each failure, and the display reset. `agc_driver_bda_device` also failed in some of these runs, while the device was lost. - The same happened before the merge, with this branch merged into `main` 495bf91a0, in a full-suite run and in a rerun of the three tests. `main` 495bf91a0 itself passed all 1023 on both GPUs. - Each full-suite run that lost the device also had one `guest_video_out_*` test time out. On the Intel iGPU, the full suite on ea2bbefb2 passes 1038 of 1038. So on 595.97 the split selections hang and the single selection doesn't, the reverse of 591.86. The description reports no regression with 616.92 on the same GPU model, so this depends on the driver version. I can run a candidate shape on 595.97 if that helps. Written with AI assistance.
ps54all commented 2026-10-13 07:15:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-13T07:15:54Z.


Same result on an RTX 3080 (Ampere desktop, 0x2206), NVIDIA 610.74, Windows 11, WinLibs GCC 15.2.0 r7, Release. I bisected it in a clean main worktree, rebuilding only the two test targets between runs:

Tree agc_driver_bda_span_reads agc_driver_pixel_interlock
e51428bf2^1 (before this PR) pass pass
e51428bf2 (this PR merged) fail fail (vkDeviceWaitIdle: Vulkan result -4)
ea2bbefb2 (current main) fail fail

The failures are deterministic, both with and without APS5_NO_PIPELINE_LTO=1. agc_driver_depth_fast_clear and agc_driver_pixel_valid_mask pass in the same session. With this PR reverted on my integration branch (current main plus a few open PRs), all 26 bda/flat_/global_loads/pixel_interlock tests pass.

Amoenus's comment in #3291 shows the same two tests failing at e51428bf2 on an RTX 5080 with 610.62. Results by driver so far:

  • needs the split: 591.86 (Windows and Linux reports)
  • hangs with the split: 595.97 Windows (kr4y4), 610.62 and 610.74 Windows
  • passes either way: 595.99.02 Linux (johnohhh1), 616.92 (description)

I can run a candidate shape on 610.74.

AI-assisted (Claude Code); I ran the above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140373973 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4759#issuecomment-6140373973). Originally posted by [ps54all](https://github.com/ps54all) on 2026-10-13T07:15:54Z. --- Same result on an RTX 3080 (Ampere desktop, 0x2206), NVIDIA 610.74, Windows 11, WinLibs GCC 15.2.0 r7, Release. I bisected it in a clean `main` worktree, rebuilding only the two test targets between runs: | Tree | `agc_driver_bda_span_reads` | `agc_driver_pixel_interlock` | |---|---|---| | `e51428bf2^1` (before this PR) | pass | pass | | `e51428bf2` (this PR merged) | fail | fail (`vkDeviceWaitIdle: Vulkan result -4`) | | `ea2bbefb2` (current `main`) | fail | fail | The failures are deterministic, both with and without `APS5_NO_PIPELINE_LTO=1`. `agc_driver_depth_fast_clear` and `agc_driver_pixel_valid_mask` pass in the same session. With this PR reverted on my integration branch (current `main` plus a few open PRs), all 26 `bda`/`flat_`/`global_loads`/`pixel_interlock` tests pass. Amoenus's comment in #3291 shows the same two tests failing at `e51428bf2` on an RTX 5080 with 610.62. Results by driver so far: - needs the split: 591.86 (Windows and Linux reports) - hangs with the split: 595.97 Windows (kr4y4), 610.62 and 610.74 Windows - passes either way: 595.99.02 Linux (johnohhh1), 616.92 (description) I can run a candidate shape on 610.74. AI-assisted (Claude Code); I ran the above on my machine.
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!4759
No description provided.