test(agc): cover mixed f16 image load and store #17613

Merged
Queuse merged 804 commits from upstream-pr/17613 into main 2026-11-12 23:30:50 +00:00
Queuse commented 2026-11-09 02:42:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Queuse on 2026-11-09T02:42:37Z.


What

Extend the f16 image rounding fixture with same-descriptor image loads and stores, for scalar and D16 instructions across R16, RG16 and RGBA16 formats. The GPU path checks copied texels and untouched rows; sampled/storage SPIR-V binding checks run only in the separately registered CPU codegen test. No production shader code changes. Related to #8282.

The CPU registration uses its own CMake fragment so it can coexist with the GPU descriptor-heap stack's registration.

Tested

Windows 11, WinLibs GCC 15.2 r7 Release. Built agc_driver_image_store_float_rounding_tests. The registered agc_driver_image_store_float_rounding_codegen passed all six mixed variants with VK_DRIVER_FILES pointing to a nonexistent ICD, confirming it runs without a GPU.

ctest --test-dir build -R '^agc_driver_image_store_float_rounding$' -V passed on main 5e04f680adac and updated head 6b152b1d15f1 on the same physical NVIDIA GPU with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. The validation layer loaded in both logs; neither contained VUIDs, a missing-layer message or a skip. The CTest registration audit, conventions and whitespace checks pass.

The canonical overlap scan examined 1,964 open PRs against main 561fb7672f29. #9508 still needs its device.ComputeTarget(64) migration retained at the new Recompile call in Store. #7642, #10193, #13928 and #13929 could not be composed automatically because they conflict with main; manual comparison found the same one-line migration in their shared fixture, without mixed-access coverage. Full composition of those four branches remains unverified. The new CPU CMake fragment has no add/add collision with their GPU-heap fragment.

This head merges cleanly with the scan base. The advance after the tested base changes frame-recorder/driver queue behavior and a CES/JIS test; this fixture dispatches directly through VulkanDevice and does not enter those recorder/queue paths. GPU validation is against the explicitly identified base, not a full test of that later main.

Independent checks on the original head 702a69e3cc: milescoviello ran main and the patch on Ubuntu 26.04.1 / RTX 4070 Ti / NVIDIA 615.71.09, with both passing. The reviewer later corrected the layer evidence: validation was not confirmed because the layer directory was missing; codegen passed 3/3. DonRyuzaki ran codegen and GPU tests 3/3 on Windows / Radeon RX 7800 XT, without a main comparison or validation layers. Those external results predate this update. Focused tests only; no title, console or full-suite validation.

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: none

  • Unblocks: none

  • GPUs tested: NVIDIA GeForce RTX 3050 Laptop GPU, driver 621.01, Windows 11 Home Single Language 10.0.26200; prior head independently tested on NVIDIA RTX 4070 Ti, driver 615.71.09, Ubuntu 26.04.1, and AMD Radeon RX 7800 XT, driver/Windows version not reported (no main/layer comparison)

  • AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5217854560 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17613). Originally posted by [Queuse](https://github.com/Queuse) on 2026-11-09T02:42:37Z. --- ### What Extend the f16 image rounding fixture with same-descriptor image loads and stores, for scalar and D16 instructions across R16, RG16 and RGBA16 formats. The GPU path checks copied texels and untouched rows; sampled/storage SPIR-V binding checks run only in the separately registered CPU codegen test. No production shader code changes. Related to #8282. The CPU registration uses its own CMake fragment so it can coexist with the GPU descriptor-heap stack's registration. ### Tested Windows 11, WinLibs GCC 15.2 r7 Release. Built `agc_driver_image_store_float_rounding_tests`. The registered `agc_driver_image_store_float_rounding_codegen` passed all six mixed variants with `VK_DRIVER_FILES` pointing to a nonexistent ICD, confirming it runs without a GPU. `ctest --test-dir build -R '^agc_driver_image_store_float_rounding$' -V` passed on main `5e04f680adac` and updated head `6b152b1d15f1` on the same physical NVIDIA GPU with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. The validation layer loaded in both logs; neither contained VUIDs, a missing-layer message or a skip. The CTest registration audit, conventions and whitespace checks pass. The canonical overlap scan examined 1,964 open PRs against main `561fb7672f29`. #9508 still needs its `device.ComputeTarget(64)` migration retained at the new `Recompile` call in `Store`. #7642, #10193, #13928 and #13929 could not be composed automatically because they conflict with main; manual comparison found the same one-line migration in their shared fixture, without mixed-access coverage. Full composition of those four branches remains unverified. The new CPU CMake fragment has no add/add collision with their GPU-heap fragment. This head merges cleanly with the scan base. The advance after the tested base changes frame-recorder/driver queue behavior and a CES/JIS test; this fixture dispatches directly through VulkanDevice and does not enter those recorder/queue paths. GPU validation is against the explicitly identified base, not a full test of that later main. Independent checks on the original head `702a69e3cc`: [milescoviello](https://github.com/boykopovar/AnyPS5/pull/17613#pullrequestreview-5825116148) ran main and the patch on Ubuntu 26.04.1 / RTX 4070 Ti / NVIDIA 615.71.09, with both passing. The reviewer later corrected the layer evidence: validation was not confirmed because the layer directory was missing; codegen passed 3/3. [DonRyuzaki](https://github.com/boykopovar/AnyPS5/pull/17613#issuecomment-6731535905) ran codegen and GPU tests 3/3 on Windows / Radeon RX 7800 XT, without a main comparison or validation layers. Those external results predate this update. Focused tests only; no title, console or full-suite validation. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> ### 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 3050 Laptop GPU, driver 621.01, Windows 11 Home Single Language 10.0.26200; prior head independently tested on NVIDIA RTX 4070 Ti, driver 615.71.09, Ubuntu 26.04.1, and AMD Radeon RX 7800 XT, driver/Windows version not reported (no main/layer comparison) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
milescoviello commented 2026-11-09 11:19:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-09T11:19:38Z.

Review: COMMENTED


NVIDIA Linux results, plus two notes on the test itself.

Setup: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release, merge base ff2b85fa27 against head 702a69e3cc. Run with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (layer 1.4.363), ctest -R '^agc_driver_image_store_float_rounding$' -V.

  • agc_driver_image_store_float_rounding passes on both sides. 0 VUID- lines, no missing-layer message, and a physical device selected, so the mixed load/store variants ran on the GPU under the layer.
  • agc_driver_image_store_float_rounding_tests --codegen-only on the head: exit 0 and "codegen tests passed" in 3 of 3 runs.

Notes:

  1. ValidateModuleBindings checks how the recompiler builds the module, not what the guest sees. It requires a Float sampled view and a Uint storage view in the SPIR-V. If the recompiler later stores f16 through a typed Float16 storage view on devices that support it, the texels would still be right but this test would fail. The texel check in Check (copied row, untouched rows, prefill) already catches a wrong load/store. Unless disabling raw f16 storage made some texel come out wrong, I'd drop the binding assertion, or keep it only in the codegen mode, where it documents intent without blocking a correct change.
  2. --codegen-only isn't registered with CTest. The only change in the diff is to the .cpp, so nothing runs that mode, and it can't catch a regression. If it's meant to give GPU-less coverage, an add_test(NAME agc_driver_image_store_float_rounding_codegen COMMAND agc_driver_image_store_float_rounding_tests --codegen-only) would make it run in CI. Otherwise it can go.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5825116148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17613#pullrequestreview-5825116148). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-11-09T11:19:38Z. **Review:** COMMENTED --- NVIDIA Linux results, plus two notes on the test itself. **Setup:** Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release, merge base `ff2b85fa27` against head `702a69e3cc`. Run with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (layer 1.4.363), `ctest -R '^agc_driver_image_store_float_rounding$' -V`. - `agc_driver_image_store_float_rounding` passes on both sides. 0 `VUID-` lines, no missing-layer message, and a physical device selected, so the mixed load/store variants ran on the GPU under the layer. - `agc_driver_image_store_float_rounding_tests --codegen-only` on the head: exit 0 and "codegen tests passed" in 3 of 3 runs. Notes: 1. **`ValidateModuleBindings` checks how the recompiler builds the module, not what the guest sees.** It requires a `Float` sampled view and a `Uint` storage view in the SPIR-V. If the recompiler later stores f16 through a typed `Float16` storage view on devices that support it, the texels would still be right but this test would fail. The texel check in `Check` (copied row, untouched rows, prefill) already catches a wrong load/store. Unless disabling raw f16 storage made some texel come out wrong, I'd drop the binding assertion, or keep it only in the codegen mode, where it documents intent without blocking a correct change. 2. **`--codegen-only` isn't registered with CTest.** The only change in the diff is to the `.cpp`, so nothing runs that mode, and it can't catch a regression. If it's meant to give GPU-less coverage, an `add_test(NAME agc_driver_image_store_float_rounding_codegen COMMAND agc_driver_image_store_float_rounding_tests --codegen-only)` would make it run in CI. Otherwise it can go. AI-assisted: yes (Claude Code)
milescoviello commented 2026-11-10 01:03:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-10T01:03:10Z.

Review: APPROVED


Thanks @Queuse. Checked at 6b152b1d15, and both notes are resolved:

  • ValidateModuleBindings is now called only in the --codegen-only branch (ImageStoreFloatRounding.cpp:362), so the GPU run checks only the texels.
  • agc_driver_image_store_float_rounding_codegen runs that mode under CTest, from its own ..._codegen_tests.cmake after the rename in 6b152b1d15.

A correction to my earlier review: I wrote that my Linux run was under layer 1.4.363 with "no missing-layer message". I can't stand by the layer part. That layer directory turned out to be gone, and AnyPS5's test programs don't print the loader's "was not found" error unless VK_LOADER_DEBUG is set (details in #17896). So the run may not have been validated. Your Windows run, with the layer confirmed loaded in both logs, is the validation evidence here. The pass results themselves stand.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5835122099 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17613#pullrequestreview-5835122099). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-11-10T01:03:10Z. **Review:** APPROVED --- Thanks @Queuse. Checked at `6b152b1d15`, and both notes are resolved: - `ValidateModuleBindings` is now called only in the `--codegen-only` branch (`ImageStoreFloatRounding.cpp:362`), so the GPU run checks only the texels. - `agc_driver_image_store_float_rounding_codegen` runs that mode under CTest, from its own `..._codegen_tests.cmake` after the rename in `6b152b1d15`. **A correction to my earlier review:** I wrote that my Linux run was under layer 1.4.363 with "no missing-layer message". I can't stand by the layer part. That layer directory turned out to be gone, and AnyPS5's test programs don't print the loader's "was not found" error unless `VK_LOADER_DEBUG` is set (details in #17896). So the run may not have been validated. Your Windows run, with the layer confirmed loaded in both logs, is the validation evidence here. The pass results themselves stand. 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!17613
No description provided.