fix(agc): write copied buffers back before reporting an unaligned BDA access #6373

Merged
AlxcBTW merged 7 commits from upstream-pr/6373 into main 2026-10-20 01:52:25 +00:00
AlxcBTW commented 2026-10-15 13:27:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T13:27:29Z.


What

Fixes to the deferred write-back of an unaligned BDA (buffer device address) access, found in Sword of the Sea (PPSA25344) cave gameplay.

  1. fix(agc): rate-limit the deferred report of an unaligned BDA access. About 1,500-2,000 deferred write-back failed: BDA access failed ... bytes=4 stage=4 reason=7 lines appear per cave row (unaligned 4-byte atomics at pc 0x5c8), each formatted on the queue worker. BdaResources::CheckFault throws BdaUnalignedAccess for that fault and the recorder prints the first 8 reports whole, then every 1024th with the running count. Every other deferred failure is printed each time.
  2. fix(agc): write copied buffers back before reporting an unaligned BDA access. ShaderResources::WriteBackBuffers() called CheckFault() before guestMemory.WriteBack(), so a dispatch that recorded an unaligned access lost the stores of all its other invocations, although the shader only skips that access. For that fault the write-back now happens first and the report follows.
  3. fix(agc): publish after an unaligned BDA access only when it is the only fault. The fault record keeps the first fault of a dispatch, so an early unaligned access could hide a later unmapped or permission fault. The shader now sets a sticky otherFaults flag (the former reserved word of the record) for every fault of another kind; an unaligned record with that flag set fails the command like any other fault and publishes nothing.
  4. fix(agc): write storage images back before reporting an unaligned BDA access. The synchronous ShaderResources::WriteBack() threw before marking the written storage images dirty; it now handles them first and rethrows, as the deferred path does.
  5. fix(agc): rate-limit the deferred unaligned BDA reports per instruction. The throttle counter is kept per program counter instead of process-wide, and the periodic line names the pc.

The root cause of the unaligned 4-byte atomics is still open; this PR does not fix it. It only stops the log flood and the lost stores.

Tested

Linux, lavapipe (llvmpipe), fork CI run 38943606573 on the PR head 69b683a90:

  • agc_|shader|recompiler|spirv|video_out: 632 of 633 pass. agc_driver_mesh_index_cache aborts with LLVM ERROR: Cannot emit physreg copy instruction (lavapipe shader compile) on the PR base 03c4cb5e7 (38950206046) and on the head before these fixes c0588d274 (38947969934), and passes on origin/main f26eb67c8 (38947975043); it is a stale-base failure, not caused by this PR.
  • New and extended tests: agc_recorder_deferred_failure_report (12 other failures print 12 lines, 12 unaligned reports at one pc print 8, the 1024th prints the count line with the pc, another pc prints its own first 8); a block in tests/BdaResources.cpp (an unaligned fault publishes the other stores and is reported; an unmapped fault, and an unaligned fault with another fault kind recorded, publish nothing); tests/BdaExecution.cpp runs a shader that records two faults in either order and checks the first reason is kept and the sticky flag is set only for a non-unaligned fault.
  • The storage-image ordering in the synchronous WriteBack() has no test: the mock device of the resource tests creates no images and no test drives a synchronous draw with a fault.
  • Earlier head, fork CI runs 38782396647 and 38785686515 on origin/main 03c4cb5e7; Windows 11, MinGW-w64 GCC 15.2: the libs compiled on that head (fork CI run 38782444478); ctest was not run on Windows, and the new commits were not built on Windows.
  • tools/check_conventions.py --base origin/main passes.
  • Linux and Windows with other titles: not tested. No game was run; the effect on the Sword of the Sea log and stores is reasoned from the code.

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
  • GPUs tested: llvmpipe (LLVM 20.1.2), Linux, lavapipe on GitHub-hosted runners (fork CI); the RTX 4080 (driver 617.42, Windows 11) run on the earlier head was reported by @Neithennn
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4874031612 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T13:27:29Z. --- ### What Fixes to the deferred write-back of an unaligned BDA (buffer device address) access, found in Sword of the Sea (PPSA25344) cave gameplay. 1. `fix(agc): rate-limit the deferred report of an unaligned BDA access`. About 1,500-2,000 `deferred write-back failed: BDA access failed ... bytes=4 stage=4 reason=7` lines appear per cave row (unaligned 4-byte atomics at pc `0x5c8`), each formatted on the queue worker. `BdaResources::CheckFault` throws `BdaUnalignedAccess` for that fault and the recorder prints the first 8 reports whole, then every 1024th with the running count. Every other deferred failure is printed each time. 2. `fix(agc): write copied buffers back before reporting an unaligned BDA access`. `ShaderResources::WriteBackBuffers()` called `CheckFault()` before `guestMemory.WriteBack()`, so a dispatch that recorded an unaligned access lost the stores of all its other invocations, although the shader only skips that access. For that fault the write-back now happens first and the report follows. 3. `fix(agc): publish after an unaligned BDA access only when it is the only fault`. The fault record keeps the first fault of a dispatch, so an early unaligned access could hide a later unmapped or permission fault. The shader now sets a sticky `otherFaults` flag (the former reserved word of the record) for every fault of another kind; an unaligned record with that flag set fails the command like any other fault and publishes nothing. 4. `fix(agc): write storage images back before reporting an unaligned BDA access`. The synchronous `ShaderResources::WriteBack()` threw before marking the written storage images dirty; it now handles them first and rethrows, as the deferred path does. 5. `fix(agc): rate-limit the deferred unaligned BDA reports per instruction`. The throttle counter is kept per program counter instead of process-wide, and the periodic line names the pc. The root cause of the unaligned 4-byte atomics is still open; this PR does not fix it. It only stops the log flood and the lost stores. ### Tested Linux, lavapipe (llvmpipe), fork CI run [38943606573](https://github.com/AlxcBTW/AnyPS5/actions/runs/38943606573) on the PR head `69b683a90`: - `agc_|shader|recompiler|spirv|video_out`: 632 of 633 pass. `agc_driver_mesh_index_cache` aborts with `LLVM ERROR: Cannot emit physreg copy instruction` (lavapipe shader compile) on the PR base `03c4cb5e7` ([38950206046](https://github.com/AlxcBTW/AnyPS5/actions/runs/38950206046)) and on the head before these fixes `c0588d274` ([38947969934](https://github.com/AlxcBTW/AnyPS5/actions/runs/38947969934)), and passes on `origin/main` `f26eb67c8` ([38947975043](https://github.com/AlxcBTW/AnyPS5/actions/runs/38947975043)); it is a stale-base failure, not caused by this PR. - New and extended tests: `agc_recorder_deferred_failure_report` (12 other failures print 12 lines, 12 unaligned reports at one pc print 8, the 1024th prints the count line with the pc, another pc prints its own first 8); a block in `tests/BdaResources.cpp` (an unaligned fault publishes the other stores and is reported; an unmapped fault, and an unaligned fault with another fault kind recorded, publish nothing); `tests/BdaExecution.cpp` runs a shader that records two faults in either order and checks the first reason is kept and the sticky flag is set only for a non-unaligned fault. - The storage-image ordering in the synchronous `WriteBack()` has no test: the mock device of the resource tests creates no images and no test drives a synchronous draw with a fault. - Earlier head, fork CI runs [38782396647](https://github.com/AlxcBTW/AnyPS5/actions/runs/38782396647) and [38785686515](https://github.com/AlxcBTW/AnyPS5/actions/runs/38785686515) on `origin/main` `03c4cb5e7`; Windows 11, MinGW-w64 GCC 15.2: the libs compiled on that head (fork CI run [38782444478](https://github.com/AlxcBTW/AnyPS5/actions/runs/38782444478)); `ctest` was not run on Windows, and the new commits were not built on Windows. - `tools/check_conventions.py --base origin/main` passes. - Linux and Windows with other titles: not tested. No game was run; the effect on the Sword of the Sea log and stores is reasoned from the code. ### 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 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] GPUs tested: llvmpipe (LLVM 20.1.2), Linux, lavapipe on GitHub-hosted runners (fork CI); the RTX 4080 (driver 617.42, Windows 11) run on the earlier head was reported by @Neithennn - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-15 13:33:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T13:33:23Z.


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
PR 6785 core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp L247
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L5488-5493

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4072 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 4448 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6197 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6249 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6611 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6628 core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6661 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6682 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6718 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6759 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6820 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/BdaAbi.hpp
PR 6951 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6972 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7292 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7392 core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7533 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/shader/recompiler/BdaAbi.hpp
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7849 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7862 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7933 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193327482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373#issuecomment-6193327482). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T13:33:23Z. --- <!-- 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 | |---|---|---|---| | [PR 6785](https://www.github.com/boykopovar/AnyPS5/pull/6785) | `core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp` [L247](https://github.com/boykopovar/AnyPS5/blob/b50976750daa2d014460530132e63b682fd04cf4/core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp#L247) | | | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L5488-5493](https://github.com/boykopovar/AnyPS5/blob/b50976750daa2d014460530132e63b682fd04cf4/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L5488-L5493) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 4472](https://www.github.com/boykopovar/AnyPS5/pull/4472) | `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6249](https://www.github.com/boykopovar/AnyPS5/pull/6249) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6340](https://www.github.com/boykopovar/AnyPS5/pull/6340) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6611](https://www.github.com/boykopovar/AnyPS5/pull/6611) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6628](https://www.github.com/boykopovar/AnyPS5/pull/6628) | `core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6661](https://www.github.com/boykopovar/AnyPS5/pull/6661) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`core/shader/recompiler/BdaAbi.hpp` | | [PR 6951](https://www.github.com/boykopovar/AnyPS5/pull/6951) | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6971](https://www.github.com/boykopovar/AnyPS5/pull/6971) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7292](https://www.github.com/boykopovar/AnyPS5/pull/7292) | `core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7392](https://www.github.com/boykopovar/AnyPS5/pull/7392) | `core/shader/recompiler/SpirvBackend/src/SpirvBdaFault.cpp` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7446](https://www.github.com/boykopovar/AnyPS5/pull/7446) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7457](https://www.github.com/boykopovar/AnyPS5/pull/7457) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7533](https://www.github.com/boykopovar/AnyPS5/pull/7533) | `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/BdaResources.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp`<br>`core/shader/recompiler/BdaAbi.hpp` | | [PR 7677](https://www.github.com/boykopovar/AnyPS5/pull/7677) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7689](https://www.github.com/boykopovar/AnyPS5/pull/7689) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7849](https://www.github.com/boykopovar/AnyPS5/pull/7849) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` | | [PR 7862](https://www.github.com/boykopovar/AnyPS5/pull/7862) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7933](https://www.github.com/boykopovar/AnyPS5/pull/7933) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
Neithennn commented 2026-10-15 15:30:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T15:30:37Z.


Windows NVIDIA run, since ctest was not run for this PR: three existing tests fail with it and pass on main.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1. Head eca2078ab merged onto main ff23657f3; full build succeeds.

Test This PR (5 serial runs) Unchanged main ff23657f3 (5 serial runs, clean rebuild) Message with this PR
agc_driver_graphics 0/5 pass 5/5 pass guest memory cannot be committed twice or before upload
agc_driver_image_table 0/5 pass 5/5 pass image table border BC4 table T#/direct S# did not report its entry rejection
agc_driver_multisample_fill_host_only 1/5 pass 5/5 pass the sentinel fill did not land
  • agc_driver_bda_device, agc_driver_bda_span_reads, agc_driver_storage_write_back_overhang: pass.
  • ctest -R "agc_|shader|recompiler|spirv|video_out" -j 8: 619/623; the fourth failure is agc_driver_store_over_untracked (#6347/#6383), also on main.

I have not established which of the two commits causes each failure. The WriteBackBuffers change now calls guestMemory.WriteBack() before rethrowing a BDA fault, and the first message is about committing guest memory, but that link is not verified.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195830046 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373#issuecomment-6195830046). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T15:30:37Z. --- Windows NVIDIA run, since `ctest` was not run for this PR: three existing tests fail with it and pass on main. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1`. Head `eca2078ab` merged onto main `ff23657f3`; full build succeeds. | Test | This PR (5 serial runs) | Unchanged main `ff23657f3` (5 serial runs, clean rebuild) | Message with this PR | |---|---|---|---| | `agc_driver_graphics` | 0/5 pass | 5/5 pass | `guest memory cannot be committed twice or before upload` | | `agc_driver_image_table` | 0/5 pass | 5/5 pass | `image table border BC4 table T#/direct S# did not report its entry rejection` | | `agc_driver_multisample_fill_host_only` | 1/5 pass | 5/5 pass | `the sentinel fill did not land` | - `agc_driver_bda_device`, `agc_driver_bda_span_reads`, `agc_driver_storage_write_back_overhang`: pass. - `ctest -R "agc_|shader|recompiler|spirv|video_out" -j 8`: 619/623; the fourth failure is `agc_driver_store_over_untracked` (#6347/#6383), also on main. I have not established which of the two commits causes each failure. The `WriteBackBuffers` change now calls `guestMemory.WriteBack()` before rethrowing a BDA fault, and the first message is about committing guest memory, but that link is not verified. AI-assisted: yes (runs done with Claude Code).
AlxcBTW commented 2026-10-15 18:37:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-15T18:37:32Z.


@Neithennn thanks for the run.
Cause of each failure, from the code and from fork CI runs on Linux (lavapipe) of main, of each commit alone and of the head:

  • agc_driver_graphics, guest memory cannot be committed twice or before upload: the second commit.
    tests/BdaResources.cpp asserts that a use with a recorded fault fails before anything is published
    (failed GPU command published writes), and one block sets an InvalidRectangle record, expects WriteBack() to
    throw, clears the record and calls WriteBack() again. With the second commit the first call has already committed
    the guest memory before it rethrows, so the second call stops in GuestBufferMemory::WriteBack. The second commit
    alone fails the test; the first commit alone and main pass.
  • agc_driver_image_table, image table border BC4 table T#/direct S# did not report its entry rejection: the first
    commit. The test captures stderr per dispatch and looks for the image table: line of each rejected entry. The rate
    limit counts every deferred failure of the process and prints the first 8: the first part of the test produces 5, the
    BC0 round of the border test 3, so the first rejection of the BC4 round is the 9th and prints nothing. The first
    commit alone fails the test; the second commit alone and main pass.
  • agc_driver_multisample_fill_host_only, the sentinel fill did not land: not tied to either commit. The test submits
    only the compute fill kernel, which the driver takes as a buffer fill (Driver::fillBuffer, VulkanDevice::FillBuffer).
    It builds no ShaderResources and registers no recorder completion, which are the only places the commits change. An
    instrumented build of the head (one line in Recorder::finish when a batch has completions, one in
    WriteBackBuffers) printed neither line during this test and printed both during agc_driver_bda_span_reads, used as
    a control. The test passed 20 of 20 on lavapipe for main, each commit alone, the head and the changed commits. I could
    not reproduce the 1/5 and have no explanation for it. The full output of a failing run
    (ctest -R agc_driver_multisample_fill_host_only --output-on-failure) would show whether a [gpu] line precedes it.

Changes, two commits on origin/main 03c4cb5e7:

  1. fix(agc): rate-limit the deferred report of an unaligned BDA access. The limit now covers only the fault that
    flooded in PPSA25344, the unaligned access (reason 7). BdaResources::CheckFault throws a BdaUnalignedAccess for
    it and Recorder::finish rate-limits that type; every other deferred failure is printed each time, as on main. New
    test agc_recorder_deferred_failure_report: 12 other failures print 12 lines, 12 unaligned reports print 8, and the
    1024th prints the count line.
  2. fix(agc): write copied buffers back before reporting an unaligned BDA access. The write-back before the report is
    limited to the same fault: the shader skips an unaligned access and the other invocations are unaffected. Every other
    fault still throws before anything is published, which the existing assertions in tests/BdaResources.cpp require
    and which are unchanged. New block there: an unaligned fault publishes the other stores and is reported as
    BdaUnalignedAccess; an unmapped fault publishes nothing.

Run on Linux with lavapipe (llvmpipe, LLVM 20.1.2), fork CI:

Windows, MinGW-w64 GCC 15.2: the libs target of the changed commits compiles (https://github.com/AlxcBTW/AnyPS5/actions/runs/38782444478); the tests are built
on Linux only. tools/check_conventions.py --base origin/main passes.

Not run: ctest on Windows with an NVIDIA GPU, so the three failures are not re-checked on the machine that reported
them, and no game was run, so the effect on the Sword of the Sea log and stores is reasoned from the code. To check on
your side: ctest -R "agc_driver_graphics$|agc_driver_image_table$|agc_driver_multisample_fill_host_only$|agc_driver_bda|agc_recorder_deferred_failure_report" --output-on-failure.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6199518701 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373#issuecomment-6199518701). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-15T18:37:32Z. --- @Neithennn thanks for the run. Cause of each failure, from the code and from fork CI runs on Linux (lavapipe) of main, of each commit alone and of the head: - `agc_driver_graphics`, `guest memory cannot be committed twice or before upload`: the second commit. `tests/BdaResources.cpp` asserts that a use with a recorded fault fails before anything is published (`failed GPU command published writes`), and one block sets an `InvalidRectangle` record, expects `WriteBack()` to throw, clears the record and calls `WriteBack()` again. With the second commit the first call has already committed the guest memory before it rethrows, so the second call stops in `GuestBufferMemory::WriteBack`. The second commit alone fails the test; the first commit alone and main pass. - `agc_driver_image_table`, `image table border BC4 table T#/direct S# did not report its entry rejection`: the first commit. The test captures stderr per dispatch and looks for the `image table:` line of each rejected entry. The rate limit counts every deferred failure of the process and prints the first 8: the first part of the test produces 5, the BC0 round of the border test 3, so the first rejection of the BC4 round is the 9th and prints nothing. The first commit alone fails the test; the second commit alone and main pass. - `agc_driver_multisample_fill_host_only`, `the sentinel fill did not land`: not tied to either commit. The test submits only the compute fill kernel, which the driver takes as a buffer fill (`Driver::fillBuffer`, `VulkanDevice::FillBuffer`). It builds no `ShaderResources` and registers no recorder completion, which are the only places the commits change. An instrumented build of the head (one line in `Recorder::finish` when a batch has completions, one in `WriteBackBuffers`) printed neither line during this test and printed both during `agc_driver_bda_span_reads`, used as a control. The test passed 20 of 20 on lavapipe for main, each commit alone, the head and the changed commits. I could not reproduce the 1/5 and have no explanation for it. The full output of a failing run (`ctest -R agc_driver_multisample_fill_host_only --output-on-failure`) would show whether a `[gpu]` line precedes it. Changes, two commits on `origin/main` `03c4cb5e7`: 1. `fix(agc): rate-limit the deferred report of an unaligned BDA access`. The limit now covers only the fault that flooded in PPSA25344, the unaligned access (reason 7). `BdaResources::CheckFault` throws a `BdaUnalignedAccess` for it and `Recorder::finish` rate-limits that type; every other deferred failure is printed each time, as on main. New test `agc_recorder_deferred_failure_report`: 12 other failures print 12 lines, 12 unaligned reports print 8, and the 1024th prints the count line. 2. `fix(agc): write copied buffers back before reporting an unaligned BDA access`. The write-back before the report is limited to the same fault: the shader skips an unaligned access and the other invocations are unaffected. Every other fault still throws before anything is published, which the existing assertions in `tests/BdaResources.cpp` require and which are unchanged. New block there: an unaligned fault publishes the other stores and is reported as `BdaUnalignedAccess`; an unmapped fault publishes nothing. Run on Linux with lavapipe (llvmpipe, LLVM 20.1.2), fork CI: - head as reviewed, https://github.com/AlxcBTW/AnyPS5/actions/runs/38780486017: `agc_driver_graphics` and `agc_driver_image_table` fail with the messages above; `agc_driver_bda_device`, `agc_driver_bda_span_reads`, `agc_driver_multisample_fill_host_only` and `agc_driver_store_over_untracked` pass. - first commit alone, https://github.com/AlxcBTW/AnyPS5/actions/runs/38780512528: `agc_driver_image_table` fails, the rest passes. - second commit alone, https://github.com/AlxcBTW/AnyPS5/actions/runs/38780537952: `agc_driver_graphics` fails, the rest passes. - main, https://github.com/AlxcBTW/AnyPS5/actions/runs/38780562165: all pass. - changed commits, https://github.com/AlxcBTW/AnyPS5/actions/runs/38782396647: `agc_driver_graphics`, `agc_driver_image_table`, `agc_driver_multisample_fill_host_only` (also 20 of 20 repeated), `agc_driver_bda_device`, `agc_driver_bda_span_reads`, `agc_driver_store_over_untracked` and `agc_recorder_deferred_failure_report` pass. - changed commits, `agc_|shader|recompiler|spirv|video_out`, https://github.com/AlxcBTW/AnyPS5/actions/runs/38785686515: 632 of 633 pass; `agc_driver_mesh_index_cache` aborts, as it does on main (https://github.com/AlxcBTW/AnyPS5/actions/runs/38785707388, 631 of 632). Windows, MinGW-w64 GCC 15.2: the libs target of the changed commits compiles (https://github.com/AlxcBTW/AnyPS5/actions/runs/38782444478); the tests are built on Linux only. `tools/check_conventions.py --base origin/main` passes. Not run: ctest on Windows with an NVIDIA GPU, so the three failures are not re-checked on the machine that reported them, and no game was run, so the effect on the Sword of the Sea log and stores is reasoned from the code. To check on your side: `ctest -R "agc_driver_graphics$|agc_driver_image_table$|agc_driver_multisample_fill_host_only$|agc_driver_bda|agc_recorder_deferred_failure_report" --output-on-failure`.
Neithennn commented 2026-10-15 21:07:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T21:07:27Z.


@AlxcBTW Thanks for the breakdown. Windows rerun of the new head c0588d274: all three are gone.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), WinLibs GCC 15.2.0 r7, Release, ANYPS5_NO_SHADER_CACHE=1. Current main ce991f1ec does not build on Windows here (GpuIndirectArgumentsMisalignedWriterAhead.cpp:25: requested alignment '65536' exceeds object file maximum 8192), so the base is main + #6452 (4fe92c9c2), with this head merged on top.

  • agc_driver_graphics: passes (targeted, full suite and 3 serial runs).
  • agc_driver_image_table, agc_driver_bda_device, agc_driver_bda_span_reads, the new agc_recorder_deferred_failure_report: pass.
  • agc_driver_multisample_fill_host_only: passes (targeted, full suite and 5 serial runs).
  • Full ctest -j 8: 1298/1299; the failure is guest_kqueue (0xc0000409, #6173), which also fails on the base alone.

On agc_driver_multisample_fill_host_only: I captured a failing run later, on a different tree (the same base + #6184 + Tamalero's 5bce3de8a, where it failed 3 of 10 serial runs; the base alone passed 20/20). No [gpu] line precedes the failure: the output has only the two Vulkan device initialisations, each followed by the [write-watch] host imports of write-watched memory keep the write watch: yes (...) probe line, then AGC graphics: the sentinel fill did not land. So it does not look tied to your commits.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202295327 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373#issuecomment-6202295327). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T21:07:27Z. --- @AlxcBTW Thanks for the breakdown. Windows rerun of the new head `c0588d274`: all three are gone. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), WinLibs GCC 15.2.0 r7, Release, `ANYPS5_NO_SHADER_CACHE=1`. Current main `ce991f1ec` does not build on Windows here (`GpuIndirectArgumentsMisalignedWriterAhead.cpp:25: requested alignment '65536' exceeds object file maximum 8192`), so the base is main + #6452 (`4fe92c9c2`), with this head merged on top. - `agc_driver_graphics`: passes (targeted, full suite and 3 serial runs). - `agc_driver_image_table`, `agc_driver_bda_device`, `agc_driver_bda_span_reads`, the new `agc_recorder_deferred_failure_report`: pass. - `agc_driver_multisample_fill_host_only`: passes (targeted, full suite and 5 serial runs). - Full `ctest -j 8`: 1298/1299; the failure is `guest_kqueue` (`0xc0000409`, #6173), which also fails on the base alone. On `agc_driver_multisample_fill_host_only`: I captured a failing run later, on a different tree (the same base + #6184 + Tamalero's 5bce3de8a, where it failed 3 of 10 serial runs; the base alone passed 20/20). No `[gpu]` line precedes the failure: the output has only the two Vulkan device initialisations, each followed by the `[write-watch] host imports of write-watched memory keep the write watch: yes (...)` probe line, then `AGC graphics: the sentinel fill did not land`. So it does not look tied to your commits. AI-assisted: yes (runs done with Claude Code).
DavidAmsellem commented 2026-10-19 18:23:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T18:23:53Z.


First AMD-on-Linux (RADV) run of this PR. Merged onto main 8d5d4df96 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8) at 4668d6893: 1639/1641 with this PR, against 1638/1640 on main. The two failures are the same on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784).

The PR's new ctest entry, agc_recorder_deferred_failure_report, runs and passes here. No other ctest entry is added, skipped or removed compared with main.

This checks correctness only; I did not measure performance.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6274235506 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6373#issuecomment-6274235506). Originally posted by [DavidAmsellem](https://github.com/DavidAmsellem) on 2026-10-19T18:23:53Z. --- First AMD-on-Linux (RADV) run of this PR. Merged onto `main` `8d5d4df96` (clean merge), built in full and compared with the same `main`, on the same machine. AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite (`ANYPS5_REQUIRE_VULKAN=1 ctest -j8`) at `4668d6893`: **1639/1641 with this PR**, against 1638/1640 on `main`. The two failures are the same on both, so this PR adds none: `agc_driver_image_table_vouched_lookups` (#7766, fixed by #7916) and `agc_driver_guest_memory_lifetime` (#7784). The PR's new ctest entry, `agc_recorder_deferred_failure_report`, runs and passes here. No other ctest entry is added, skipped or removed compared with `main`. This checks correctness only; I did not measure performance. GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 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!6373
No description provided.