fix(agc): COPY_DATA to and from GDS #6549

Merged
notaxeltv merged 3 commits from upstream-pr/6549 into main 2026-11-08 13:58:27 +00:00
notaxeltv commented 2026-10-15 20:01:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by notaxeltv on 2026-10-15T20:01:29Z.


What

COPY_DATA rejected SRC_SEL/DST_SEL 3 (AMD: GDS). The same host GDS buffer DMA_DATA already uses (GdsAddress, 64 KiB) now serves those selects: validate the offset range, execute the copy, and keep stores into GDS out of ResolveStore/DecodeStores like DMA.

PPSA03541 copies a dword from GDS offset 0x20 into guest memory, runs compute, then clears that offset with an immediate. Previously aborted on GDS destination not implemented.

Tested

Windows 10, WinLibs GCC 15.2.0. agc_driver_pm4 passes. tools/check_conventions.py --base upstream/main passes. PPSA03541 (hardlinked Engine modules): past COPY_DATA GDS and HDR present; next stop is MSAA_ENABLE on a single-sample target for primitives other than triangles (register 0x242 = 7, rect list).

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 (none)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA03541 #3123
  • GPUs tested: n/a (CP copy path; no shader/GPU change)
  • AI-assisted: yes

Made with Cursor

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4879101679 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549). Originally posted by [notaxeltv](https://github.com/notaxeltv) on 2026-10-15T20:01:29Z. --- ### What `COPY_DATA` rejected SRC_SEL/DST_SEL 3 (AMD: GDS). The same host GDS buffer DMA_DATA already uses (GdsAddress, 64 KiB) now serves those selects: validate the offset range, execute the copy, and keep stores into GDS out of ResolveStore/DecodeStores like DMA. PPSA03541 copies a dword from GDS offset 0x20 into guest memory, runs compute, then clears that offset with an immediate. Previously aborted on GDS destination not implemented. ### Tested Windows 10, WinLibs GCC 15.2.0. agc_driver_pm4 passes. tools/check_conventions.py --base upstream/main passes. PPSA03541 (hardlinked Engine modules): past COPY_DATA GDS and HDR present; next stop is MSAA_ENABLE on a single-sample target for primitives other than triangles (register 0x242 = 7, rect list). ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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 (none) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA03541 #3123 - [x] GPUs tested: n/a (CP copy path; no shader/GPU change) - [x] AI-assisted: yes Made with [Cursor](https://cursor.com)
coltken95 commented 2026-10-15 21:43:07 +00:00 (Migrated from github.com)

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


Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with be68cb5a6 merged into main 31cbb55d7:

  • With the PR: agc_driver_pm4, agc_driver_pm4_failure, agc_driver_pm4_failure_inline and agc_driver_pm4_priority_refused pass.
  • With main's sources: agc_driver_pm4 fails with COPY_DATA to GDS resolved as a memory store.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202897075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#issuecomment-6202897075). Originally posted by [coltken95](https://github.com/coltken95) on 2026-10-15T21:43:07Z. --- Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with be68cb5a6 merged into main 31cbb55d7: - With the PR: `agc_driver_pm4`, `agc_driver_pm4_failure`, `agc_driver_pm4_failure_inline` and `agc_driver_pm4_priority_refused` pass. - With main's sources: `agc_driver_pm4` fails with `COPY_DATA to GDS resolved as a memory store`. AI-assisted: yes (Claude Code)
klosixgaming-arch commented 2026-10-17 18:47:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-17T18:47:26Z.


Tested on PPSA03541 (EA SPORTS UFC 5, content version 01.031.000): Windows 11, RTX 5090, NVIDIA 617.42, WinLibs GCC 15.2.0. I applied the source changes of this PR (Pm4.hpp and Pm4.cpp, without the test, tool and docs changes) to main 66702f1cff. Without it the title aborts about 20 s in with "COPY_DATA at DWORD 71: COPY_DATA GDS or performance-counter destination is not implemented"; with it that abort is gone and the next stop is the MSAA_ENABLE rect list (#6563), as you predicted. With #6563 and #6572 on top the title reaches the logos and the main menu at about 34 fps. Full results are in #7239.

AI-assisted: yes. Written with AI assistance and reviewed by me.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6238877632 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#issuecomment-6238877632). Originally posted by [klosixgaming-arch](https://github.com/klosixgaming-arch) on 2026-10-17T18:47:26Z. --- Tested on PPSA03541 (EA SPORTS UFC 5, content version 01.031.000): Windows 11, RTX 5090, NVIDIA 617.42, WinLibs GCC 15.2.0. I applied the source changes of this PR (Pm4.hpp and Pm4.cpp, without the test, tool and docs changes) to main 66702f1cff. Without it the title aborts about 20 s in with "COPY_DATA at DWORD 71: COPY_DATA GDS or performance-counter destination is not implemented"; with it that abort is gone and the next stop is the MSAA_ENABLE rect list (#6563), as you predicted. With #6563 and #6572 on top the title reaches the logos and the main menu at about 34 fps. Full results are in #7239. AI-assisted: yes. Written with AI assistance and reviewed by me.
Neithennn commented 2026-10-17 19:39:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-17T19:39:00Z.


Windows NVIDIA run, since the description lists agc_driver_pm4 only.

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 eea461ae3 merged onto main f51724078; full build succeeds.

  • agc_driver_pm4 and the other agc_driver_pm4_* tests (ring, failure, replay, stall watchdog), agc_driver_gds_append_consume: 16/16 pass, with ANYPS5_REQUIRE_VULKAN=1.
  • Full ctest -j 8: 1398/1398. Unchanged main on the same machine: 1398/1398.

No title run.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239753474 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#issuecomment-6239753474). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-17T19:39:00Z. --- Windows NVIDIA run, since the description lists `agc_driver_pm4` only. 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 `eea461ae3` merged onto main `f51724078`; full build succeeds. - `agc_driver_pm4` and the other `agc_driver_pm4_*` tests (ring, failure, replay, stall watchdog), `agc_driver_gds_append_consume`: 16/16 pass, with `ANYPS5_REQUIRE_VULKAN=1`. - Full `ctest -j 8`: 1398/1398. Unchanged main on the same machine: 1398/1398. No title run. AI-assisted: yes (runs done with Claude Code).
janzezno commented 2026-10-20 21:25:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T21:25:14Z.


Linux run on AMD; the Tested section covers Windows only.

Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release, BUILD_TESTING=ON.
main ca74ef217; PR head 7c9dd449f applied on top.

  • ctest --test-dir build -R '^agc_driver_pm4.*$' --repeat until-fail:3: 15 of 15 pass, 3 repeats, as on main. These tests do not open a Vulkan device.
  • Full suite, ctest -j12: no new failures. The three that fail also fail on main on this machine: agc_driver_guest_memory_lifetime (#7849), agc_driver_image_array_window_past_layer_limit (#8361) and agc_driver_tessellation (Mesa, #5444).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6301820599 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#issuecomment-6301820599). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-20T21:25:14Z. --- Linux run on AMD; the Tested section covers Windows only. Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release, `BUILD_TESTING=ON`. `main` `ca74ef217`; PR head `7c9dd449f` applied on top. - `ctest --test-dir build -R '^agc_driver_pm4.*$' --repeat until-fail:3`: 15 of 15 pass, 3 repeats, as on `main`. These tests do not open a Vulkan device. - Full suite, `ctest -j12`: no new failures. The three that fail also fail on `main` on this machine: `agc_driver_guest_memory_lifetime` (#7849), `agc_driver_image_array_window_past_layer_limit` (#8361) and `agc_driver_tessellation` (Mesa, #5444).
BunnyFl commented 2026-11-02 21:28:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-02T21:28:46Z.

Review: DISMISSED


The GDS select is right: select 3 is GDS for both SRC_SEL and DST_SEL (Mesa's sid.h defines COPY_DATA_GDS as 3 for both). CopyDataSource's (sel << 1) | bit 30 gives your CopyDataSelectGds (6) for select 3, and gdsRange can't overflow (it checks offset <= GdsBytes before GdsBytes - offset). Two things need changing, though.

  1. It doesn't build on current main. On Windows 11, WinLibs GCC 15.2.0, with this head merged onto main, core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:657 fails with conflicting declaration 'const auto gdsStore'. main's 6ab3606963 (2026-10-21) added its own const auto gdsStore in the same test function (tests/Pm4.cpp:641 on main). The merge has no textual conflict, and GitHub lists the PR as mergeable. Renaming yours (e.g. copyGdsStore) fixes the build.

  2. The "keep stores into GDS out of ResolveStore/DecodeStores like DMA" premise now holds only for DecodeStores. main still drops DMA_DATA GDS destinations there (Execution/src/Pm4.cpp:780), but since 6ab3606963 ResolveStore resolves a DMA_DATA GDS destination to GdsAddress() plus the offset (Execution/src/Pm4.cpp:702 on main), so the store goes through WriteLabelOnGpu instead of draining the device, per that commit's message. With this PR, a COPY_DATA into GDS still returns std::nullopt there. Could it resolve the same way? Then both GDS writers would take the same path. The same commit's message notes that "every packet that reads the GDS on the CPU drains the pipeline first". Please check that COPY_DATA from GDS, which reads the GDS block on the CPU in copyDataSource, also drains first, or a GPU-queued DMA_DATA fill of the GDS could still be in flight when it reads.

I haven't run PPSA03541; the above comes from the merged build and main's source.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743612255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#pullrequestreview-5743612255). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-11-02T21:28:46Z. **Review:** DISMISSED --- The GDS select is right: select 3 is GDS for both `SRC_SEL` and `DST_SEL` (Mesa's [`sid.h`](https://gitlab.freedesktop.org/mesa/mesa/-/blob/mesa-25.2.0/src/amd/common/sid.h#L129-L142) defines `COPY_DATA_GDS` as 3 for both). `CopyDataSource`'s `(sel << 1) | bit 30` gives your `CopyDataSelectGds` (6) for select 3, and `gdsRange` can't overflow (it checks `offset <= GdsBytes` before `GdsBytes - offset`). Two things need changing, though. 1. **It doesn't build on current `main`.** On Windows 11, WinLibs GCC 15.2.0, with this head merged onto `main`, `core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:657` fails with `conflicting declaration 'const auto gdsStore'`. `main`'s 6ab3606963 (2026-10-21) added its own `const auto gdsStore` in the same test function (`tests/Pm4.cpp:641` on `main`). The merge has no textual conflict, and GitHub lists the PR as mergeable. Renaming yours (e.g. `copyGdsStore`) fixes the build. 2. **The "keep stores into GDS out of ResolveStore/DecodeStores like DMA" premise now holds only for `DecodeStores`.** `main` still drops `DMA_DATA` GDS destinations there (`Execution/src/Pm4.cpp:780`), but since 6ab3606963 `ResolveStore` resolves a `DMA_DATA` GDS destination to `GdsAddress()` plus the offset (`Execution/src/Pm4.cpp:702` on `main`), so the store goes through `WriteLabelOnGpu` instead of draining the device, per that commit's message. With this PR, a `COPY_DATA` into GDS still returns `std::nullopt` there. Could it resolve the same way? Then both GDS writers would take the same path. The same commit's message notes that "every packet that reads the GDS on the CPU drains the pipeline first". Please check that `COPY_DATA` *from* GDS, which reads the GDS block on the CPU in `copyDataSource`, also drains first, or a GPU-queued `DMA_DATA` fill of the GDS could still be in flight when it reads. I haven't run PPSA03541; the above comes from the merged build and `main`'s source.
XairRrR commented 2026-11-02 22:14:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T22:14:44Z.

Review: DISMISSED


Reviewed — changes requested

The merged tree does not build: tests/Pm4.cpp declares gdsStore twice in the same function. With that one name changed locally, the GDS select works, agc_driver_pm4 passes, and the test fails as it should when main's production code is put back.

What I ran

Head c74b9dc01c5b9d40e9ff961fae6be8b682580910, merged with --no-ff into main 9090972b7e91fd266819cbd77a8b058e177b5682 (merged tree 23853b2392a64ad8c3bce2e2d65e237edbbb6bdf). Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6).

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...c74b9dc01c5b9d40e9ff961fae6be8b682580910
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
# local fix only: rename gdsStore -> copyGdsStore at tests/Pm4.cpp:594-595
ninja -C build agc_driver_pm4_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_pm4$'
# negative control: Execution/include/Pm4.hpp and Execution/src/Pm4.cpp from main
ninja -C build agc_driver_pm4_tests
ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_pm4$'
# restored all three files from the merged tree, rebuilt libSceAgcDriver, git status --porcelain (clean)

Results

Check Result
git diff --check clean
check_conventions.py passed
Build of the merged tree failed: tests/Pm4.cpp:657: conflicting declaration 'const auto gdsStore'
agc_driver_pm4 with the local rename passed (0.17 s)
Negative control (main's production files, renamed test) failed as expected
Vulkan validation comparison not run (the build failed, so no test ran)
Build error
../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp: In function 'void {anonymous}::testCopies()':
../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:657:16: error: conflicting declaration 'const auto gdsStore'
  657 |     const auto gdsStore = AgcDriver::Pm4::ResolveStore(toGds, state, 64);
../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:594:16: note: previous declaration as 'const std::optional<AgcDriver::Pm4::StoreWrite> gdsStore'
  594 |     const auto gdsStore = AgcDriver::Pm4::ResolveStore(copyFromGds, state, 64);
Negative control output
1/1 Test #1587: agc_driver_pm4 ...................***Failed    0.02 sec
COPY_DATA to GDS resolved as a memory store

Negative control

I restored Execution/include/Pm4.hpp and Execution/src/Pm4.cpp from main and kept the PR's test, with only the local rename so it compiles. agc_driver_pm4 failed with COPY_DATA to GDS resolved as a memory store, so the test covers the change. Afterwards I restored the merged files and rebuilt. git status --porcelain showed a clean worktree.

Findings

Blocking

  1. The merged tree does not build (core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:594, conflicting with :657). This confirms BunnyFl's first point, on Linux with GCC 14.2.0 as well. main already declares const auto gdsStore for the DMA_DATA GDS check later in testCopies(). Renaming the PR's variable at lines 594-595 (for example to copyGdsStore) is the only change needed: with it, the test builds and passes here.

Non-blocking

  1. COPY_DATA into GDS still never resolves as a store, while DMA_DATA into GDS now does (core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:696 against :706). This adds detail to BunnyFl's second point. In Driver/Packets/PacketMemory.cpp:175-184, only opcode 0x50 gets the gdsDestination / gdsWritesPending / GdsImportable handling. A COPY_DATA to GDS returns std::nullopt from ResolveStore, so it always drains and writes on the CPU. That is still correctly ordered, but slower, and it no longer matches the description's "like DMA". A fix: resolve it as GdsAddress() + packet[4] the way DMA_DATA does, and apply the same gdsDestination checks to opcode 0x40. Alternatively, update the description and the debt entry to say that COPY_DATA into GDS always drains.
  2. On the read-ordering question. COPY_DATA from GDS reads through copySource, which uses GuestMemory::Read (Execution/src/Pm4.cpp:214, :152-160). This is the same checked path that DMA_DATA GDS sources use (:170), and opcode 0x40 is not in keepsDrawPipeline, so the draw pipeline drains before the packet. From reading the code, that answers BunnyFl's concern about reading GDS on the CPU behind a queued DMA_DATA fill. I did not exercise it on a GPU device.
  3. The test still expects the unimplemented performance-counter destination to throw (core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:588). oneandonlydean already asked for this expectFailure on 0x405 to be removed, and it is still there at this head.
  4. The Fixes: checklist line is missing, as fogydes noted. Add Fixes: none.

Not verified

  • The Vulkan validation-layer comparison with main: build.json skipped it because no test ran. The changed code is a CP copy path with no shader or pipeline change.
  • The other agc_driver_pm4_* tests and agc_driver_gds_append_consume: I only rebuilt and ran agc_driver_pm4.
  • PPSA03541 and any title run. Others already reported the title getting past this stop.
  • Whether select 3 names the same GDS aperture on the PS5 (the open question in the debt entry).

To get this to a good state

  • Rename the gdsStore declared at tests/Pm4.cpp:594, rebase onto current main, and confirm the merged tree builds.
  • Remove the performance-counter expectFailure, as requested before.
  • Either send COPY_DATA into GDS through the same store-resolution path as DMA_DATA, or update the description and debt entry to say it always drains.
  • Add the Fixes: line to the checklist.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744159603 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#pullrequestreview-5744159603). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T22:14:44Z. **Review:** DISMISSED --- # Reviewed — changes requested The merged tree does not build: `tests/Pm4.cpp` declares `gdsStore` twice in the same function. With that one name changed locally, the GDS select works, `agc_driver_pm4` passes, and the test fails as it should when main's production code is put back. ## What I ran Head `c74b9dc01c5b9d40e9ff961fae6be8b682580910`, merged with `--no-ff` into `main` `9090972b7e91fd266819cbd77a8b058e177b5682` (merged tree `23853b2392a64ad8c3bce2e2d65e237edbbb6bdf`). Debian 13 VM, 2× Xeon Gold 6136, GCC 14.2.0, Release, Ninja, lavapipe (Mesa 26.1.6). ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...c74b9dc01c5b9d40e9ff961fae6be8b682580910 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 # local fix only: rename gdsStore -> copyGdsStore at tests/Pm4.cpp:594-595 ninja -C build agc_driver_pm4_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_pm4$' # negative control: Execution/include/Pm4.hpp and Execution/src/Pm4.cpp from main ninja -C build agc_driver_pm4_tests ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build --output-on-failure -R '^agc_driver_pm4$' # restored all three files from the merged tree, rebuilt libSceAgcDriver, git status --porcelain (clean) ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Build of the merged tree | **failed**: `tests/Pm4.cpp:657: conflicting declaration 'const auto gdsStore'` | | `agc_driver_pm4` with the local rename | passed (0.17 s) | | Negative control (main's production files, renamed test) | failed as expected | | Vulkan validation comparison | not run (the build failed, so no test ran) | <details><summary>Build error</summary> ``` ../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp: In function 'void {anonymous}::testCopies()': ../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:657:16: error: conflicting declaration 'const auto gdsStore' 657 | const auto gdsStore = AgcDriver::Pm4::ResolveStore(toGds, state, 64); ../core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:594:16: note: previous declaration as 'const std::optional<AgcDriver::Pm4::StoreWrite> gdsStore' 594 | const auto gdsStore = AgcDriver::Pm4::ResolveStore(copyFromGds, state, 64); ``` </details> <details><summary>Negative control output</summary> ``` 1/1 Test #1587: agc_driver_pm4 ...................***Failed 0.02 sec COPY_DATA to GDS resolved as a memory store ``` </details> ## Negative control I restored `Execution/include/Pm4.hpp` and `Execution/src/Pm4.cpp` from `main` and kept the PR's test, with only the local rename so it compiles. `agc_driver_pm4` failed with `COPY_DATA to GDS resolved as a memory store`, so the test covers the change. Afterwards I restored the merged files and rebuilt. `git status --porcelain` showed a clean worktree. ## Findings ### Blocking 1. **The merged tree does not build** (`core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:594`, conflicting with `:657`). This confirms BunnyFl's first point, on Linux with GCC 14.2.0 as well. `main` already declares `const auto gdsStore` for the `DMA_DATA` GDS check later in `testCopies()`. Renaming the PR's variable at lines 594-595 (for example to `copyGdsStore`) is the only change needed: with it, the test builds and passes here. ### Non-blocking 2. **`COPY_DATA` into GDS still never resolves as a store, while `DMA_DATA` into GDS now does** (`core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp:696` against `:706`). This adds detail to BunnyFl's second point. In `Driver/Packets/PacketMemory.cpp:175-184`, only opcode 0x50 gets the `gdsDestination` / `gdsWritesPending` / `GdsImportable` handling. A `COPY_DATA` to GDS returns `std::nullopt` from `ResolveStore`, so it always drains and writes on the CPU. That is still correctly ordered, but slower, and it no longer matches the description's "like DMA". A fix: resolve it as `GdsAddress() + packet[4]` the way `DMA_DATA` does, and apply the same `gdsDestination` checks to opcode 0x40. Alternatively, update the description and the debt entry to say that `COPY_DATA` into GDS always drains. 3. **On the read-ordering question.** `COPY_DATA` from GDS reads through `copySource`, which uses `GuestMemory::Read` (`Execution/src/Pm4.cpp:214`, `:152-160`). This is the same checked path that `DMA_DATA` GDS sources use (`:170`), and opcode 0x40 is not in `keepsDrawPipeline`, so the draw pipeline drains before the packet. From reading the code, that answers BunnyFl's concern about reading GDS on the CPU behind a queued `DMA_DATA` fill. I did not exercise it on a GPU device. 4. **The test still expects the unimplemented performance-counter destination to throw** (`core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:588`). oneandonlydean already asked for this `expectFailure` on `0x405` to be removed, and it is still there at this head. 5. **The `Fixes:` checklist line is missing**, as fogydes noted. Add `Fixes: none`. ## Not verified - The Vulkan validation-layer comparison with `main`: build.json skipped it because no test ran. The changed code is a CP copy path with no shader or pipeline change. - The other `agc_driver_pm4_*` tests and `agc_driver_gds_append_consume`: I only rebuilt and ran `agc_driver_pm4`. - PPSA03541 and any title run. Others already reported the title getting past this stop. - Whether select 3 names the same GDS aperture on the PS5 (the open question in the debt entry). ## To get this to a good state - Rename the `gdsStore` declared at `tests/Pm4.cpp:594`, rebase onto current `main`, and confirm the merged tree builds. - Remove the performance-counter `expectFailure`, as requested before. - Either send `COPY_DATA` into GDS through the same store-resolution path as `DMA_DATA`, or update the description and debt entry to say it always drains. - Add the `Fixes:` line to the checklist. <!-- anyps5-bots job=2557 head=c74b9dc01c5b9d40e9ff961fae6be8b682580910 -->
Superseabas commented 2026-11-06 13:06:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-06T13:06:32Z.

Review: APPROVED


Windows run of the current head, 570b4c0307, the first Windows build since the gdsStore rename. The merged tree builds with GCC 16, the GDS round trips pass on an RTX 5070 Ti and on the integrated Radeon of a Ryzen 7 7700X, and each part of the fix but one is caught by the test. One non-blocking suggestion for that part.

Head merged onto main 921621976c (clean merge, local only). Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, no missing-layer line, ANYPS5_GPU selecting the device:

  • NVIDIA GeForce RTX 5070 Ti (10de:2c05), 621.01
  • AMD Radeon of a Ryzen 7 7700X (1002:164e, integrated), AMD 26.10.2 (32.0.21045.20006)

Build. The merged tree builds; copyFromGdsStore no longer clashes with main's gdsStore in testCopies(). No compiler warnings in the files this PR changes.

Pm4 and GDS tests. The 20 tests matching pm4|gds (agc_driver_pm4 and the other agc_driver_pm4_* entries, agc_driver_gds_append_consume, agc_driver_gds_dma_fill, _dma_fill_private, agc_atomic_gds_size) pass 3 of 3 on both GPUs, on main and on this PR.

Red checks on agc_driver_pm4, each a local edit of Execution/src/Pm4.cpp in the merged tree, 3 runs per GPU:

Edit Result on both GPUs
none passes
Pm4.cpp from main fails: COPY_DATA to GDS resolved as a memory store
ResolveStore: GDS destination return std::nullopt removed fails: the same message
Execute: destination always address(packet[4], packet[5]) fails: guest memory is not readable at 0x20 (range 0x20+0x4)
copyDataSource: GDS source line removed fails: the same message
DecodeStores: GDS destination check removed passes

Non-blocking. The DecodeStores change isn't covered. Without it, a COPY_DATA into GDS offset 0x20 decodes as a store at guest address 0x20, and LabelHistory (Driver/Synchronization/LabelHistory.cpp:59) takes that address as a label store. One line after the ResolveStore check covers it:

check(AgcDriver::Pm4::DecodeStores(copyToGds).empty(), "COPY_DATA to GDS decoded as a memory store");

I tried it locally: agc_driver_pm4 passes with it on this head, and fails with that message once the DecodeStores change is removed.

Whole AGC set. ctest -R '^agc' -j 8 --timeout 300, 1,392 tests: 1,390 pass on the RTX and 1,389 on the Radeon. No VUID- lines. The failures are the ones main has on this machine, all tracked: agc_driver_direct_write_completion (#15564), agc_driver_quad_pixel_mask on the RTX (#14341), and on the Radeon agc_driver_scratch_pool (#15566) and agc_driver_sample_order_grid_reference (#9503).

check_conventions.py --base main passes. PPSA03541 isn't tested here, and neither is BunnyFl's second point, a COPY_DATA from GDS after a GPU-queued DMA_DATA fill of it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5800468287 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6549#pullrequestreview-5800468287). Originally posted by [Superseabas](https://github.com/Superseabas) on 2026-11-06T13:06:32Z. **Review:** APPROVED --- Windows run of the current head, `570b4c0307`, the first Windows build since the `gdsStore` rename. The merged tree builds with GCC 16, the GDS round trips pass on an RTX 5070 Ti and on the integrated Radeon of a Ryzen 7 7700X, and each part of the fix but one is caught by the test. One non-blocking suggestion for that part. Head merged onto `main` `921621976c` (clean merge, local only). Windows 11 Home 10.0.26200, WinLibs GCC 16.2.0 (`x86_64-ucrt-posix-seh`, r3), Release. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, no missing-layer line, `ANYPS5_GPU` selecting the device: - NVIDIA GeForce RTX 5070 Ti (`10de:2c05`), 621.01 - AMD Radeon of a Ryzen 7 7700X (`1002:164e`, integrated), AMD 26.10.2 (32.0.21045.20006) **Build.** The merged tree builds; `copyFromGdsStore` no longer clashes with `main`'s `gdsStore` in `testCopies()`. No compiler warnings in the files this PR changes. **Pm4 and GDS tests.** The 20 tests matching `pm4|gds` (`agc_driver_pm4` and the other `agc_driver_pm4_*` entries, `agc_driver_gds_append_consume`, `agc_driver_gds_dma_fill`, `_dma_fill_private`, `agc_atomic_gds_size`) pass 3 of 3 on both GPUs, on `main` and on this PR. **Red checks** on `agc_driver_pm4`, each a local edit of `Execution/src/Pm4.cpp` in the merged tree, 3 runs per GPU: | Edit | Result on both GPUs | |---|---| | none | passes | | `Pm4.cpp` from `main` | fails: `COPY_DATA to GDS resolved as a memory store` | | `ResolveStore`: GDS destination `return std::nullopt` removed | fails: the same message | | `Execute`: destination always `address(packet[4], packet[5])` | fails: `guest memory is not readable at 0x20 (range 0x20+0x4)` | | `copyDataSource`: GDS source line removed | fails: the same message | | `DecodeStores`: GDS destination check removed | **passes** | **Non-blocking.** The `DecodeStores` change isn't covered. Without it, a `COPY_DATA` into GDS offset `0x20` decodes as a store at guest address `0x20`, and `LabelHistory` (`Driver/Synchronization/LabelHistory.cpp:59`) takes that address as a label store. One line after the `ResolveStore` check covers it: ```cpp check(AgcDriver::Pm4::DecodeStores(copyToGds).empty(), "COPY_DATA to GDS decoded as a memory store"); ``` I tried it locally: `agc_driver_pm4` passes with it on this head, and fails with that message once the `DecodeStores` change is removed. **Whole AGC set.** `ctest -R '^agc' -j 8 --timeout 300`, 1,392 tests: 1,390 pass on the RTX and 1,389 on the Radeon. No `VUID-` lines. The failures are the ones `main` has on this machine, all tracked: `agc_driver_direct_write_completion` (#15564), `agc_driver_quad_pixel_mask` on the RTX (#14341), and on the Radeon `agc_driver_scratch_pool` (#15566) and `agc_driver_sample_order_grid_reference` (#9503). `check_conventions.py --base main` passes. PPSA03541 isn't tested here, and neither is BunnyFl's second point, a `COPY_DATA` from GDS after a GPU-queued `DMA_DATA` fill of it. AI-assisted: yes (Claude Code)
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!6549
No description provided.