fix(shader): translate ds_min/max/add_src2_f32 through dsSrc2 #14247

Merged
StarMrGamer merged 2 commits from upstream-pr/14247 into main 2026-11-06 16:54:10 +00:00
StarMrGamer commented 2026-11-01 03:41:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StarMrGamer on 2026-11-01T03:41:37Z.


What

ds_min_src2_f32, ds_max_src2_f32 and ds_add_src2_f32 threw at translation because LDS float atomics did not model the f32 denormal mode. Since 731575c802 dsAtomic sets flushDenormals and flushDenormalResults from FLOAT_MODE bits 4 and 5. dsSrc2 now sets the same two fields on the DS[A] atomic, and the three opcodes go through it with SharedAtomicFMin32, SharedAtomicFMax32 and SharedAtomicFAdd32. The 64-bit, GDS and offset1[7] forms still throw.

Source of the semantics: the f32 src2 forms are taken to be the measured ds_min_f32, ds_max_f32 and ds_add_f32 (RDNA2, gfx1035, the oracle's hardware) applied to DS[A] and DS[B], which is how the integer src2 forms were done. No RDNA2 part has the src2 opcodes, so they are not measured on GFX10.1; the DS src2 entry in docs/dev/debt/shader.md now says so instead of giving the obsolete reason. This is the inference the question in #14089 asks about.

agc_driver_lds_src2 replaces the check that the f32 forms are refused with an execution check: for each op it stores the denormals 0x1 and 0x2 in LDS, runs the src2 form and the non-src2 form on them under FLOAT_MODE 0x00 and 0x30, and requires that both forms give the same result in each mode and that the two modes differ (0 in both forms under 0x00; 1, 2 and 3 under 0x30). With the two dsSrc2 flush lines removed, it fails with lds src2: min differs from ds_min_f32 in mode 0x00000000.

#14085 rewords the same debt sentence; whichever lands second rebases.

Tested

Arch Linux, AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.5), GCC 16.2.1, Release.

  • ctest --test-dir build -R 'agc_driver_lds_src2|agc_driver_lds_float_atomic_modes|agc_driver_lds_add_f32' -V with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, on main dc9dc7eaae and on this branch on top of it: 3/3 passed on both, neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and neither has any VUID- line.
  • ctest -R 'lds|shader|recompiler|ds_' with ANYPS5_REQUIRE_VULKAN=1: 165/165 passed (2 skipped by the tests themselves).
  • No title tested.
  • Rebased onto 3741ca9327 afterwards; the 53 commits in between change none of the files this PR touches.

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 #14089
  • Unblocks: none
  • GPUs tested: AMD Radeon 780M (RDNA3, gfx1103), RADV PHOENIX, Mesa 26.2.5, Arch Linux (kernel 7.2.11)
  • AI-assisted: yes (Claude Code with DeepSeek V4.1 Flash)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5104080879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14247). Originally posted by [StarMrGamer](https://github.com/StarMrGamer) on 2026-11-01T03:41:37Z. --- ### What `ds_min_src2_f32`, `ds_max_src2_f32` and `ds_add_src2_f32` threw at translation because LDS float atomics did not model the f32 denormal mode. Since 731575c802 `dsAtomic` sets `flushDenormals` and `flushDenormalResults` from `FLOAT_MODE` bits 4 and 5. `dsSrc2` now sets the same two fields on the `DS[A]` atomic, and the three opcodes go through it with `SharedAtomicFMin32`, `SharedAtomicFMax32` and `SharedAtomicFAdd32`. The 64-bit, GDS and `offset1[7]` forms still throw. Source of the semantics: the f32 src2 forms are taken to be the measured `ds_min_f32`, `ds_max_f32` and `ds_add_f32` (RDNA2, gfx1035, the oracle's hardware) applied to `DS[A]` and `DS[B]`, which is how the integer src2 forms were done. No RDNA2 part has the src2 opcodes, so they are not measured on GFX10.1; the DS src2 entry in `docs/dev/debt/shader.md` now says so instead of giving the obsolete reason. This is the inference the question in #14089 asks about. `agc_driver_lds_src2` replaces the check that the f32 forms are refused with an execution check: for each op it stores the denormals `0x1` and `0x2` in LDS, runs the src2 form and the non-src2 form on them under `FLOAT_MODE` 0x00 and 0x30, and requires that both forms give the same result in each mode and that the two modes differ (0 in both forms under 0x00; 1, 2 and 3 under 0x30). With the two `dsSrc2` flush lines removed, it fails with `lds src2: min differs from ds_min_f32 in mode 0x00000000`. #14085 rewords the same debt sentence; whichever lands second rebases. ### Tested Arch Linux, AMD Radeon 780M (RADV PHOENIX, Mesa 26.2.5), GCC 16.2.1, Release. - `ctest --test-dir build -R 'agc_driver_lds_src2|agc_driver_lds_float_atomic_modes|agc_driver_lds_add_f32' -V` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, on `main` dc9dc7eaae and on this branch on top of it: 3/3 passed on both, neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and neither has any `VUID-` line. - `ctest -R 'lds|shader|recompiler|ds_'` with `ANYPS5_REQUIRE_VULKAN=1`: 165/165 passed (2 skipped by the tests themselves). - No title tested. - Rebased onto 3741ca9327 afterwards; the 53 commits in between change none of the files this PR touches. ### 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 #14089 - [x] Unblocks: none - [x] GPUs tested: AMD Radeon 780M (RDNA3, gfx1103), RADV PHOENIX, Mesa 26.2.5, Arch Linux (kernel 7.2.11) - [x] AI-assisted: yes (Claude Code with DeepSeek V4.1 Flash) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-01 03:48:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T03:48:31Z.

Review: DISMISSED


Reviewed — changes requested

The implementation and author-reported test evidence are plausible, but the PR overlaps #14085 and does not record an agreed landing order as the repository requires.

What I ran

Reviewed head 0f8ec048111e27629b48385e46b4e98cf6b3eca3 against PR base 5d3ad2112f60f35d463dc2c9d96d1c9d35871015. The fresh merge preview against current main 4a58bc29ad656ad7a54c1733b3b683e68b7ccf85 was clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or compile was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14247
python3 tools/pr_stack_check.py 14247 --repo boykopovar/AnyPS5
python3 tools/pr_abi_audit.py --repo boykopovar/AnyPS5 --base 5d3ad2112f60f35d463dc2c9d96d1c9d35871015 --head 0f8ec048111e27629b48385e46b4e98cf6b3eca3 --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp core/shader/recompiler/Translation/src/MemoryInstructions/MemoryInstructionDispatch.cpp core/shader/recompiler/Translation/src/MemoryInstructions/SharedMemoryInstructions.cpp docs/dev/debt/shader.md

Results

Check Result
git diff --check and conventions/template Passed in precheck.
Current-main merge preview Clean against 4a58bc29ad656ad7a54c1733b3b683e68b7ccf85; no declared dependency found.
ABI audit Could not run: the helper could not resolve this remote repository checkout from its --repo argument. No ABI change is claimed.
Test-quality heuristic Warned that LdsSrc2.cpp may be unregistered. This is a false positive: the execution tests are included through CMake's tests/execution/*.cpp glob and registered by agc_add_default_test.
Hosted CI at refresh eligibility, intake, report, and library-portability passed; conventions, labels, and the relinker/Windows build jobs were queued or in progress; Linux, register-context, and write-watch jobs were skipped. These statuses are hosted CI, not local runs.
Author-reported tests The PR reports paired focused Vulkan tests passing 3/3 on baseline and change, plus 165/165 LDS/shader tests (2 self-skips). These were not independently run.
Local build/tests Not run; the C++/Vulkan tests require built binaries and GPU execution.
Raw output excerpts

Precheck:

All conventions checks passed.
Head unchanged at completion: True
Base unchanged at completion: True

Fresh stack check:

Target branch tip: `4a58bc29ad656ad7a54c1733b3b683e68b7ccf85`
All heads unchanged: **True**
- PR #14247: **clean** against current base; head `0f8ec048111e27629b48385e46b4e98cf6b3eca3`; changed paths: none reported
No declared PR dependencies were found in the target PR chain.

ABI audit:

ABI audit unavailable: fatal: cannot change to '/marc/AnyPS5/boykopovar/AnyPS5': No such file or directory

Test-quality heuristic:

{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

Negative control

Assertion Change in control Result
The src2 float atomics follow the denormal-mode behavior of their existing ds counterparts The author reports removing the two new denormal-flush assignments The focused test reportedly failed with lds src2: min differs from ds_min_f32 in mode 0x00000000; not independently run.

Findings

Blocking: The PR changes the same DS src2 debt entry as open #14085. Its description says whichever lands second will rebase, but does not identify an agreed order, and its checklist says Depends on: none. The repository contribution rule asks authors of overlapping PRs to agree which lands first and record that dependency. Please coordinate with #14085's author and record the agreed order in the checklist.

Non-blocking: No implementation or test-source defect was found in the inspected changes.

Sources

Not verified

No local build, CTest, or GPU validation run was performed. The reported test runs are author-provided, not independently reproduced. Hosted CI was still in progress at the latest status refresh.

To get this to a good state

Coordinate with #14085's author and record which PR lands first. I will recheck the overlap and repeat applicable checks on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5726288328 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14247#pullrequestreview-5726288328). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T03:48:31Z. **Review:** DISMISSED --- # Reviewed — changes requested The implementation and author-reported test evidence are plausible, but the PR overlaps #14085 and does not record an agreed landing order as the repository requires. ## What I ran Reviewed head `0f8ec048111e27629b48385e46b4e98cf6b3eca3` against PR base `5d3ad2112f60f35d463dc2c9d96d1c9d35871015`. The fresh merge preview against current `main` `4a58bc29ad656ad7a54c1733b3b683e68b7ccf85` was clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or compile was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14247 python3 tools/pr_stack_check.py 14247 --repo boykopovar/AnyPS5 python3 tools/pr_abi_audit.py --repo boykopovar/AnyPS5 --base 5d3ad2112f60f35d463dc2c9d96d1c9d35871015 --head 0f8ec048111e27629b48385e46b4e98cf6b3eca3 --json python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp core/shader/recompiler/Translation/src/MemoryInstructions/MemoryInstructionDispatch.cpp core/shader/recompiler/Translation/src/MemoryInstructions/SharedMemoryInstructions.cpp docs/dev/debt/shader.md ``` ## Results | Check | Result | |---|---| | `git diff --check` and conventions/template | Passed in precheck. | | Current-main merge preview | Clean against `4a58bc29ad656ad7a54c1733b3b683e68b7ccf85`; no declared dependency found. | | ABI audit | Could not run: the helper could not resolve this remote repository checkout from its `--repo` argument. No ABI change is claimed. | | Test-quality heuristic | Warned that `LdsSrc2.cpp` may be unregistered. This is a false positive: the execution tests are included through CMake's `tests/execution/*.cpp` glob and registered by `agc_add_default_test`. | | Hosted CI at refresh | `eligibility`, `intake`, `report`, and `library-portability` passed; `conventions`, `labels`, and the relinker/Windows build jobs were queued or in progress; Linux, register-context, and write-watch jobs were skipped. These statuses are hosted CI, not local runs. | | Author-reported tests | The PR reports paired focused Vulkan tests passing 3/3 on baseline and change, plus 165/165 LDS/shader tests (2 self-skips). These were not independently run. | | Local build/tests | Not run; the C++/Vulkan tests require built binaries and GPU execution. | <details><summary>Raw output excerpts</summary> Precheck: ```text All conventions checks passed. Head unchanged at completion: True Base unchanged at completion: True ``` Fresh stack check: ```text Target branch tip: `4a58bc29ad656ad7a54c1733b3b683e68b7ccf85` All heads unchanged: **True** - PR #14247: **clean** against current base; head `0f8ec048111e27629b48385e46b4e98cf6b3eca3`; changed paths: none reported No declared PR dependencies were found in the target PR chain. ``` ABI audit: ```text ABI audit unavailable: fatal: cannot change to '/marc/AnyPS5/boykopovar/AnyPS5': No such file or directory ``` Test-quality heuristic: ```text { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` </details> ## Negative control | Assertion | Change in control | Result | |---|---|---| | The src2 float atomics follow the denormal-mode behavior of their existing ds counterparts | The author reports removing the two new denormal-flush assignments | The focused test reportedly failed with `lds src2: min differs from ds_min_f32 in mode 0x00000000`; not independently run. | ## Findings **Blocking:** The PR changes the same DS src2 debt entry as open #14085. Its description says whichever lands second will rebase, but does not identify an agreed order, and its checklist says `Depends on: none`. The repository contribution rule asks authors of overlapping PRs to agree which lands first and record that dependency. Please coordinate with #14085's author and record the agreed order in the checklist. **Non-blocking:** No implementation or test-source defect was found in the inspected changes. ## Sources - [Overlap/dependency rule at the PR base](https://github.com/boykopovar/AnyPS5/blob/5d3ad2112f60f35d463dc2c9d96d1c9d35871015/CONTRIBUTING.md#L70) - [#14247 debt-entry edit](https://github.com/boykopovar/AnyPS5/blob/0f8ec048111e27629b48385e46b4e98cf6b3eca3/docs/dev/debt/shader.md#L190) - [#14085 overlapping debt-entry edit](https://github.com/boykopovar/AnyPS5/blob/9e3a21ca5a81f48fcaaed9639466083495f0f06c/docs/dev/debt/shader.md#L190) - [Execution-test registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/0f8ec048111e27629b48385e46b4e98cf6b3eca3/core/libs/prx/libSceAgcDriver/tests/execution/CMakeLists.txt) ## Not verified No local build, CTest, or GPU validation run was performed. The reported test runs are author-provided, not independently reproduced. Hosted CI was still in progress at the latest status refresh. ## To get this to a good state Coordinate with #14085's author and record which PR lands first. I will recheck the overlap and repeat applicable checks on the updated head.
XairRrR commented 2026-11-03 12:38:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T12:38:49Z.

Review: DISMISSED


Reviewed — changes requested

The translation change is consistent with dsAtomic, but the rewritten agc_driver_lds_src2 fails on lavapipe, the device CI runs Vulkan tests on. Its add check requires a denormal f32 sum to be preserved, and whether that happens depends on the host.

What I ran

Head 0f8ec048111e27629b48385e46b4e98cf6b3eca3 merged with --no-ff into main 4f41f4c375f5abb487dbd184fbc150f31994d762 (merged tree 1ae4b75e47e4f689f8724fa932feacc07bd37f67). Debian 13 VM, 2× Xeon Gold 6136 (AVX2/FMA), GCC 14.2.0, Release, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19). No GPU.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...0f8ec048111e27629b48385e46b4e98cf6b3eca3
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
# selected tests, by the script, against the main baseline (with and without the Khronos validation layer)
env ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build --output-on-failure \
  -R "agc_driver_lds_src2|agc_driver_lds_float_atomic_modes|agc_driver_lds_add_f32|agc_driver_f32_denormal_flush"

Results

Check Result
git diff --check clean
check_conventions.py passed
Configure / build / libs passed
Selected tests (2146 ran) 2024 passed, 114 skipped (all expected). 1 new failure: agc_driver_lds_src2. 7 known failures also fail on main (agc_driver_f32_denormal_flush, agc_driver_division, …)
agc_driver_lds_src2, rerun by me failed (0.47 s): lds src2: add ignores the f32 denormal mode
agc_driver_lds_add_f32, agc_driver_lds_float_atomic_modes passed
Vulkan validation (770 tests, layer loaded in 769, none missing) no new VUID- lines compared with main
agc_driver_lds_src2 output
4/4 Test #1313: agc_driver_lds_src2 .................***Failed    0.47 sec
...
[gpu] open /dev/udmabuf: No such file or directory; shared direct memory is copied instead of imported, and GPU stores through FLAT/GLOBAL addresses do not reach it
AGC graphics: lds src2: add ignores the f32 denormal mode

The min/max checks and every "src2 form equals the non-src2 form" check pass before the failing assertion. So on this device the src2 translation gives the same results as ds_*_f32 in both modes. Only the "the two modes differ" check for add fails.

Negative control

I did not run one myself. The test already fails with the PR's production code on this device, so a revert could not tell me anything more here. bunbeans2-arch reports a 5/5 failure on an RX 9070 XT with the two source files restored from main, and the author reports a failure with the flush lines removed. I did not reproduce either.

Findings

Blocking

  1. agc_driver_lds_src2 fails on lavapipe because it requires a denormal sum to be preserved — core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp:156-160.
    • What fails: under FLOAT_MODE 0x30 the test expects 0x1 + 0x2 = 0x3, and it requires that this differ from the result under 0x00. lavapipe flushes the denormal result of the SPIR-V OpFAdd itself, so both modes give 0 and the Require fails.
    • Why it matters: CI runs Vulkan tests on lavapipe, so this test would fail on Linux CI and on every push to main.
    • Precedent in the tree: the existing LDS float tests treat preserved denormals as host-dependent and skip those rows. See HostDependent in LdsAddF32.cpp, which skips rows whose kept inputs or result are denormal. It then requires a minimum count of rows that do not depend on the host (line 177).
    • Suggested fix: keep the per-mode equality checks between the src2 and non-src2 forms for all three ops. Apply the "modes differ" check for add only when the device keeps denormals: either probe the device the way the other tests do, or skip that assertion when the kept result is a denormal. Alternatively, choose operands whose flushed and kept results differ without a denormal result, for example a denormal input added to a normal value, so the difference shows up in a normal result.

Non-blocking

None.

Regarding MarcZX10's blocking finding about the overlap with #14085: the author says #14085 dropped the DS src2 bullet. I cannot see #14085 from here, so I have not confirmed it.

Not verified

  • Behaviour on real AMD hardware. I have no GPU; I rely on the author's 780M run and bunbeans2-arch's RX 9070 XT run.
  • The semantics of the f32 src2 forms on GFX10.1. As the description and the debt entry say, they are inferred from RDNA2 measurements of ds_*_f32.
  • The negative control (see above).

To get this to a good state

  • Make the add "modes differ" assertion in CheckFloats independent of whether the host keeps denormals, as LdsAddF32.cpp does.
  • Run agc_driver_lds_src2 on lavapipe as well as on hardware.
  • Re-request review from MarcZX10 once the overlap is settled.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5752281954 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14247#pullrequestreview-5752281954). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T12:38:49Z. **Review:** DISMISSED --- # Reviewed — changes requested The translation change is consistent with `dsAtomic`, but the rewritten `agc_driver_lds_src2` fails on lavapipe, the device CI runs Vulkan tests on. Its `add` check requires a denormal f32 sum to be preserved, and whether that happens depends on the host. ## What I ran Head `0f8ec048111e27629b48385e46b4e98cf6b3eca3` merged with `--no-ff` into `main` `4f41f4c375f5abb487dbd184fbc150f31994d762` (merged tree `1ae4b75e47e4f689f8724fa932feacc07bd37f67`). Debian 13 VM, 2× Xeon Gold 6136 (AVX2/FMA), GCC 14.2.0, Release, Vulkan on lavapipe (Mesa 26.1.6, LLVM 19). No GPU. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...0f8ec048111e27629b48385e46b4e98cf6b3eca3 python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 # selected tests, by the script, against the main baseline (with and without the Khronos validation layer) env ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build --output-on-failure \ -R "agc_driver_lds_src2|agc_driver_lds_float_atomic_modes|agc_driver_lds_add_f32|agc_driver_f32_denormal_flush" ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Configure / build / libs | passed | | Selected tests (2146 ran) | 2024 passed, 114 skipped (all expected). **1 new failure: `agc_driver_lds_src2`.** 7 known failures also fail on `main` (`agc_driver_f32_denormal_flush`, `agc_driver_division`, …) | | `agc_driver_lds_src2`, rerun by me | **failed** (0.47 s): `lds src2: add ignores the f32 denormal mode` | | `agc_driver_lds_add_f32`, `agc_driver_lds_float_atomic_modes` | passed | | Vulkan validation (770 tests, layer loaded in 769, none missing) | no new `VUID-` lines compared with `main` | <details><summary>agc_driver_lds_src2 output</summary> ``` 4/4 Test #1313: agc_driver_lds_src2 .................***Failed 0.47 sec ... [gpu] open /dev/udmabuf: No such file or directory; shared direct memory is copied instead of imported, and GPU stores through FLAT/GLOBAL addresses do not reach it AGC graphics: lds src2: add ignores the f32 denormal mode ``` </details> The `min`/`max` checks and every "src2 form equals the non-src2 form" check pass before the failing assertion. So on this device the src2 translation gives the same results as `ds_*_f32` in both modes. Only the "the two modes differ" check for `add` fails. ## Negative control I did not run one myself. The test already fails with the PR's production code on this device, so a revert could not tell me anything more here. bunbeans2-arch reports a 5/5 failure on an RX 9070 XT with the two source files restored from `main`, and the author reports a failure with the flush lines removed. I did not reproduce either. ## Findings ### Blocking 1. **`agc_driver_lds_src2` fails on lavapipe because it requires a denormal sum to be preserved** — `core/libs/prx/libSceAgcDriver/tests/execution/LdsSrc2.cpp:156-160`. - **What fails:** under `FLOAT_MODE` 0x30 the test expects `0x1 + 0x2 = 0x3`, and it requires that this differ from the result under 0x00. lavapipe flushes the denormal result of the SPIR-V `OpFAdd` itself, so both modes give 0 and the `Require` fails. - **Why it matters:** CI runs Vulkan tests on lavapipe, so this test would fail on Linux CI and on every push to `main`. - **Precedent in the tree:** the existing LDS float tests treat preserved denormals as host-dependent and skip those rows. See `HostDependent` in [LdsAddF32.cpp](https://github.com/boykopovar/AnyPS5/blob/4f41f4c375f5abb487dbd184fbc150f31994d762/core/libs/prx/libSceAgcDriver/tests/execution/LdsAddF32.cpp#L146-L150), which skips rows whose kept inputs or result are denormal. It then requires a minimum count of rows that do not depend on the host ([line 177](https://github.com/boykopovar/AnyPS5/blob/4f41f4c375f5abb487dbd184fbc150f31994d762/core/libs/prx/libSceAgcDriver/tests/execution/LdsAddF32.cpp#L177-L177)). - **Suggested fix:** keep the per-mode equality checks between the src2 and non-src2 forms for all three ops. Apply the "modes differ" check for `add` only when the device keeps denormals: either probe the device the way the other tests do, or skip that assertion when the kept result is a denormal. Alternatively, choose operands whose flushed and kept results differ without a denormal result, for example a denormal input added to a normal value, so the difference shows up in a normal result. ### Non-blocking None. Regarding MarcZX10's blocking finding about the overlap with #14085: the author says #14085 dropped the DS src2 bullet. I cannot see #14085 from here, so I have not confirmed it. ## Not verified - Behaviour on real AMD hardware. I have no GPU; I rely on the author's 780M run and bunbeans2-arch's RX 9070 XT run. - The semantics of the f32 src2 forms on GFX10.1. As the description and the debt entry say, they are inferred from RDNA2 measurements of `ds_*_f32`. - The negative control (see above). ## To get this to a good state - Make the `add` "modes differ" assertion in `CheckFloats` independent of whether the host keeps denormals, as `LdsAddF32.cpp` does. - Run `agc_driver_lds_src2` on lavapipe as well as on hardware. - Re-request review from MarcZX10 once the overlap is settled. <!-- anyps5-bots job=3335 head=0f8ec048111e27629b48385e46b4e98cf6b3eca3 -->
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!14247
No description provided.