test(agc): cover mixed f16 image load and store #17613
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17613"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 registeredagc_driver_image_store_float_rounding_codegenpassed all six mixed variants withVK_DRIVER_FILESpointing to a nonexistent ICD, confirming it runs without a GPU.ctest --test-dir build -R '^agc_driver_image_store_float_rounding$' -Vpassed on main5e04f680adacand updated head6b152b1d15f1on the same physical NVIDIA GPU withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_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 itsdevice.ComputeTarget(64)migration retained at the newRecompilecall inStore. #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 functionsOne 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 fileNo notes, investigation
.mdfiles 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
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
ff2b85fa27against head702a69e3cc. Run withANYPS5_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_roundingpasses on both sides. 0VUID-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-onlyon the head: exit 0 and "codegen tests passed" in 3 of 3 runs.Notes:
ValidateModuleBindingschecks how the recompiler builds the module, not what the guest sees. It requires aFloatsampled view and aUintstorage view in the SPIR-V. If the recompiler later stores f16 through a typedFloat16storage view on devices that support it, the texels would still be right but this test would fail. The texel check inCheck(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.--codegen-onlyisn'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, anadd_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)
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:ValidateModuleBindingsis now called only in the--codegen-onlybranch (ImageStoreFloatRounding.cpp:362), so the GPU run checks only the texels.agc_driver_image_store_float_rounding_codegenruns that mode under CTest, from its own..._codegen_tests.cmakeafter the rename in6b152b1d15.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_DEBUGis 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)