test(agc): skip the idle publish wait where host imports read as written after a GPU read #12158

Merged
janzezno merged 1 commit from upstream-pr/12158 into main 2026-11-03 05:09:10 +00:00
janzezno commented 2026-10-28 00:01:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-28T00:01:38Z.


What

agc_idle_publish_wait has failed on RADV since #9521. The cause is in the test setup, not the driver. The ctest entry forces APS5_WRITE_WATCH_IMPORTS=watch. On RADV every submission revalidates the userptr import, and that resolves the import's write protection: the import probe reports 4 of 4 pages written after a GPU read. That is why the default probe mode compares imports on RADV instead of watching them. #9521's CPU-side publish checks at completion that no CPU store reached each unit since the publish started (UnchangedSinceCollected). Under the forced watch, the submissions read as CPU stores, so both units are dropped as stale and the test sees the old bytes. Before #9521 the publish copied on the GPU and had no such check.

Under the default mode, RADV compares private host imports instead of watching them, so they get no unit shadows and this path is not reached. dma-buf imports, which RADV keeps watched, report 0 of 4 pages written after a GPU read.

The test now runs ProbeImportWriteProtection and skips (77) when pages read as written after a GPU read, or when the probe fails. This is the condition agc_driver_image_table_vouched_lookups already uses (ImportsStayWatchedThroughReads). It deliberately ignores pages written after a GPU write: lavapipe reports 4 of 4 of those, and this test never has the GPU write into the import, so including them would turn the test off on CI. The check is skipped on Windows, which ignores APS5_WRITE_WATCH_IMPORTS.

After this change, RADV no longer runs the idle publish. Covering it there through a dma-buf import would need a separate test PR.

Tested

Arch Linux, kernel 7.2.11, Release, BUILD_TESTING=ON, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Command: ctest --test-dir build -R 'idle|unit_shadow' -V on main 6e9b9134f6 and on this change, with each driver selected through VK_DRIVER_FILES.

device main this change
AMD Radeon RX 7900 GRE, RADV NAVI31, Mesa 26.2.5 10/11, agc_idle_publish_wait fails (the idle publish's bytes are wrong) 11/11; agc_idle_publish_wait skipped: the device reports 4 of 4 host-imported pages written after a GPU read
llvmpipe (LLVM 23.1.3), Mesa 26.2.5 11/11 11/11; agc_idle_publish_wait runs and prints idle publish wait verified

On RADV, agc_idle_publish_wait alone fails 3 of 3 runs on main and skips 3 of 3 with this change. On lavapipe it passes 3 of 3 with this change. No log contains VUID- or was not found but was requested by env var VK_INSTANCE_LAYERS. The other skips in the table, agc_unit_shadow*, happen on main too.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #11889
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 7900 GRE (RADV NAVI31, Mesa 26.2.5, Arch Linux); llvmpipe (Mesa 26.2.5, Arch Linux)
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5042963298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12158). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-28T00:01:38Z. --- ### What `agc_idle_publish_wait` has failed on RADV since #9521. The cause is in the test setup, not the driver. The ctest entry forces `APS5_WRITE_WATCH_IMPORTS=watch`. On RADV every submission revalidates the userptr import, and that resolves the import's write protection: the import probe reports 4 of 4 pages written after a GPU read. That is why the default `probe` mode compares imports on RADV instead of watching them. #9521's CPU-side publish checks at completion that no CPU store reached each unit since the publish started (`UnchangedSinceCollected`). Under the forced watch, the submissions read as CPU stores, so both units are dropped as stale and the test sees the old bytes. Before #9521 the publish copied on the GPU and had no such check. Under the default mode, RADV compares private host imports instead of watching them, so they get no unit shadows and this path is not reached. dma-buf imports, which RADV keeps watched, report 0 of 4 pages written after a GPU read. The test now runs `ProbeImportWriteProtection` and skips (77) when pages read as written after a GPU read, or when the probe fails. This is the condition `agc_driver_image_table_vouched_lookups` already uses (`ImportsStayWatchedThroughReads`). It deliberately ignores pages written after a GPU write: lavapipe reports 4 of 4 of those, and this test never has the GPU write into the import, so including them would turn the test off on CI. The check is skipped on Windows, which ignores `APS5_WRITE_WATCH_IMPORTS`. After this change, RADV no longer runs the idle publish. Covering it there through a dma-buf import would need a separate test PR. ### Tested Arch Linux, kernel 7.2.11, Release, `BUILD_TESTING=ON`, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. Command: `ctest --test-dir build -R 'idle|unit_shadow' -V` on `main` `6e9b9134f6` and on this change, with each driver selected through `VK_DRIVER_FILES`. | device | `main` | this change | |---|---|---| | AMD Radeon RX 7900 GRE, RADV NAVI31, Mesa 26.2.5 | 10/11, `agc_idle_publish_wait` fails (`the idle publish's bytes are wrong`) | 11/11; `agc_idle_publish_wait` skipped: `the device reports 4 of 4 host-imported pages written after a GPU read` | | llvmpipe (LLVM 23.1.3), Mesa 26.2.5 | 11/11 | 11/11; `agc_idle_publish_wait` runs and prints `idle publish wait verified` | On RADV, `agc_idle_publish_wait` alone fails 3 of 3 runs on `main` and skips 3 of 3 with this change. On lavapipe it passes 3 of 3 with this change. No log contains `VUID-` or `was not found but was requested by env var VK_INSTANCE_LAYERS`. The other skips in the table, `agc_unit_shadow*`, happen on `main` too. ### 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] Fixes: Fixes #11889 - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 7900 GRE (RADV NAVI31, Mesa 26.2.5, Arch Linux); llvmpipe (Mesa 26.2.5, Arch Linux) - [x] 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!12158
No description provided.