fix(agc): round 16-bit float image stores toward zero #8998

Merged
MarcZX10 merged 4 commits from upstream-pr/8998 into main 2026-10-27 06:59:24 +00:00
MarcZX10 commented 2026-10-21 09:08:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T09:08:06Z.


What

Use a UINT storage-image view for write-only 16-bit float formats and convert each stored component with the existing round-toward-zero float-to-half routine. This preserves negative values, infinities and NaNs, and saturates finite overflow as observed on the AMD hardware documented in #8282. Add execution coverage for 16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT, including edge values and component masks. The follow-up binds UINT-compatible views for these converted formats while retaining native SFLOAT views for float bindings. This update also binds a compatible UINT view for multisampled float16 targets and restores the existing two-argument StorageView call sites after rebasing on current main.

Tested

  • Linux: ninja -C build agc_driver_sample_multisample_target_tests succeeds on updated head 7081834388.
  • Local Vulkan execution of agc_driver_sample_multisample_target stops before test initialization because this host CPU lacks BMI1, BMI2, LZCNT, MOVBE, AVX2 and FMA. The test therefore did not reach Vulkan validation.
  • AMD Windows: RX 6700 XT (gfx1031), driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release, updated head 7081834388 cleanly merged onto main b00235dda0. agc_driver_sample_multisample_target and agc_driver_image_store_float_rounding each pass 3/3 without validation and 3/3 with VK_LAYER_KHRONOS_validation; the focused validation runs report 0 VUID- lines. Adjacent native-MSAA, image conversion/repacking and depth-storage tests also pass 3/3 in both modes.
  • Apple M2 Max (Metal via MoltenVK 1.4.2), macOS 27.2 under Rosetta 2, updated head 708183438: agc_driver_image_store_float_rounding passes 3/3. The multisample target test is skipped because MoltenVK does not expose shaderStorageImageMultisample. With the production change reverted and the new test retained, the float16 rounding test fails at 0x7e00 where round-toward-zero expects 0x7e09, confirming the host rounding difference this path handles.
  • python3 tools/check_conventions.py --base upstream/main passes. python3 tools/pr_overlap.py --branch codex/f32-image-store-rtz-8282 reports shared graphics files in other open PRs, including #6218, #8716 and #8792; their topics are packed storage images, shader emitter performance and image atomics, respectively. No dependency is identified.

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: AMD Radeon RX 6700 XT (gfx1031), AMD driver 32.0.21045.5002, Windows 11; Apple M2 Max with MoltenVK 1.4.2, macOS 27.2. The updated head was GPU-tested on both; the multisample target test is unavailable on MoltenVK.
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4949141868 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T09:08:06Z. --- ### What Use a UINT storage-image view for write-only 16-bit float formats and convert each stored component with the existing round-toward-zero float-to-half routine. This preserves negative values, infinities and NaNs, and saturates finite overflow as observed on the AMD hardware documented in #8282. Add execution coverage for 16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT, including edge values and component masks. The follow-up binds UINT-compatible views for these converted formats while retaining native SFLOAT views for float bindings. This update also binds a compatible UINT view for multisampled float16 targets and restores the existing two-argument StorageView call sites after rebasing on current main. ### Tested - Linux: `ninja -C build agc_driver_sample_multisample_target_tests` succeeds on updated head `7081834388`. - Local Vulkan execution of `agc_driver_sample_multisample_target` stops before test initialization because this host CPU lacks BMI1, BMI2, LZCNT, MOVBE, AVX2 and FMA. The test therefore did not reach Vulkan validation. - AMD Windows: RX 6700 XT (gfx1031), driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release, updated head `7081834388` cleanly merged onto `main` `b00235dda0`. `agc_driver_sample_multisample_target` and `agc_driver_image_store_float_rounding` each pass 3/3 without validation and 3/3 with `VK_LAYER_KHRONOS_validation`; the focused validation runs report 0 `VUID-` lines. Adjacent native-MSAA, image conversion/repacking and depth-storage tests also pass 3/3 in both modes. - Apple M2 Max (Metal via MoltenVK 1.4.2), macOS 27.2 under Rosetta 2, updated head `708183438`: `agc_driver_image_store_float_rounding` passes 3/3. The multisample target test is skipped because MoltenVK does not expose `shaderStorageImageMultisample`. With the production change reverted and the new test retained, the float16 rounding test fails at `0x7e00` where round-toward-zero expects `0x7e09`, confirming the host rounding difference this path handles. - `python3 tools/check_conventions.py --base upstream/main` passes. `python3 tools/pr_overlap.py --branch codex/f32-image-store-rtz-8282` reports shared graphics files in other open PRs, including #6218, #8716 and #8792; their topics are packed storage images, shader emitter performance and image atomics, respectively. No dependency is identified. ### 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](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: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD driver 32.0.21045.5002, Windows 11; Apple M2 Max with MoltenVK 1.4.2, macOS 27.2. The updated head was GPU-tested on both; the multisample target test is unavailable on MoltenVK. - [x] AI-assisted: yes
clairtonmichel commented 2026-10-21 09:17:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T09:17:54Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Built cleanly with zero errors.
  • Ran image and graphics test suites, resulting in 2 failures:
    • agc_driver_image_array_window_past_layer_limit (Failed)
    • agc_driver_image_store_float_rounding (Failed with: image_store of 16_FLOAT: texel (1, 0) component 0 is 0, expected 15360)

It seems the 16-bit floating point rounding towards zero logic is prematurely truncating or zeroing out the store on RDNA3/RADV. Needs a revision!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312463237 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312463237). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-21T09:17:54Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Built cleanly with zero errors. - Ran image and graphics test suites, resulting in 2 failures: - `agc_driver_image_array_window_past_layer_limit` (Failed) - `agc_driver_image_store_float_rounding` (Failed with: `image_store of 16_FLOAT: texel (1, 0) component 0 is 0, expected 15360`) It seems the 16-bit floating point rounding towards zero logic is prematurely truncating or zeroing out the store on RDNA3/RADV. Needs a revision!
MarcZX10 commented 2026-10-21 09:22:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T09:22:28Z.


Thanks for running this on RADV. The 16_FLOAT failure is a real regression in the new path; I am tracing why the converted UINT storage view writes zero for the 0x3f801000 input instead of 0x3c00. I cannot reproduce the GPU run on my current host (its CPU lacks required ISA features, so the test exits during initialization). I will update this PR with the fix and validation; the separate image_array_window_past_layer_limit failure is being checked independently.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312547763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312547763). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T09:22:28Z. --- Thanks for running this on RADV. The `16_FLOAT` failure is a real regression in the new path; I am tracing why the converted UINT storage view writes zero for the `0x3f801000` input instead of `0x3c00`. I cannot reproduce the GPU run on my current host (its CPU lacks required ISA features, so the test exits during initialization). I will update this PR with the fix and validation; the separate `image_array_window_past_layer_limit` failure is being checked independently.
MarcZX10 commented 2026-10-21 09:29:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T09:29:44Z.


I found the cause in the descriptor view path: the converted shader emitted UINT texels, but StorageTexture::StorageView only created UINT-compatible views for signed formats. A float16 descriptor therefore reached the shader through its native SFLOAT view. Commit 268bfc012f now selects the UINT view for the UINT storage-image binding and keeps the native float view for float bindings; the view mapping covers R16, R16G16 and R16G16B16A16 SFLOAT. The focused test target builds on Linux, and conventions plus git diff --check pass. I cannot run the Vulkan test on this host because its CPU lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA, so the GPU result on the new head is still needed. When convenient, could you rerun the focused test on this head and report results for all three formats? The existing image_array_window_past_layer_limit failure is also still untriaged from the output here; its first failing assertion would help isolate it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312680298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312680298). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T09:29:44Z. --- I found the cause in the descriptor view path: the converted shader emitted UINT texels, but `StorageTexture::StorageView` only created UINT-compatible views for signed formats. A float16 descriptor therefore reached the shader through its native SFLOAT view. Commit `268bfc012f` now selects the UINT view for the UINT storage-image binding and keeps the native float view for float bindings; the view mapping covers R16, R16G16 and R16G16B16A16 SFLOAT. The focused test target builds on Linux, and conventions plus `git diff --check` pass. I cannot run the Vulkan test on this host because its CPU lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA, so the GPU result on the new head is still needed. When convenient, could you rerun the focused test on this head and report results for all three formats? The existing `image_array_window_past_layer_limit` failure is also still untriaged from the output here; its first failing assertion would help isolate it.
clairtonmichel commented 2026-10-21 09:37:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by clairtonmichel on 2026-10-21T09:37:58Z.


Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5):

  • Re-run focused AGC tests with commit 268bfc012fa:
    • agc_driver_image_store_float_rounding: Passed successfully (float16 / R16, R16G16, R16G16B16A16 storage view formats behave correctly with the new UINT selection).
  • Focused isolated test run results and errors observed:
    • agc_driver_guest_memory_lifetime: Failed
    • agc_driver_image_array_window_past_layer_limit: Failed
    • agc_driver_sample_multisample_target: Failed
    • agc_driver_tessellation: SEGFAULT
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312829788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312829788). Originally posted by [clairtonmichel](https://github.com/clairtonmichel) on 2026-10-21T09:37:58Z. --- Tested on AMD Ryzen 7 9800X3D and AMD Radeon RX 7900 XTX (Fedora Linux, Mesa 26.2.5): - Re-run focused AGC tests with commit `268bfc012fa`: - `agc_driver_image_store_float_rounding`: **Passed successfully** (float16 / R16, R16G16, R16G16B16A16 storage view formats behave correctly with the new UINT selection). - Focused isolated test run results and errors observed: - `agc_driver_guest_memory_lifetime`: Failed - `agc_driver_image_array_window_past_layer_limit`: Failed - `agc_driver_sample_multisample_target`: Failed - `agc_driver_tessellation`: SEGFAULT
MarcZX10 commented 2026-10-21 09:39:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T09:39:04Z.


The overlap report is valid: #8716 touches the StoreTexel SINT conversion guard, and #6218 changes storage-format materialization in ResourceMaterializer.cpp. Their purposes are separate from this PR's write-only 16-bit-float storage path; #8998 does not depend on either one. If one merges first, I will resolve any textual conflict against the updated main and rerun the focused validation. I have not marked a dependency because neither change is required for this fix.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312849451 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312849451). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T09:39:04Z. --- The overlap report is valid: #8716 touches the `StoreTexel` SINT conversion guard, and #6218 changes storage-format materialization in `ResourceMaterializer.cpp`. Their purposes are separate from this PR's write-only 16-bit-float storage path; #8998 does not depend on either one. If one merges first, I will resolve any textual conflict against the updated `main` and rerun the focused validation. I have not marked a dependency because neither change is required for this fix.
MarcZX10 commented 2026-10-21 09:41:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T09:41:13Z.


Thanks for rerunning the corrected head. The focused pass on the RX 7900 XTX confirms the UINT storage-view fix for all three float16 formats; I updated the PR description with your exact-head result. I recorded the other test failures separately and am not attributing them to this change without their first failing assertions.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6312888342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6312888342). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T09:41:13Z. --- Thanks for rerunning the corrected head. The focused pass on the RX 7900 XTX confirms the UINT storage-view fix for all three float16 formats; I updated the PR description with your exact-head result. I recorded the other test failures separately and am not attributing them to this change without their first failing assertions.
LeandroLP23 commented 2026-10-21 10:17:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T10:17:57Z.


An AMD proprietary-driver run, with the red control. Radeon 860M (RDNA 3.5, 1002:1114), AMD Windows driver 32.0.13058.8001, Windows 11 26300, WinLibs GCC 15.2.0, Release, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, full builds, three runs each.

Edit: an earlier version of this comment read the row-1 failure below as a Windows write-back difference. That was wrong; the test's expectation for the masked component is what fails.

As written, the test fails the same way on main and on this PR:

AGC graphics: image_store of 16_16_FLOAT: texel (0, 1) component 1 is 0, expected 23130

Row 1 stores with dmask 0x5. For a two-channel format, component 1 isn't in the mask, and ExpectedComponent expects it to keep the 0x5a5a fill. The hardware writes zero there instead. ACO's visit_image_store says so (Mesa 24.2, src/amd/compiler/aco_instruction_selection.cpp):

/* components not in dmask receive:
 * GFX6-11.5:  zero
 * GFX12+: first component in dmask
 */

ACO relies on this to drop constant-zero components from the store's dmask. main's ImageConvertedUnorm image_store dmask:0x5 case already expects zero for the missing component. StoreTexel also passes 0 for unselected components, so AnyPS5 matches GFX10. So ExpectedComponent should return 0 for a component outside dmask, not 0x5a5a. I can't reconcile that with the RADV pass reported above: ACO zeroes that component as well.

With that one line changed (return 0u; instead of return 0x5a5au;, locally, not pushed):

Tree agc_driver_image_store_float_rounding
main 27fabb6b7d + the test from 268bfc012f passes 3/3
main 27fabb6b7d + this PR at 268bfc012f (clean merge) passes 3/3

So on AMD's Windows driver the host's f32→f16 storage conversion already gives the round-toward-zero results for every edge value in the test, including 65520 → 0x7bff and the NaN payloads. The red control isn't red here, and the PR changes nothing on this driver. It is still needed wherever the host rounds to nearest. A red run on RADV or NVIDIA with the corrected expectation would show that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6313574149 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6313574149). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-21T10:17:57Z. --- An AMD proprietary-driver run, with the red control. Radeon 860M (RDNA 3.5, `1002:1114`), AMD Windows driver 32.0.13058.8001, Windows 11 26300, WinLibs GCC 15.2.0, Release, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, full builds, three runs each. **Edit:** an earlier version of this comment read the row-1 failure below as a Windows write-back difference. That was wrong; the test's expectation for the masked component is what fails. **As written, the test fails the same way on `main` and on this PR**: ``` AGC graphics: image_store of 16_16_FLOAT: texel (0, 1) component 1 is 0, expected 23130 ``` Row 1 stores with `dmask` 0x5. For a two-channel format, component 1 isn't in the mask, and `ExpectedComponent` expects it to keep the 0x5a5a fill. The hardware writes zero there instead. ACO's `visit_image_store` says so (Mesa 24.2, `src/amd/compiler/aco_instruction_selection.cpp`): ``` /* components not in dmask receive: * GFX6-11.5: zero * GFX12+: first component in dmask */ ``` ACO relies on this to drop constant-zero components from the store's `dmask`. `main`'s `ImageConvertedUnorm` `image_store dmask:0x5` case already expects zero for the missing component. `StoreTexel` also passes 0 for unselected components, so AnyPS5 matches GFX10. So `ExpectedComponent` should return 0 for a component outside `dmask`, not 0x5a5a. I can't reconcile that with the RADV pass reported above: ACO zeroes that component as well. **With that one line changed** (`return 0u;` instead of `return 0x5a5au;`, locally, not pushed): | Tree | `agc_driver_image_store_float_rounding` | |---|---| | `main` `27fabb6b7d` + the test from `268bfc012f` | passes 3/3 | | `main` `27fabb6b7d` + this PR at `268bfc012f` (clean merge) | passes 3/3 | So on AMD's Windows driver the host's f32→f16 storage conversion already gives the round-toward-zero results for every edge value in the test, including 65520 → 0x7bff and the NaN payloads. The red control isn't red here, and the PR changes nothing on this driver. It is still needed wherever the host rounds to nearest. A red run on RADV or NVIDIA with the corrected expectation would show that.
LeandroLP23 commented 2026-10-21 11:29:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T11:29:38Z.


@MarcZX10 I corrected my earlier comment above. The row-1 failure isn't a Windows write-back difference: the test expects the component outside dmask to keep 0x5a5a, but GFX6–11.5 hardware writes zero there (ACO's visit_image_store), as ImageConvertedUnorm's dmask:0x5 case already expects. With that expectation changed to 0, the test passes 3/3 on AMD's Windows driver on main and with this PR, so this driver already rounds toward zero and the red control has to come from a host that rounds to nearest.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6314817722 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6314817722). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-21T11:29:38Z. --- @MarcZX10 I corrected my earlier comment above. The row-1 failure isn't a Windows write-back difference: the test expects the component outside `dmask` to keep 0x5a5a, but GFX6–11.5 hardware writes zero there (ACO's `visit_image_store`), as `ImageConvertedUnorm`'s `dmask:0x5` case already expects. With that expectation changed to 0, the test passes 3/3 on AMD's Windows driver on `main` and with this PR, so this driver already rounds toward zero and the red control has to come from a host that rounds to nearest.
MarcZX10 commented 2026-10-21 11:54:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T11:54:21Z.


Fixed in follow-up commit 3764883214: the execution test now expects zero for components omitted by the dmask, matching the behavior documented for this hardware generation and the existing ImageConvertedUnorm case. The focused target builds successfully on my Linux host. I attempted the CTest run, but this machine lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA, so the test aborts before Vulkan initialization; no local GPU result is claimed. Hosted conventions, eligibility, labels and report checks are pending for the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315267478 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6315267478). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T11:54:21Z. --- Fixed in follow-up commit 3764883214: the execution test now expects zero for components omitted by the dmask, matching the behavior documented for this hardware generation and the existing ImageConvertedUnorm case. The focused target builds successfully on my Linux host. I attempted the CTest run, but this machine lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA, so the test aborts before Vulkan initialization; no local GPU result is claimed. Hosted conventions, eligibility, labels and report checks are pending for the new head.
thuanquang commented 2026-10-21 12:27:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T12:27:15Z.


RDNA 2 measurement behind 3764883214 (zero for the components outside dmask).

Raw ISA on an RX 6700 XT (gfx1031) through the HIP runtime of AMD's Windows driver 32.0.21045.5002:

  • The image memory was filled with 0x5a.
  • One image_store ran per dmask, from 0x1 to 0xf, with data (0.25, 0.5, 0.75, 1.0) in v[4:7].
  • Each texel was read back through a UINT T# of the same memory.

With the swizzles this test uses (0xfac for one and four channels, 0x22c for two):

  • Components outside dmask read 0, never the 0x5a fill.
  • The enabled components take the data VGPRs in order.
  • Data for a component the format doesn't have is dropped.

This holds for 16_FLOAT, 16_16_FLOAT and 16_16_16_16_FLOAT, and also for 16_16_UNORM, 8_8_8_8_UNORM, 32_FLOAT, 32_32_FLOAT and 32_32_32_32_FLOAT. For example, 16_16_FLOAT with swizzle 0x22c, dmask 0x5 and data (0.25, 0.5) stores 0x00003400. Component 1 is 0, and the 0.5 meant for component 2 is dropped.

A side observation that doesn't affect this test: under 0xfac, a two-channel format writes component 1 from data component 3 (W) and ignores data component 1. 16_16_FLOAT with dmask 0x3 stores 0x00003400, and with dmask 0x9 and data (0.25, 0.5) it stores 0x38003400. StoreTexel takes component 1 from data component 1 for that swizzle.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6315878292 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6315878292). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T12:27:15Z. --- RDNA 2 measurement behind `3764883214` (zero for the components outside `dmask`). Raw ISA on an RX 6700 XT (gfx1031) through the HIP runtime of AMD's Windows driver 32.0.21045.5002: - The image memory was filled with `0x5a`. - One `image_store` ran per `dmask`, from 0x1 to 0xf, with data (0.25, 0.5, 0.75, 1.0) in `v[4:7]`. - Each texel was read back through a UINT T# of the same memory. With the swizzles this test uses (0xfac for one and four channels, 0x22c for two): - Components outside `dmask` read 0, never the `0x5a` fill. - The enabled components take the data VGPRs in order. - Data for a component the format doesn't have is dropped. This holds for `16_FLOAT`, `16_16_FLOAT` and `16_16_16_16_FLOAT`, and also for `16_16_UNORM`, `8_8_8_8_UNORM`, `32_FLOAT`, `32_32_FLOAT` and `32_32_32_32_FLOAT`. For example, `16_16_FLOAT` with swizzle 0x22c, `dmask` 0x5 and data (0.25, 0.5) stores 0x00003400. Component 1 is 0, and the 0.5 meant for component 2 is dropped. A side observation that doesn't affect this test: under 0xfac, a two-channel format writes component 1 from data component 3 (W) and ignores data component 1. `16_16_FLOAT` with `dmask` 0x3 stores 0x00003400, and with `dmask` 0x9 and data (0.25, 0.5) it stores 0x38003400. `StoreTexel` takes component 1 from data component 1 for that swizzle.
gdols commented 2026-10-21 14:26:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gdols on 2026-10-21T14:26:30Z.


NVIDIA, Windows. GeForce RTX 3080, driver 616.92, Windows 11 Pro 26300, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, main 80565c594 (+ #8310 to build), this PR at 3764883214. ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1; the focused runs also under VK_LAYER_KHRONOS_validation (SDK 1.4.363.0, inserted in each run per VK_LOADER_DEBUG=layer).

Build. This PR doesn't build on current main. #8975, merged after this PR's base 27c88a8d7, added resident->StorageView(0, false) to RunDepthCopyPass, and this PR gives StorageView a third parameter:

Draw.cpp:2979:108: error: no matching function for call to 'AgcDriver::Graphics::StorageTexture::StorageView(int, bool)'

The merge is textually clean, so GitHub shows no conflict. For the runs below I passed false there locally: DecodeDepthCopyPass requires VK_FORMAT_R32_SFLOAT, for which main already returns the native view.

Red control on NVIDIA. main + only ImageStoreFloatRounding.cpp from this PR: agc_driver_image_store_float_rounding passes 3 of 3, with no validation messages. As on AMD's Windows driver, the red control has to come from a host that rounds to nearest.

With this PR: the same test passes 3 of 3, with no validation messages.

Regression. agc_driver_sample_multisample_target fails 10 of 10 with this PR and passes 10 of 10 on main:

AGC graphics: sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target

Under the layer it logs 8 VUID-vkCmdDispatch-format-07753 messages, none on main:

vkCmdDispatch(): the storage image descriptor [VkDescriptorSet 0x1ca00000001ca, Set 0, Binding 40, Index 0, variable "image_40"] requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT.

From the code: rawFloat16Storage in ResourceMaterializer makes every write-only 16-bit float storage image UINT, whatever its dimension, but a k2DMsaa storage texture gets its view from MultisampleTargetStorageView (ShaderResources.cpp:4716 on main), which this PR doesn't change and which returns the native SFLOAT view. That may also be the agc_driver_sample_multisample_target failure in the RADV run in the description.

^agc_: main 870 passed, 3 skipped, 3 failed (876 tests); this PR 870 passed, 3 skipped, 4 failed (877, with the new test). The three failing on both are agc_driver_sample_order*, fixed by #9056; the fourth is the one above.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6318519163 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6318519163). Originally posted by [gdols](https://github.com/gdols) on 2026-10-21T14:26:30Z. --- NVIDIA, Windows. GeForce RTX 3080, driver 616.92, Windows 11 Pro 26300, Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, `main` 80565c594 (+ #8310 to build), this PR at 3764883214. `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`; the focused runs also under `VK_LAYER_KHRONOS_validation` (SDK 1.4.363.0, inserted in each run per `VK_LOADER_DEBUG=layer`). **Build.** This PR doesn't build on current `main`. #8975, merged after this PR's base 27c88a8d7, added `resident->StorageView(0, false)` to `RunDepthCopyPass`, and this PR gives `StorageView` a third parameter: ``` Draw.cpp:2979:108: error: no matching function for call to 'AgcDriver::Graphics::StorageTexture::StorageView(int, bool)' ``` The merge is textually clean, so GitHub shows no conflict. For the runs below I passed `false` there locally: `DecodeDepthCopyPass` requires `VK_FORMAT_R32_SFLOAT`, for which `main` already returns the native view. **Red control on NVIDIA.** `main` + only `ImageStoreFloatRounding.cpp` from this PR: `agc_driver_image_store_float_rounding` passes 3 of 3, with no validation messages. As on AMD's Windows driver, the red control has to come from a host that rounds to nearest. **With this PR:** the same test passes 3 of 3, with no validation messages. **Regression.** `agc_driver_sample_multisample_target` fails 10 of 10 with this PR and passes 10 of 10 on `main`: ``` AGC graphics: sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target ``` Under the layer it logs 8 `VUID-vkCmdDispatch-format-07753` messages, none on `main`: ``` vkCmdDispatch(): the storage image descriptor [VkDescriptorSet 0x1ca00000001ca, Set 0, Binding 40, Index 0, variable "image_40"] requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT. ``` From the code: `rawFloat16Storage` in `ResourceMaterializer` makes every write-only 16-bit float storage image UINT, whatever its dimension, but a `k2DMsaa` storage texture gets its view from `MultisampleTargetStorageView` (`ShaderResources.cpp:4716` on `main`), which this PR doesn't change and which returns the native `SFLOAT` view. That may also be the `agc_driver_sample_multisample_target` failure in the RADV run in the description. **`^agc_`:** `main` 870 passed, 3 skipped, 3 failed (876 tests); this PR 870 passed, 3 skipped, 4 failed (877, with the new test). The three failing on both are `agc_driver_sample_order*`, fixed by #9056; the fourth is the one above. AI-assisted: yes
MaxLikesCode commented 2026-10-21 16:53:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MaxLikesCode on 2026-10-21T16:53:55Z.


Confirming @gdols's results on a second NVIDIA card, an RTX 4090 (Ada), at head 376488321 merged onto main cecb540a6, with the same one-argument change at Draw.cpp:2979 (resident->StorageView(0, false, false)) so that it builds:

  • agc_driver_image_store_float_rounding passes 6 of 6 (3 runs without, 3 with the validation layer), no VUID-. agc_driver_image_repacked_float, agc_driver_image_converted_unorm and texture_format_lookup pass 6 of 6 on main and with this PR, and agc_driver_depth_storage, _dispatch and _reuse (the #8975 depth-copy path) pass 3 of 3 under the layer with that false.
  • agc_driver_sample_multisample_target regresses here too: 6 of 6 on main, 0 of 6 with this PR (sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target). Each validation run logs the same 8 VUID-vkCmdDispatch-format-07753 messages, requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT, and main logs none.

NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ctest --test-dir build -R <tests> -V. Validation runs add VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan-ValidationLayers vulkan-sdk-1.4.363.0, implicit layers disabled); the loader log shows the layer inserted in every Vulkan test process, and no log has was not found but was requested by env var VK_INSTANCE_LAYERS.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321583848 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6321583848). Originally posted by [MaxLikesCode](https://github.com/MaxLikesCode) on 2026-10-21T16:53:55Z. --- Confirming @gdols's results on a second NVIDIA card, an RTX 4090 (Ada), at head `376488321` merged onto `main` `cecb540a6`, with the same one-argument change at `Draw.cpp:2979` (`resident->StorageView(0, false, false)`) so that it builds: - `agc_driver_image_store_float_rounding` passes 6 of 6 (3 runs without, 3 with the validation layer), no `VUID-`. `agc_driver_image_repacked_float`, `agc_driver_image_converted_unorm` and `texture_format_lookup` pass 6 of 6 on `main` and with this PR, and `agc_driver_depth_storage`, `_dispatch` and `_reuse` (the #8975 depth-copy path) pass 3 of 3 under the layer with that `false`. - `agc_driver_sample_multisample_target` regresses here too: 6 of 6 on `main`, 0 of 6 with this PR (`sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target`). Each validation run logs the same 8 `VUID-vkCmdDispatch-format-07753` messages, `requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT`, and `main` logs none. NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `ctest --test-dir build -R <tests> -V`. Validation runs add `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Vulkan-ValidationLayers `vulkan-sdk-1.4.363.0`, implicit layers disabled); the loader log shows the layer inserted in every Vulkan test process, and no log has `was not found but was requested by env var VK_INSTANCE_LAYERS`. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-21 17:06:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T17:06:24Z.


Thanks for the careful repro on both NVIDIA cards. I’ve pushed commit 7081834388 to address both findings: the existing two-argument StorageView call now defaults to the native view, and the multisample storage descriptor uses the UINT-compatible view with storage-only view usage when the binding is in the converted float16 range. The multisample image enables mutable and extended usage and checks UINT storage support at its sample count.

The updated head builds agc_driver_sample_multisample_target_tests on Linux. I attempted the focused CTest run with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation, but this host exits before Vulkan initialization because it lacks BMI1, BMI2, LZCNT, MOVBE, AVX2 and FMA. Could you rerun agc_driver_sample_multisample_target and agc_driver_image_store_float_rounding on 7081834388 with validation enabled and share the pass counts and any VUIDs?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6321837851 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6321837851). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T17:06:24Z. --- Thanks for the careful repro on both NVIDIA cards. I’ve pushed commit `7081834388` to address both findings: the existing two-argument `StorageView` call now defaults to the native view, and the multisample storage descriptor uses the UINT-compatible view with storage-only view usage when the binding is in the converted float16 range. The multisample image enables mutable and extended usage and checks UINT storage support at its sample count. The updated head builds `agc_driver_sample_multisample_target_tests` on Linux. I attempted the focused CTest run with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_LAYER_KHRONOS_validation`, but this host exits before Vulkan initialization because it lacks BMI1, BMI2, LZCNT, MOVBE, AVX2 and FMA. Could you rerun `agc_driver_sample_multisample_target` and `agc_driver_image_store_float_rounding` on `7081834388` with validation enabled and share the pass counts and any VUIDs?
thuanquang commented 2026-10-21 18:43:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T18:43:50Z.


AMD Windows rerun at 7081834388, as asked above, merged onto main b00235dda0 (clean merge). For comparison I also ran main alone and the earlier head 376488321, merged the same way with the one-argument Draw.cpp:2979 change it needs to build (StorageView(0, false, false)).

RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release, ANYPS5_REQUIRE_VULKAN=1.

  • Each set ran 3 times without and 3 times with VK_LAYER_KHRONOS_validation.
  • The layer is built from source, with implicit layers disabled and ANYPS5_NO_SHADER_CACHE=1.
  • VK_LOADER_DEBUG=layer shows the layer inserted in every Vulkan test process, with no "was not found" line.

Each cell gives the plain runs, then the validation runs:

main 376488321 7081834388
agc_driver_sample_multisample_target 3/3, 3/3 fails on the first run, 0/3 3/3, 3/3
agc_driver_image_store_float_rounding not on main 3/3, 3/3 3/3, 3/3
agc_driver_native_msaa_vertex_input, agc_driver_image_repacked_float, agc_driver_image_converted_unorm, texture_format_lookup, agc_driver_depth_storage, _dispatch, _reuse 3/3, 3/3 3/3, 3/3 3/3, 3/3
VUID- lines over the 3 validation runs 0 48 0

At 376488321 the multisample test fails here as on NVIDIA:

AGC graphics: sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target

Each validation run logs 16 VUID-vkCmdDispatch-format-07753 (requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT). The plain runs stop at the first failure.

At 7081834388 both are gone. The test's store case passes: "stores to one sample of each pixel of a drawn 4x target and to samples of zeroed color memory no draw rendered to reach exactly those samples".

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323781411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6323781411). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-21T18:43:50Z. --- AMD Windows rerun at `7081834388`, as asked above, merged onto `main` `b00235dda0` (clean merge). For comparison I also ran `main` alone and the earlier head `376488321`, merged the same way with the one-argument `Draw.cpp:2979` change it needs to build (`StorageView(0, false, false)`). RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2 Release, `ANYPS5_REQUIRE_VULKAN=1`. - Each set ran 3 times without and 3 times with `VK_LAYER_KHRONOS_validation`. - The layer is built from source, with implicit layers disabled and `ANYPS5_NO_SHADER_CACHE=1`. - `VK_LOADER_DEBUG=layer` shows the layer inserted in every Vulkan test process, with no "was not found" line. Each cell gives the plain runs, then the validation runs: | | `main` | `376488321` | `7081834388` | |---|---|---|---| | `agc_driver_sample_multisample_target` | 3/3, 3/3 | fails on the first run, 0/3 | 3/3, 3/3 | | `agc_driver_image_store_float_rounding` | not on `main` | 3/3, 3/3 | 3/3, 3/3 | | `agc_driver_native_msaa_vertex_input`, `agc_driver_image_repacked_float`, `agc_driver_image_converted_unorm`, `texture_format_lookup`, `agc_driver_depth_storage`, `_dispatch`, `_reuse` | 3/3, 3/3 | 3/3, 3/3 | 3/3, 3/3 | | `VUID-` lines over the 3 validation runs | 0 | 48 | 0 | At `376488321` the multisample test fails here as on NVIDIA: ``` AGC graphics: sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target ``` Each validation run logs 16 `VUID-vkCmdDispatch-format-07753` (`requires UINT component type, but bound descriptor format is VK_FORMAT_R16G16B16A16_SFLOAT`). The plain runs stop at the first failure. At `7081834388` both are gone. The test's store case passes: "stores to one sample of each pixel of a drawn 4x target and to samples of zeroed color memory no draw rendered to reach exactly those samples".
jotitadev commented 2026-10-21 22:45:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-21T22:45:36Z.

Review: COMMENTED


The red control you were missing, from a round-to-nearest host: Apple M2 Max (Metal via MoltenVK).

Machine: Apple M2 Max (vendor=0x106b device=0x1b020208, subgroup 32), macOS 27.2, x86_64 under Rosetta 2. MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0). Release, BUILD_TESTING=ON.

Base/method: PR #8658 feat/macos-port @ 4ebe71f2e5 (current main 0c6a5bd593 + the macOS port), not main. This PR (708183438) applied on top, clean, on its own (not stacked with other image PRs).

With this PR: agc_driver_image_store_float_rounding passes 3/3 (--repeat until-fail:3), image store float rounding tests passed. Because the write-only 16-bit-float store now converts to f16 in the shader and writes through the UINT view, the rounding is done in SPIR-V and is independent of the host's native image-store rounding.

Red control (round-to-nearest host): with only this PR's production files reverted to base and the new test kept — so the store goes back through the native SFLOAT view and Metal rounds the texel — the test fails:

AGC graphics: image_store of 16_16_16_16_FLOAT: texel (3, 0) component 2 is 32256, expected 32265

i.e. Metal stored 0x7e00 where round-toward-zero wants 0x7e09. So on this GPU the native path does not round toward zero, which is the case the RADV and AMD/NVIDIA-Windows runs above could not exercise, and the test does catch the difference.

agc_driver_sample_multisample_target is skipped here (MoltenVK does not expose shaderStorageImageMultisample), so the multisample-view regression seen earlier on NVIDIA does not manifest on this host — it is not re-tested, not fixed, on Apple. agc_shader_memory passes.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2).

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607143934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#pullrequestreview-5607143934). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-21T22:45:36Z. **Review:** COMMENTED --- The red control you were missing, from a round-to-nearest host: Apple M2 Max (Metal via MoltenVK). **Machine:** Apple M2 Max (`vendor=0x106b device=0x1b020208`, subgroup 32), macOS 27.2, x86_64 under Rosetta 2. MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0). Release, `BUILD_TESTING=ON`. **Base/method:** PR #8658 `feat/macos-port` @ `4ebe71f2e5` (current `main` `0c6a5bd593` + the macOS port), not `main`. This PR (`708183438`) applied on top, clean, on its own (not stacked with other image PRs). **With this PR:** `agc_driver_image_store_float_rounding` passes 3/3 (`--repeat until-fail:3`), `image store float rounding tests passed`. Because the write-only 16-bit-float store now converts to f16 in the shader and writes through the UINT view, the rounding is done in SPIR-V and is independent of the host's native image-store rounding. **Red control (round-to-nearest host):** with only this PR's production files reverted to base and the new test kept — so the store goes back through the native `SFLOAT` view and Metal rounds the texel — the test fails: ``` AGC graphics: image_store of 16_16_16_16_FLOAT: texel (3, 0) component 2 is 32256, expected 32265 ``` i.e. Metal stored `0x7e00` where round-toward-zero wants `0x7e09`. So on this GPU the native path does not round toward zero, which is the case the RADV and AMD/NVIDIA-Windows runs above could not exercise, and the test does catch the difference. `agc_driver_sample_multisample_target` is **skipped** here (MoltenVK does not expose `shaderStorageImageMultisample`), so the multisample-view regression seen earlier on NVIDIA does not manifest on this host — it is not re-tested, not fixed, on Apple. `agc_shader_memory` passes. GPUs tested: Apple M2 Max (MoltenVK 1.4.2). Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
gdols commented 2026-10-22 07:33:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gdols on 2026-10-22T07:33:34Z.


Rerun at 7081834388 on the RTX 3080, as asked. GeForce RTX 3080, driver 616.92, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, main d6eafa54d, this PR applied on top (clean). ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. Every set ran 3 times without and 3 times with VK_LAYER_KHRONOS_validation (SDK 1.4.363.0); VK_LOADER_DEBUG=layer shows it inserted in every test that opens a device, and no log has was not found but was requested by env var VK_INSTANCE_LAYERS.

It builds as is now: the two-argument StorageView call in RunDepthCopyPass takes the new default.

main main + the test only this PR
agc_driver_sample_multisample_target 3/3, 3/3 3/3, 3/3
agc_driver_image_store_float_rounding 3/3, 3/3 3/3, 3/3
24 related tests: agc_driver_native_msaa_vertex_input, _image_repacked_float, _image_converted_unorm, texture_format_lookup, agc_driver_depth_storage, _dispatch, _reuse, and the other 17 agc_*multisample* tests 3/3, 3/3 each 3/3, 3/3 each
VUID- messages over the validation runs 0 0 0

So the multisample regression from 3764883214 (10 of 10 failures, and 8 VUID-vkCmdDispatch-format-07753 in its validation run) is gone here too, and the other agc_*multisample* tests pass, now that this head changes the creation flags of SINT and 16-bit float multisample targets.

^agc_: main 884 passed, 3 skipped, 3 failed (890 tests); this PR 884 passed, 3 skipped, 4 failed (891). The three on both are agc_driver_sample_order*, fixed by #9056. The fourth, agc_driver_pipelined_dispatch_item, fails before it submits anything, with "the two targets do not share their high address dword": its two VirtualAlloc blocks got different high address dwords. In isolation it fails 1 of 20 with this PR and 1 of 40 on main, with the same message, so it isn't this change.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6335344362 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6335344362). Originally posted by [gdols](https://github.com/gdols) on 2026-10-22T07:33:34Z. --- Rerun at `7081834388` on the RTX 3080, as asked. GeForce RTX 3080, driver 616.92, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, `main` d6eafa54d, this PR applied on top (clean). `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`. Every set ran 3 times without and 3 times with `VK_LAYER_KHRONOS_validation` (SDK 1.4.363.0); `VK_LOADER_DEBUG=layer` shows it inserted in every test that opens a device, and no log has `was not found but was requested by env var VK_INSTANCE_LAYERS`. It builds as is now: the two-argument `StorageView` call in `RunDepthCopyPass` takes the new default. | | `main` | `main` + the test only | this PR | |---|---|---|---| | `agc_driver_sample_multisample_target` | 3/3, 3/3 | | 3/3, 3/3 | | `agc_driver_image_store_float_rounding` | | 3/3, 3/3 | 3/3, 3/3 | | 24 related tests: `agc_driver_native_msaa_vertex_input`, `_image_repacked_float`, `_image_converted_unorm`, `texture_format_lookup`, `agc_driver_depth_storage`, `_dispatch`, `_reuse`, and the other 17 `agc_*multisample*` tests | 3/3, 3/3 each | | 3/3, 3/3 each | | `VUID-` messages over the validation runs | 0 | 0 | 0 | So the multisample regression from `3764883214` (10 of 10 failures, and 8 `VUID-vkCmdDispatch-format-07753` in its validation run) is gone here too, and the other `agc_*multisample*` tests pass, now that this head changes the creation flags of SINT and 16-bit float multisample targets. `^agc_`: `main` 884 passed, 3 skipped, 3 failed (890 tests); this PR 884 passed, 3 skipped, 4 failed (891). The three on both are `agc_driver_sample_order*`, fixed by #9056. The fourth, `agc_driver_pipelined_dispatch_item`, fails before it submits anything, with "the two targets do not share their high address dword": its two `VirtualAlloc` blocks got different high address dwords. In isolation it fails 1 of 20 with this PR and 1 of 40 on `main`, with the same message, so it isn't this change. AI-assisted: yes
Dextroid17 commented 2026-10-22 11:05:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-22T11:05:04Z.


Linux, lavapipe as in CI's Linux job: Mesa 26.2.4 llvmpipe (LLVM 23.1.1, 256 bits) here, GALLIUM_OVERRIDE_CPU_CAPS=avx as in CI, i9-11900K, CachyOS, GCC 16.2.1, CMake 4.4.3, Ninja, Release, ANYPS5_ENABLE_SPIRV_TOOLS=ON. main 7e2ba73e4, this PR at 708183438 applied on top (merge a6c0904f4, clean). ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, -j1 --timeout 60; the validation runs under VK_LAYER_KHRONOS_validation 1.4.363, inserted in 25 of the 26 tests per VK_LOADER_DEBUG=layer (texture_format_lookup creates no instance). The 26 tests of @gdols's table above.

Head. 25 of 26 pass in each of 3 plain and 6 validation runs. agc_driver_image_store_float_rounding and agc_driver_sample_multisample_target pass 9 of 9, as do native_msaa_vertex_input, image_repacked_float, image_converted_unorm and the three depth_storage tests.

Red control, on a host where it fires. main sources (the 7 driver/recompiler files at 7e2ba73e4) + only ImageStoreFloatRounding.cpp from this PR: agc_driver_image_store_float_rounding fails 8 of 8 (3 plain, 3 validation, 2 validation with -V), always at the same texel:

AGC graphics: image_store of 16_16_16_16_FLOAT: texel (3, 0) component 3 is 32265, expected 31753

That slot is EdgeBits[15] = 0x7f812345, a signalling NaN. lavapipe's f32→f16 store (lp_build_float_to_half, F16C vcvtps2ph in truncate mode on this CPU) quiets it to 0x7e09; HalfTowardZero keeps the payload, 0x7c09. Check walks texels in order, so the 15 edge values before it pass on main without the UINT view, among them the 1 + 3·2⁻¹¹ tie (0x3f803000 → 0x3c01), 65520 (0x477ff000 → 0x7bff) and the quiet NaN (0x7fc12345). So lavapipe is red, but not as a host that rounds to nearest, which is what the AMD and NVIDIA red controls above were waiting for: it truncates like HalfTowardZero and differs only on the NaN quiet bit, and since the test stops at that first mismatch, the eight edge values after it (the subnormals among them) are not exercised on main here. The Linux job runs on pushes to main and is skipped on pull_request events, so it has not run on this head; after merge it would fail on a regression of this path, via the NaN slot alone.

Validation. Head and red control alike: one message per run, VUID-VkImageCreateInfo-samples-02258 from agc_driver_depth_storage creating a 2-sample D32_SFLOAT image that lavapipe does not support (sampleCounts 1|4|8). It is the test's own probe (DepthStorage.cpp:358-362, "unsupported two-sample source refused cleanly"), present on the main arm too, and not from this PR's views. No other VUID- lines in the 2,597-line -V logs.

Not this PR. agc_driver_multisample_retirement fails on both arms ("MSAA storage promotion did not retain its source image"), as it did on both arms of my #7747 matrix on main a6dcea927 on this host; it passes in CI's Linux job on main cc0078595 (run 39758811123), so it is a difference between this host's lavapipe and CI's, not a regression here; I have not isolated which.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339202410 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6339202410). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-22T11:05:04Z. --- Linux, lavapipe as in CI's Linux job: Mesa 26.2.4 llvmpipe (LLVM 23.1.1, 256 bits) here, `GALLIUM_OVERRIDE_CPU_CAPS=avx` as in CI, i9-11900K, CachyOS, GCC 16.2.1, CMake 4.4.3, Ninja, Release, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`. `main` 7e2ba73e4, this PR at 708183438 applied on top (merge a6c0904f4, clean). `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `-j1 --timeout 60`; the validation runs under `VK_LAYER_KHRONOS_validation` 1.4.363, inserted in 25 of the 26 tests per `VK_LOADER_DEBUG=layer` (`texture_format_lookup` creates no instance). The 26 tests of @gdols's table above. **Head.** 25 of 26 pass in each of 3 plain and 6 validation runs. `agc_driver_image_store_float_rounding` and `agc_driver_sample_multisample_target` pass 9 of 9, as do `native_msaa_vertex_input`, `image_repacked_float`, `image_converted_unorm` and the three `depth_storage` tests. **Red control, on a host where it fires.** `main` sources (the 7 driver/recompiler files at 7e2ba73e4) + only `ImageStoreFloatRounding.cpp` from this PR: `agc_driver_image_store_float_rounding` fails 8 of 8 (3 plain, 3 validation, 2 validation with `-V`), always at the same texel: ``` AGC graphics: image_store of 16_16_16_16_FLOAT: texel (3, 0) component 3 is 32265, expected 31753 ``` That slot is `EdgeBits[15]` = `0x7f812345`, a signalling NaN. lavapipe's f32→f16 store (`lp_build_float_to_half`, F16C `vcvtps2ph` in truncate mode on this CPU) quiets it to `0x7e09`; `HalfTowardZero` keeps the payload, `0x7c09`. `Check` walks texels in order, so the 15 edge values before it pass on `main` without the UINT view, among them the `1 + 3·2⁻¹¹` tie (`0x3f803000` → `0x3c01`), `65520` (`0x477ff000` → `0x7bff`) and the quiet NaN (`0x7fc12345`). So lavapipe is red, but not as a host that rounds to nearest, which is what the AMD and NVIDIA red controls above were waiting for: it truncates like `HalfTowardZero` and differs only on the NaN quiet bit, and since the test stops at that first mismatch, the eight edge values after it (the subnormals among them) are not exercised on `main` here. The Linux job runs on pushes to `main` and is skipped on pull_request events, so it has not run on this head; after merge it would fail on a regression of this path, via the NaN slot alone. **Validation.** Head and red control alike: one message per run, `VUID-VkImageCreateInfo-samples-02258` from `agc_driver_depth_storage` creating a 2-sample `D32_SFLOAT` image that lavapipe does not support (`sampleCounts` 1|4|8). It is the test's own probe (`DepthStorage.cpp:358-362`, "unsupported two-sample source refused cleanly"), present on the `main` arm too, and not from this PR's views. No other `VUID-` lines in the 2,597-line `-V` logs. **Not this PR.** `agc_driver_multisample_retirement` fails on both arms ("MSAA storage promotion did not retain its source image"), as it did on both arms of my #7747 matrix on `main` a6dcea927 on this host; it passes in CI's Linux job on `main` cc0078595 (run 39758811123), so it is a difference between this host's lavapipe and CI's, not a regression here; I have not isolated which. AI-assisted: yes
EdouardSence commented 2026-10-22 11:18:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-22T11:18:11Z.


RADV rerun at 7081834388, since the earlier RADV failure was clairtonmichel's RDNA3 run on the previous head.

RX 9070 XT (RDNA4, gfx1201), Mesa 26.2.4 RADV, Linux 7.3.0 (CachyOS), GCC, Release. This PR merged onto main 4777caca3 (clean). ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ctest -j1 --timeout 60, 3 runs. The validation layer isn't installed on this machine, so these are plain runs only.

Test this PR
agc_driver_image_store_float_rounding (16_FLOAT, 16_16_FLOAT, 16_16_16_16_FLOAT) 3/3
agc_driver_sample_multisample_target 3/3
agc_driver_native_msaa_vertex_input, _image_repacked_float, _image_converted_unorm, _depth_storage, _depth_storage_dispatch, _depth_storage_reuse 3/3 each
agc_driver_image_array_window_past_layer_limit 0/3, and 0/3 on main 4777caca3 alone

So the 16-bit float store regression on RADV is gone on this head. image_array_window_past_layer_limit fails the same way with and without this PR (thread 7 component 0 is 107.000000/255, expected 147/255), so it's the existing failure flagged on #6772, not this PR's.

Tested and written by Claude (AI assistant) on a contributor's machine.
AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339445408 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6339445408). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-22T11:18:11Z. --- RADV rerun at `7081834388`, since the earlier RADV failure was clairtonmichel's RDNA3 run on the previous head. RX 9070 XT (RDNA4, gfx1201), Mesa 26.2.4 RADV, Linux 7.3.0 (CachyOS), GCC, Release. This PR merged onto `main` 4777caca3 (clean). `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `ctest -j1 --timeout 60`, 3 runs. The validation layer isn't installed on this machine, so these are plain runs only. | Test | this PR | |---|---| | `agc_driver_image_store_float_rounding` (16_FLOAT, 16_16_FLOAT, 16_16_16_16_FLOAT) | 3/3 | | `agc_driver_sample_multisample_target` | 3/3 | | `agc_driver_native_msaa_vertex_input`, `_image_repacked_float`, `_image_converted_unorm`, `_depth_storage`, `_depth_storage_dispatch`, `_depth_storage_reuse` | 3/3 each | | `agc_driver_image_array_window_past_layer_limit` | 0/3, and 0/3 on `main` 4777caca3 alone | So the 16-bit float store regression on RADV is gone on this head. `image_array_window_past_layer_limit` fails the same way with and without this PR (`thread 7 component 0 is 107.000000/255, expected 147/255`), so it's the existing failure flagged on #6772, not this PR's. *Tested and written by Claude (AI assistant) on a contributor's machine.* AI-assisted: yes
ryanc2112 commented 2026-10-22 12:44:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ryanc2112 on 2026-10-22T12:44:04Z.


RADV / Polaris run at 708183438 (SteamOS 3.8.28, AMD Radeon RX 570 / Polaris10, Mesa 26.2.5, GCC 16.2.1, Release), merged onto main 4777caca3 (clean, builds without changes) vs main, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (loader confirms the layer is inserted).

  • agc_driver_image_store_float_rounding on unpatched main fails: image_store of 16_16_16_16_FLOAT: texel (3, 0) component 2 is 32767, expected 32265. With the PR it passes.
  • agc_driver_sample_multisample_target + agc_driver_image_store_float_rounding: 3/3 pass with the PR.
  • Focused set (agc_driver, agc_driver_image_converted_unorm, agc_driver_image_repacked_float, agc_driver_image_store_*, texture_format_lookup): 11/11 with the PR, 10/10 on main, zero VUID- on both.
  • All agc_* + texture_format_lookup (868 with the PR, 867 on main): identical failure set on both (image_plane_bias_on_single_level_volume (#9125), pixel_sample_iteration (#7825), sample_order_recipe_depth_locations, tessellation (Mesa, #5444), agc_idle_publish_wait), identical validation output (6× VUID-VkWriteDescriptorSet-descriptorType-00337 on both). No regressions observed.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6341050518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#issuecomment-6341050518). Originally posted by [ryanc2112](https://github.com/ryanc2112) on 2026-10-22T12:44:04Z. --- **RADV / Polaris run at `708183438`** (SteamOS 3.8.28, AMD Radeon RX 570 / Polaris10, Mesa 26.2.5, GCC 16.2.1, Release), merged onto `main` `4777caca3` (clean, builds without changes) vs `main`, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (loader confirms the layer is inserted). - `agc_driver_image_store_float_rounding` on unpatched `main` fails: `image_store of 16_16_16_16_FLOAT: texel (3, 0) component 2 is 32767, expected 32265`. With the PR it passes. - `agc_driver_sample_multisample_target` + `agc_driver_image_store_float_rounding`: 3/3 pass with the PR. - Focused set (`agc_driver`, `agc_driver_image_converted_unorm`, `agc_driver_image_repacked_float`, `agc_driver_image_store_*`, `texture_format_lookup`): 11/11 with the PR, 10/10 on `main`, zero `VUID-` on both. - All `agc_*` + `texture_format_lookup` (868 with the PR, 867 on `main`): identical failure set on both (`image_plane_bias_on_single_level_volume` (#9125), `pixel_sample_iteration` (#7825), `sample_order_recipe_depth_locations`, `tessellation` (Mesa, #5444), `agc_idle_publish_wait`), identical validation output (6× `VUID-VkWriteDescriptorSet-descriptorType-00337` on both). No regressions observed. AI-assisted: yes.
adriadam10 commented 2026-10-23 19:51:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-23T19:51:51Z.

Review: CHANGES_REQUESTED


The change looks right and the hardware data in #8282 and the host runs above support it, but the branch now conflicts with main after #6218 (packed storage images merged). Please rebase and resolve these three places, then rerun the focused tests:

  • Graphics/src/Texture.cpp (StorageTexture::StorageView): main now picks PackedStorageViewFormat(storageFormat) first and falls back to UintFormatOfSint. Keep the packed route unchanged and apply uintStorage only to the non-packed fallback, so the packed formats keep their view when the binding is outside the converted-float16 range.
  • Optimization/src/ResourceMaterializer.cpp (inspectImageDescriptor): main computes SampledTextureNumericClass(remappedFormat). rawFloat16Storage has to test the same remapped format that main now uses, not the raw format, otherwise a remapped descriptor takes a different path than the one the test covers.
  • Graphics/src/MultisampleTarget.cpp (the storage-support check next to the new twinFormat block): keep both the uintStorageSupported() condition and the twinFormat selection.

After the rebase, please post agc_driver_image_store_float_rounding and agc_driver_sample_multisample_target on the rebased head, plus the existing packed-storage tests from #6218, to show the two view routes still work together.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5633690623 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8998#pullrequestreview-5633690623). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-23T19:51:51Z. **Review:** CHANGES_REQUESTED --- The change looks right and the hardware data in #8282 and the host runs above support it, but the branch now conflicts with `main` after #6218 (packed storage images merged). Please rebase and resolve these three places, then rerun the focused tests: - `Graphics/src/Texture.cpp` (`StorageTexture::StorageView`): `main` now picks `PackedStorageViewFormat(storageFormat)` first and falls back to `UintFormatOfSint`. Keep the packed route unchanged and apply `uintStorage` only to the non-packed fallback, so the packed formats keep their view when the binding is outside the converted-float16 range. - `Optimization/src/ResourceMaterializer.cpp` (`inspectImageDescriptor`): `main` computes `SampledTextureNumericClass(remappedFormat)`. `rawFloat16Storage` has to test the same remapped format that `main` now uses, not the raw `format`, otherwise a remapped descriptor takes a different path than the one the test covers. - `Graphics/src/MultisampleTarget.cpp` (the storage-support check next to the new `twinFormat` block): keep both the `uintStorageSupported()` condition and the `twinFormat` selection. After the rebase, please post `agc_driver_image_store_float_rounding` and `agc_driver_sample_multisample_target` on the rebased head, plus the existing packed-storage tests from #6218, to show the two view routes still work together.
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!8998
No description provided.