test(agc): skip the forced-watch shadow tests where imports report pages written #10138

Merged
root-over merged 1 commit from upstream-pr/10138 into main 2026-10-24 01:36:19 +00:00
root-over commented 2026-10-23 10:36:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by root-over on 2026-10-23T10:36:12Z.


What

agc_driver_bda_reads_shadowed_results, agc_driver_bda_reads_shadowed_results_per_build and agc_unit_shadow_completion_store (#6682) fail on every run on RADV, as #10122 reports for a Radeon 860M. They fail the same way on Vega (GCN 5) with Mesa 26.0.8.

On non-Windows hosts these tests call SetImportWatch(base, ImportWatch::Watch), which keeps host imports watched whatever the driver decided at startup. On RADV, the import probe shows that both importing watched host memory and reading it from the GPU report the pages written:

[write-watch] host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared

The driver therefore compares those imports instead of watching them, and agc_unit_shadow, agc_driver_unit_shadow(_budget) and agc_shadowed_key_stores already skip there ("the device does not import watched host memory for unit shadows"). Under the forced watch, those reports look like CPU stores. A debug print of ShadowReport() right after the address-based build in addressShadowTests shows every shadowed unit dropped as stale before the publish, all attributed to the CPU:

copied=0 current=0  published 0/0.0 by reason { }, stale-dropped 32 (cpu 32, driver 0)

The test makes no CPU store between the retile and the build. On lavapipe the same print shows published 1/2.0 by reason { address 1/2.0 }, stale-dropped 0.

Both tests now run ProbeImportWriteProtection before forcing the watch. They skip when the probe fails or reports pages written at the import or after a GPU read. The forced watch is only valid on devices where neither happens. Devices whose imports stay clean until a GPU write, like lavapipe (0 of 4 ... after a GPU read, 4 after a GPU write, 0 after the import), still run all three tests. The skip message matches check_skips.py's device-limitation pattern ("the device reports"). Driver code is unchanged.

Tested

Ubuntu, kernel 7.0, GCC 15.2.0, Release, main e84c529d6 (refreshed from 8948f1cec after review; same results on both). Ryzen 5 5625U iGPU (Vega/GCN 5, RADV RENOIR, Mesa 26.0.8), plus lavapipe (llvmpipe, LLVM 21.1.8) on the same build.

I ran ctest -R 'shadowed_results|shadow_completion|unit_shadow|shadowed_key' -V -j1 with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on main and on this PR. That covers the 3 tests above and the 4 unit-shadow tests that already skip on RADV.

RADV lavapipe
main 3 fail, 4 skip 3 pass, 4 skip
this PR 7 skip (the 3 with "the device reports watched host memory written when it imports or reads it") 3 pass, 4 skip

No log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and every log has 0 VUID-. On main the three failures repeat on every run on RADV.

Not tested: the Radeon 860M from #10122. Its probe line is the same as above (4 of 4 after a GPU read, a GPU write and the import), so the same skip should apply there.

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 #10122
  • Unblocks: none
  • GPUs tested: AMD Ryzen 5 5625U iGPU (Vega/GCN 5), RADV RENOIR, Mesa 26.0.8, Ubuntu (kernel 7.0); lavapipe (llvmpipe, LLVM 21.1.8), Mesa 26.0.8, same machine
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4981450265 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10138). Originally posted by [root-over](https://github.com/root-over) on 2026-10-23T10:36:12Z. --- ### What `agc_driver_bda_reads_shadowed_results`, `agc_driver_bda_reads_shadowed_results_per_build` and `agc_unit_shadow_completion_store` (#6682) fail on every run on RADV, as #10122 reports for a Radeon 860M. They fail the same way on Vega (GCN 5) with Mesa 26.0.8. On non-Windows hosts these tests call `SetImportWatch(base, ImportWatch::Watch)`, which keeps host imports watched whatever the driver decided at startup. On RADV, the import probe shows that both importing watched host memory and reading it from the GPU report the pages written: ``` [write-watch] host imports resolve write protection: yes (4 of 4 scratch pages written after a GPU read, 4 after a GPU write, 4 after the import); imported ranges are compared ``` The driver therefore compares those imports instead of watching them, and `agc_unit_shadow`, `agc_driver_unit_shadow(_budget)` and `agc_shadowed_key_stores` already skip there ("the device does not import watched host memory for unit shadows"). Under the forced watch, those reports look like CPU stores. A debug print of `ShadowReport()` right after the address-based build in `addressShadowTests` shows every shadowed unit dropped as stale before the publish, all attributed to the CPU: ``` copied=0 current=0 published 0/0.0 by reason { }, stale-dropped 32 (cpu 32, driver 0) ``` The test makes no CPU store between the retile and the build. On lavapipe the same print shows `published 1/2.0 by reason { address 1/2.0 }, stale-dropped 0`. Both tests now run `ProbeImportWriteProtection` before forcing the watch. They skip when the probe fails or reports pages written at the import or after a GPU read. The forced watch is only valid on devices where neither happens. Devices whose imports stay clean until a GPU write, like lavapipe (`0 of 4 ... after a GPU read, 4 after a GPU write, 0 after the import`), still run all three tests. The skip message matches `check_skips.py`'s device-limitation pattern ("the device reports"). Driver code is unchanged. ### Tested Ubuntu, kernel 7.0, GCC 15.2.0, Release, `main` `e84c529d6` (refreshed from `8948f1cec` after review; same results on both). Ryzen 5 5625U iGPU (Vega/GCN 5, RADV RENOIR, Mesa 26.0.8), plus lavapipe (llvmpipe, LLVM 21.1.8) on the same build. I ran `ctest -R 'shadowed_results|shadow_completion|unit_shadow|shadowed_key' -V -j1` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on `main` and on this PR. That covers the 3 tests above and the 4 unit-shadow tests that already skip on RADV. | | RADV | lavapipe | |---|---|---| | `main` | 3 fail, 4 skip | 3 pass, 4 skip | | this PR | 7 skip (the 3 with "the device reports watched host memory written when it imports or reads it") | 3 pass, 4 skip | No log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and every log has 0 `VUID-`. On `main` the three failures repeat on every run on RADV. Not tested: the Radeon 860M from #10122. Its probe line is the same as above (4 of 4 after a GPU read, a GPU write and the import), so the same skip should apply there. ### 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 #10122 - [x] Unblocks: none - [x] GPUs tested: AMD Ryzen 5 5625U iGPU (Vega/GCN 5), RADV RENOIR, Mesa 26.0.8, Ubuntu (kernel 7.0); lavapipe (llvmpipe, LLVM 21.1.8), Mesa 26.0.8, same machine - [x] AI-assisted: yes
MarcZX10 commented 2026-10-23 10:43:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:43:47Z.

Review: APPROVED


The added probe is placed before SetImportWatch(...Watch), and the existing test entry points translate false into CTest skip code 77. This makes the forced-watch assertions run only when the probe establishes that import/read activity does not itself mark the watched pages written. The condition is consistent with the existing unit-shadow skip policy and leaves the driver implementation untouched. The linked report shows the same probe signature on RADV; the PR author tested Vega RADV and lavapipe, with the three affected cases skipped on RADV and passing on lavapipe, and reports no validation messages. I did not run the GPU tests locally. Exact-worktree conventions, diff check, and main-sync checks pass (1 ahead/4 behind current main; merge clean); hosted eligibility, intake, conventions, and labels pass, while product jobs are skipped by the workflow.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627148172 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10138#pullrequestreview-5627148172). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T10:43:47Z. **Review:** APPROVED --- The added probe is placed before `SetImportWatch(...Watch)`, and the existing test entry points translate `false` into CTest skip code 77. This makes the forced-watch assertions run only when the probe establishes that import/read activity does not itself mark the watched pages written. The condition is consistent with the existing unit-shadow skip policy and leaves the driver implementation untouched. The linked report shows the same probe signature on RADV; the PR author tested Vega RADV and lavapipe, with the three affected cases skipped on RADV and passing on lavapipe, and reports no validation messages. I did not run the GPU tests locally. Exact-worktree conventions, diff check, and main-sync checks pass (1 ahead/4 behind current main; merge clean); hosted eligibility, intake, conventions, and labels pass, while product jobs are skipped by the workflow.
MarcZX10 commented 2026-10-23 11:11:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T11:11:30Z.

Review: APPROVED


Reviewed the exact head b2bb6c04ae5c126404e62f59905f38815424dd22. Both affected test paths run the import write-protection probe before forcing ImportWatch::Watch, and skip only when the device reports writes at import or after a GPU read—the condition that invalidates the forced-watch assumption. Windows retains its existing path. The author reports the RADV main-vs-PR failure/skip comparison and lavapipe pass comparison with validation enabled; hosted product jobs were skipped by policy, and I did not independently run GPU tests. Conventions and all hosted checks that ran pass. No blocking issue found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627425685 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10138#pullrequestreview-5627425685). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T11:11:30Z. **Review:** APPROVED --- Reviewed the exact head `b2bb6c04ae5c126404e62f59905f38815424dd22`. Both affected test paths run the import write-protection probe before forcing `ImportWatch::Watch`, and skip only when the device reports writes at import or after a GPU read—the condition that invalidates the forced-watch assumption. Windows retains its existing path. The author reports the RADV main-vs-PR failure/skip comparison and lavapipe pass comparison with validation enabled; hosted product jobs were skipped by policy, and I did not independently run GPU tests. Conventions and all hosted checks that ran pass. No blocking issue found.
MarcZX10 commented 2026-10-23 11:30:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T11:30:48Z.

Review: CHANGES_REQUESTED


The Radeon 860M rerun is useful and confirms the intended skip on that adapter while lavapipe continues to execute the tests. I found one repository-currentness gap before approval: this branch is based on 513ca7e558 (46 commits behind current main), and the intervening main changes add 114 lines to tests/Recorder.cpp plus 22 lines to the AGC CMake test registration. The same-device comparison in #10122 is explicitly against the older base. Please refresh this PR onto current main and rerun the affected test set on the refreshed baseline and PR (including the RADV skip and lavapipe pass comparison); then I can confirm the result against the tests that will actually merge. The hosted conventions check passes; the product test jobs are skipped by policy. The issue-linked work remains this PR; I am not suggesting parallel implementation or closure based on queue size.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627616620 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10138#pullrequestreview-5627616620). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T11:30:48Z. **Review:** CHANGES_REQUESTED --- The Radeon 860M rerun is useful and confirms the intended skip on that adapter while lavapipe continues to execute the tests. I found one repository-currentness gap before approval: this branch is based on `513ca7e558` (46 commits behind current `main`), and the intervening main changes add 114 lines to `tests/Recorder.cpp` plus 22 lines to the AGC CMake test registration. The same-device comparison in #10122 is explicitly against the older base. Please refresh this PR onto current `main` and rerun the affected test set on the refreshed baseline and PR (including the RADV skip and lavapipe pass comparison); then I can confirm the result against the tests that will actually merge. The hosted conventions check passes; the product test jobs are skipped by policy. The issue-linked work remains this PR; I am not suggesting parallel implementation or closure based on queue size.
MarcZX10 commented 2026-10-23 12:41:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:41:44Z.

Review: APPROVED


Re-reviewed exact head 12ca5c16f0cc7c9aee25456e323e8c519c90cb9f after the rebase. The source delta is unchanged: both Linux forced-watch cases run the import/write probe before enabling ImportWatch::Watch and skip only when import/read activity reports writes. The updated same-device baseline comparison now uses main e84c529d6 and the rebased PR: on RADV the three affected cases fail on main but all seven skip on the PR with the explicit reason; on lavapipe the three pass on both, while the unrelated four skip. The author reports zero missing-layer and VUID diagnostics. GitHub reports the branch mergeable/clean, and hosted eligibility, conventions, labels and report pass; product jobs are skipped by path policy. I did not independently run the GPU comparison.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5628344865 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10138#pullrequestreview-5628344865). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T12:41:44Z. **Review:** APPROVED --- Re-reviewed exact head `12ca5c16f0cc7c9aee25456e323e8c519c90cb9f` after the rebase. The source delta is unchanged: both Linux forced-watch cases run the import/write probe before enabling `ImportWatch::Watch` and skip only when import/read activity reports writes. The updated same-device baseline comparison now uses main `e84c529d6` and the rebased PR: on RADV the three affected cases fail on main but all seven skip on the PR with the explicit reason; on lavapipe the three pass on both, while the unrelated four skip. The author reports zero missing-layer and VUID diagnostics. GitHub reports the branch mergeable/clean, and hosted eligibility, conventions, labels and report pass; product jobs are skipped by path policy. I did not independently run the GPU comparison.
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!10138
No description provided.