diff options
| author | Almogaver295 <133548141+guimsolutions@users.noreply.github.com> | 2026-11-23 23:53:36 +0100 |
|---|---|---|
| committer | Almogaver295 <133548141+guimsolutions@users.noreply.github.com> | 2026-11-23 23:53:36 +0100 |
| commit | 33f4a5aedeb48e27b004efe5d6ae306130d55cdd (patch) | |
| tree | 08361685151a2a6a4ecf9156955fabb35b4b570c /docs/testing.md | |
| parent | 57cb669f52ba6ca4bb58bf2e09492ffbe2b8ee60 (diff) | |
| parent | 5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (diff) | |
Merge upstream main and preserve 1D UAV clear compatibilityold-pr/9948
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 294 |
1 files changed, 254 insertions, 40 deletions
diff --git a/docs/testing.md b/docs/testing.md index 47a9f4a22..060869fd0 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -20,12 +20,16 @@ This page collects the setup steps and the problems testers have run into so far | |||
| 20 | - `llvm-21` in WSL, with `LLVM_MC` set to the whole command: | 20 | - `llvm-21` in WSL, with `LLVM_MC` set to the whole command: |
| 21 | `LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc"`. | 21 | `LLVM_MC="wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc"`. |
| 22 | 22 | ||
| 23 | On Linux and macOS, the distribution's or Homebrew's `llvm-mc` on `PATH` is enough, if it is 21 or newer. | 23 | On Linux, the distribution's `llvm-mc` on `PATH` is enough, if it is 21 or newer. On macOS, Homebrew's `llvm` is |
| 24 | keg-only, so `brew install llvm` doesn't put `llvm-mc` on `PATH`: the pytest suites find it in | ||
| 25 | `/opt/homebrew/opt/llvm*/bin` (or `/usr/local/opt/llvm*/bin` on Intel), and the other tools need | ||
| 26 | `LLVM_MC="$(brew --prefix llvm)/bin/llvm-mc"`. | ||
| 24 | 27 | ||
| 25 | An older `llvm-mc` is not enough for everything. Ubuntu 24.04's `llvm-18` (18.1.3) runs `run_gpu_tests.py`, | 28 | An older `llvm-mc` is not enough for everything. Ubuntu 24.04's default `llvm-18` (18.1.3) works for |
| 26 | `valu_fuzz.py --family mem` and `lds_fuzz.py`, but rejects `op_sel` on the 16-bit integer VOP3 forms that | 29 | `valu_fuzz.py --family mem` and `lds_fuzz.py`, but rejects `ps_sdwa_f16_const`. LLVM 19+ assembles the stock CI |
| 27 | `valu_fuzz.py --family f16` generates (`v_ashrrev_i16_e64 ... op_sel:[0,0,0]`: "not a valid operand"), so no f16 | 30 | test fixtures. However, full f16 fuzzing with `valu_fuzz.py --family f16` requires LLVM 21+, as LLVM 19 still |
| 28 | program assembles. 23.1.6 assembles them. | 31 | rejects `op_sel` on the 16-bit integer VOP3 forms that the fuzzer generates |
| 32 | (`v_ashrrev_i16_e64 ... op_sel:[0,0,0]`: "not a valid operand"). | ||
| 29 | 33 | ||
| 30 | On Windows, ROCm 7.2's bundled `llvm-mc.exe` reports LLVM 21.0.0git. It assembled the TEST-71 memory and | 34 | On Windows, ROCm 7.2's bundled `llvm-mc.exe` reports LLVM 21.0.0git. It assembled the TEST-71 memory and |
| 31 | LDS programs but rejected the 16-bit shift used by the f16 generator. To check an assembler directly in | 35 | LDS programs but rejected the 16-bit shift used by the f16 generator. To check an assembler directly in |
| @@ -96,6 +100,14 @@ Actions -> Runtime, and check out the commit it built, or start a run of the com | |||
| 96 | python -I scripts/run_gpu_tests.py --build <unzipped runtime-windows> | 100 | python -I scripts/run_gpu_tests.py --build <unzipped runtime-windows> |
| 97 | ``` | 101 | ``` |
| 98 | 102 | ||
| 103 | If you also have neither `llvm-mc` nor SPIRV-Tools (`spirv-as` / `spirv-val`) installed, `--disasm-dir` runs the | ||
| 104 | pre-disassembled subset in `tests/semantic/fixtures/disasm` and `--assembler python` (the default under `auto` when | ||
| 105 | `spirv-as` is absent) assembles SPIR-V with `tools/spirv_asm.py`: | ||
| 106 | |||
| 107 | ```sh | ||
| 108 | python -I scripts/run_gpu_tests.py --build <unzipped runtime-windows> --disasm-dir tests/semantic/fixtures/disasm --assembler python | ||
| 109 | ``` | ||
| 110 | |||
| 99 | `build.py` and `check.py` take the same folder as their second argument: | 111 | `build.py` and `check.py` take the same folder as their second argument: |
| 100 | 112 | ||
| 101 | ```sh | 113 | ```sh |
| @@ -105,6 +117,22 @@ python -I runtime/test/shaders/check.py <out dir> <unzipped runtime-windows> | |||
| 105 | 117 | ||
| 106 | The artifact belongs to the commit that built it, so run the scripts from that commit as well (see the note above). | 118 | The artifact belongs to the commit that built it, so run the scripts from that commit as well (see the note above). |
| 107 | 119 | ||
| 120 | #### Run one test from the Windows artifact | ||
| 121 | |||
| 122 | For a focused GPU check without building locally, extract the artifact and open | ||
| 123 | PowerShell in the directory containing the test executable. Keep the extracted | ||
| 124 | files together so the test can find any fixtures relative to that directory. | ||
| 125 | For example, to run the synthetic depth/stencil resolve test without game files: | ||
| 126 | |||
| 127 | ```powershell | ||
| 128 | .\d3d12_depth_resolve_test.exe | ||
| 129 | Write-Output "Test exit code: $LASTEXITCODE" | ||
| 130 | ``` | ||
| 131 | |||
| 132 | Report the executable name, the workflow run and its commit, your GPU and driver, | ||
| 133 | the exit code, and the test summary in [#166](https://github.com/ItsNotRexed/Leonida/issues/166). | ||
| 134 | Label it as a single-test run so the result is easy to distinguish from a full suite run. | ||
| 135 | |||
| 108 | ## Run them | 136 | ## Run them |
| 109 | 137 | ||
| 110 | The whole suite, assembled, translated and run in one go: | 138 | The whole suite, assembled, translated and run in one go: |
| @@ -118,8 +146,8 @@ Add `--require-pass` when verifying a specific path: an all-skipped run exits 1 | |||
| 118 | Skips still appear as `SKIP`, and individual skips are allowed if at least one test passes and none fail. | 146 | Skips still appear as `SKIP`, and individual skips are allowed if at least one test passes and none fail. |
| 119 | 147 | ||
| 120 | A GPU test program that runs longer than 120 seconds is killed and counted as a failure, so a hung driver does | 148 | A GPU test program that runs longer than 120 seconds is killed and counted as a failure, so a hung driver does |
| 121 | not stall the suite. `LEONIDA_GPU_TEST_TIMEOUT` sets the limit in seconds for both `check.py` and | 149 | not stall the suite. `LEONIDA_GPU_TEST_TIMEOUT` sets the limit in seconds for `check.py`, `run_gpu_tests.py` and |
| 122 | `run_gpu_tests.py`; `0` turns the limit off. | 150 | the `valu_fuzz.py` translator oracle; `0` turns the limit off. |
| 123 | **Rebuild the test programs after pulling.** The programs carry the V# and push-constant layout the translator expects. An executable from an older commit still loads and runs every shader, so a stale `vk_compute_test` does not fail loudly: when a newer translator starts enforcing a descriptor rule the old program does not set up (the raw V# in `pc[2..3]`, for one), every compute test reports the untouched `0xEEEEEEEE` fill pattern and the run looks like a translator regression. If all the compute tests in a run return that pattern, rebuild first (`cmake --build runtime/build/linux`, or `cmake --build runtime\build` on Windows) and run again before reading anything into the words. | 151 | **Rebuild the test programs after pulling.** The programs carry the V# and push-constant layout the translator expects. An executable from an older commit still loads and runs every shader, so a stale `vk_compute_test` does not fail loudly: when a newer translator starts enforcing a descriptor rule the old program does not set up (the raw V# in `pc[2..3]`, for one), every compute test reports the untouched `0xEEEEEEEE` fill pattern and the run looks like a translator regression. If all the compute tests in a run return that pattern, rebuild first (`cmake --build runtime/build/linux`, or `cmake --build runtime\build` on Windows) and run again before reading anything into the words. |
| 124 | 152 | ||
| 125 | The two-step form, which `CONTRIBUTING.md` describes: | 153 | The two-step form, which `CONTRIBUTING.md` describes: |
| @@ -163,10 +191,13 @@ That mode requires Vulkan, but not a translated shader or WARP. The GPU runner s | |||
| 163 | Use `--filter cs_imgload_mip` to check 2D `image_load_mip` on FLOAT (UNORM), UINT and SINT sampled views with | 191 | Use `--filter cs_imgload_mip` to check 2D `image_load_mip` on FLOAT (UNORM), UINT and SINT sampled views with |
| 164 | both full-width and D16 loads; mip 0 contains decoy data and mip 1 holds the expected texels. | 192 | both full-width and D16 loads; mip 0 contains decoy data and mip 1 holds the expected texels. |
| 165 | 193 | ||
| 166 | The shader test programs (`vk_harness`, `vk_compute_test`, `vk_store_test`, `vk_texture_test`, `vk_bindless_test`, | 194 | `vk_compute_test`, `vk_bindless_test` and `vk_image_fuzz` read `LEONIDA_VK_VALIDATION` too (`vk_compute_test` |
| 167 | `vk_sampler_test`, `vk_image_fuzz`) don't read `LEONIDA_VK_VALIDATION`. To check one, load the layer through the | 195 | through `runtime/test/vk_validation.h`): each validation message goes to stderr and a validation error makes the |
| 168 | loader and run it by hand, for example | 196 | program exit 1, so `LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python scripts/run_gpu_tests.py` fails |
| 169 | `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 vk_compute_test x.spv 1 dump`. | 197 | every compute test the layer objects to; the program's output ends with "N validation errors". The other shader test |
| 198 | programs (`vk_harness`, `vk_store_test`, `vk_texture_test`, `vk_sampler_test`) don't read it. | ||
| 199 | To check one, load the layer through the loader and run it by hand, for example | ||
| 200 | `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 vk_harness vs.spv ps.spv out.raw`. | ||
| 170 | The layer prints its messages to stdout and the program's exit status doesn't change, and `run_gpu_tests.py` shows | 201 | The layer prints its messages to stdout and the program's exit status doesn't change, and `run_gpu_tests.py` shows |
| 171 | only each test's last line, so read the program's own output. GPU-assisted validation (`..._GPUAV_ENABLE=1`) | 202 | only each test's last line, so read the program's own output. GPU-assisted validation (`..._GPUAV_ENABLE=1`) |
| 172 | instruments the translated shaders and reports what they actually do at run time: out-of-bounds buffer accesses, and | 203 | instruments the translated shaders and reports what they actually do at run time: out-of-bounds buffer accesses, and |
| @@ -199,20 +230,64 @@ Vulkan instance with, so every Vulkan test fails with `vkCreateInstance failed ( | |||
| 199 | as CI does: `WINEPREFIX="$HOME/.local/share/leonida-wine" xvfb-run -a ctest --test-dir runtime/build/windows` | 230 | as CI does: `WINEPREFIX="$HOME/.local/share/leonida-wine" xvfb-run -a ctest --test-dir runtime/build/windows` |
| 200 | (packages `xvfb` and `xauth`, which `xvfb-run` needs). With Mesa installed, the tests then run on llvmpipe. | 231 | (packages `xvfb` and `xauth`, which `xvfb-run` needs). With Mesa installed, the tests then run on llvmpipe. |
| 201 | 232 | ||
| 233 | A virtual X server has no presentable surface, so presentation cannot be judged under it. With a real display (here | ||
| 234 | Wine 11.22 on a Wayland session, through XWayland) the same 123-test list gives 92 passed, 6 failed and 25 skipped, | ||
| 235 | and `vk_presenter_sync`, `xbox_present` and `dxgi_swapchain` pass, while they fail under `xvfb-run`. Use a real | ||
| 236 | compositor for those three. Six still failed with a real display: `device_proxy`, `d3d12_xs_root_signature`, | ||
| 237 | `xdxr_build`, `d3d12_xdxr_rt`, `d3d12_present` and `d3d12_compute`. | ||
| 238 | |||
| 202 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. | 239 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. |
| 203 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build | 240 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build |
| 204 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are | 241 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are |
| 205 | looked up only inside the SDK folder, so a Windows SDL3 for the GameInput shim is passed as `-DSDL3_DIR=<its | 242 | looked up only inside the SDK folder, so a Windows SDL3 for the GameInput shim is passed as `-DSDL3_DIR=<its |
| 206 | cmake folder>` (`CMAKE_PREFIX_PATH` is not searched here). | 243 | cmake folder>` (`CMAKE_PREFIX_PATH` is not searched here). |
| 207 | 244 | ||
| 208 | For Proton, start any program once with `proton run` (with `STEAM_COMPAT_DATA_PATH` and | 245 | ### Proton's wine |
| 209 | `STEAM_COMPAT_CLIENT_INSTALL_PATH` set), so that it puts vkd3d-proton and DXVK into the prefix, then configure with | 246 | |
| 210 | `-DCMAKE_CROSSCOMPILING_EMULATOR="<Proton>/files/bin/wine"` and run `ctest` with | 247 | Proton's wine runs the suite against the D3D12 a Proton game gets: the prefix's vkd3d-proton and DXVK. Start any |
| 211 | `WINEPREFIX=$STEAM_COMPAT_DATA_PATH/pfx WINEDLLOVERRIDES="d3d12=n;d3d12core=n;dxgi=n"`. `proton run` itself doesn't | 248 | program once with `proton run` so that it lays down the prefix libraries; the `STEAM_COMPAT_DATA_PATH` folder has to |
| 212 | pass the program's output on, so the tests can't run through it. | 249 | exist first, because Proton opens `<data>/pfx.lock` in it: |
| 213 | 250 | ||
| 214 | The tests that compare with the host's D3D12 (`root_sig_test`, `root_sig`, `device_proxy`, `d3d12_vulkan_device`) | 251 | ```sh |
| 215 | check against Wine's vkd3d or vkd3d-proton here, not Microsoft's runtime, so some of them fail for that reason. | 252 | mkdir -p ~/.local/share/leonida-proton |
| 253 | STEAM_COMPAT_DATA_PATH="$HOME/.local/share/leonida-proton" \ | ||
| 254 | STEAM_COMPAT_CLIENT_INSTALL_PATH="$HOME/.local/share/Steam" \ | ||
| 255 | "$HOME/.local/share/Steam/steamapps/common/Proton 11.0/proton" run cmd /c exit 0 | ||
| 256 | cmake -S runtime -B runtime/build/proton --toolchain "$PWD/runtime/cmake/clang-cl-xwin.cmake" \ | ||
| 257 | -DXWIN_DIR="$HOME/.local/share/xwin-sdk" \ | ||
| 258 | -DCMAKE_CROSSCOMPILING_EMULATOR="$HOME/.local/share/Steam/steamapps/common/Proton 11.0/files/bin/wine" | ||
| 259 | cmake --build runtime/build/proton --parallel 2 | ||
| 260 | WINEPREFIX="$HOME/.local/share/leonida-proton/pfx" WINEDLLOVERRIDES="d3d12=n;d3d12core=n;dxgi=n" \ | ||
| 261 | WINEDEBUG=-all ctest --test-dir runtime/build/proton | ||
| 262 | ``` | ||
| 263 | |||
| 264 | `proton run` itself doesn't pass the program's output on, so the tests can't run through it. `WINEPREFIX` must be | ||
| 265 | the prefix the emulator made: a prefix from another wine version fails every test with "wine client error: version | ||
| 266 | mismatch". The tests need a real display here as well. | ||
| 267 | |||
| 268 | Measured on 2026-11-23 with Proton 11.0 (wine-11.0, vkd3d-proton 3.0) on an RX 7600 XT (radv): 155 tests | ||
| 269 | registered, 154 run, 127 passed, 20 skipped, one disabled and seven failed. The skips are the usual ones (game data, | ||
| 270 | `LEONIDA_FIRST_LIGHT_DIR`, no independent Vulkan queue for `d3d12_queue_wait`, and so on). All seven failures are in | ||
| 271 | the comparisons with the host D3D12, which is vkd3d-proton here: | ||
| 272 | |||
| 273 | - `d3d12_fence_timing`, `d3d12_private_data`, `d3d12_sampler2` and `d3d12_subresource_copy` disagree with | ||
| 274 | vkd3d-proton on a return value or a field it writes (`GetCustomHeapProperties` of a custom heap type, | ||
| 275 | `SetName(nullptr)`, unknown sampler flags, CPU-copy boxes). | ||
| 276 | - `d3d12_r9g9b9e5_uav` compares a clear with WARP, and Proton's dxgi answers `EnumWarpAdapter` with the first | ||
| 277 | hardware adapter ("WARP not supported"), so the compared value is the hardware's. | ||
| 278 | - `d3d12_compute` and `d3d12_method_variants` crash with an access violation inside `d3d12core.dll` on their | ||
| 279 | null-argument checks, not on device creation: `GetCachedBlob(nullptr)` and `CreateCommandQueue1(nullptr, ...)` | ||
| 280 | are not validated by vkd3d-proton (filed upstream as vkd3d-proton issues 3512 and 3513; Wine's builtin d3d12 | ||
| 281 | crashes on the queue one too). `d3d12_compute` passes with only `WINEDLLOVERRIDES="dxgi=n"`, where the host is | ||
| 282 | Wine's own d3d12 and the comparison skips. | ||
| 283 | |||
| 284 | The host's D3D12 here is Wine's vkd3d or vkd3d-proton, not Microsoft's runtime, and Proton's `EnumWarpAdapter` | ||
| 285 | returns the hardware adapter, so "WARP" is vkd3d-proton on the GPU. Most tests that compare with the host or WARP | ||
| 286 | skip that comparison under Wine and Proton (`runtime/test/host_wine.h`), and most of them still check the layer | ||
| 287 | against Microsoft's answers recorded in the test (`d3d12_subresource_copy` and `d3d12_private_data` keep theirs in | ||
| 288 | `d3d12_subresource_copy_answers.h` and `d3d12_private_data_answers.h`). | ||
| 289 | A few still compare with the host (`root_sig`, `device_proxy`, and some of `d3d12_vulkan_device`'s cases), so some | ||
| 290 | of those fail for that reason. | ||
| 216 | 291 | ||
| 217 | ## GPUs with 32-wide subgroups (NVIDIA, Intel, Apple) | 292 | ## GPUs with 32-wide subgroups (NVIDIA, Intel, Apple) |
| 218 | 293 | ||
| @@ -251,12 +326,15 @@ partition invariance"). `runtime/test/shaders/w64_graphics.py` checks those tier | |||
| 251 | must differ. CI has no GPU, and the CPU wave interpreter (`tests/semantic/test_wave64_halves.py`) runs vertex shaders | 326 | must differ. CI has no GPU, and the CPU wave interpreter (`tests/semantic/test_wave64_halves.py`) runs vertex shaders |
| 252 | only, so this comparison needs real hardware. | 327 | only, so this comparison needs real hardware. |
| 253 | 328 | ||
| 254 | Vulkan can require a subgroup size for pixel shaders (`VKH_SUBGROUP_SIZE`) but not for vertex or geometry shaders, so | 329 | Vulkan can require a subgroup size for pixel shaders (`VKH_SUBGROUP_SIZE`) where the driver lists the fragment stage in |
| 255 | those two use a RADV switch instead: on GFX10 and newer, RADV runs them as wave64 by default and as wave32 with | 330 | `requiredSubgroupSizeStages`, but not for vertex or geometry shaders, so those two use a RADV switch instead: on GFX10 |
| 256 | `RADV_PERFTEST=gewave32`. The runner sets it itself and checks the result with a probe fixture per stage | 331 | and newer, RADV runs them as wave64 by default and as wave32 with `RADV_PERFTEST=gewave32`. The runner sets it itself |
| 257 | (`vs_w64_c_lane_id`, `gs_w64_c_lane_id`): the largest lane id must reach 32 at wave64 and stay below 32 at wave32. On | 332 | and checks the result with a probe fixture per stage (`vs_w64_c_lane_id`, `gs_w64_c_lane_id`): the largest lane id |
| 258 | other drivers (AMD Windows, NVIDIA, Intel) the probe sees no change, and only the default-size checks run; tier C is | 333 | must reach 32 at wave64 and stay below 32 at wave32. On other drivers (AMD Windows, NVIDIA, Intel) the probe sees no |
| 259 | then a `SKIP`, not a failure. | 334 | change, and only the default-size checks run; tier C is then a `SKIP`, not a failure. Not every driver lists the |
| 335 | fragment stage either: on an RX 6800 (RDNA2) with AMD's Windows driver 26.11.2 the list is compute only, no size can | ||
| 336 | be requested for pixel shaders (they run at the 64-wide default), and the tier C pixel fixtures are a `SKIP` too | ||
| 337 | (2026-11-22, [d3d12_vulkan.md](d3d12_vulkan.md), "Subgroup size"). | ||
| 260 | 338 | ||
| 261 | Build and run it on Linux with RADV, pinned to one GPU (`LEONIDA_VK_DEVICE`, see "Choosing the GPU"): | 339 | Build and run it on Linux with RADV, pinned to one GPU (`LEONIDA_VK_DEVICE`, see "Choosing the GPU"): |
| 262 | 340 | ||
| @@ -283,8 +361,9 @@ Each line prints `ok`, a `SKIP` with its reason, or what differed. To add a fixt | |||
| 283 | The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose | 361 | The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose |
| 284 | `maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through | 362 | `maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through |
| 285 | `vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit. | 363 | `vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit. |
| 286 | AMD's Windows driver reports 128 on RDNA2 iGPUs (Radeon 680M, 610M, the Ryzen 7000 iGPU); RADV reports more on the | 364 | AMD's older Windows drivers report 128 on RDNA2 iGPUs (Radeon 680M on 22.40.84.06, 610M on 24.10.16.14, the Ryzen 5 |
| 287 | same chips. | 365 | 7600's iGPU on 24.10.24); 26.11.2 reports 256 on a Radeon 610M, where these tests run without the variable below. |
| 366 | RADV reports more on the same chips. | ||
| 288 | 367 | ||
| 289 | To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for | 368 | To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for |
| 290 | `run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes, | 369 | `run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes, |
| @@ -300,8 +379,9 @@ constants, so those tests skip. | |||
| 300 | The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose | 379 | The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose |
| 301 | `maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through | 380 | `maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through |
| 302 | `vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit. | 381 | `vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit. |
| 303 | AMD's Windows driver reports 128 on RDNA2 iGPUs (Radeon 680M, 610M, the Ryzen 7000 iGPU); RADV reports more on the | 382 | AMD's older Windows drivers report 128 on RDNA2 iGPUs (Radeon 680M on 22.40.84.06, 610M on 24.10.16.14, the Ryzen 5 |
| 304 | same chips. | 383 | 7600's iGPU on 24.10.24); 26.11.2 reports 256 on a Radeon 610M, where these tests run without the variable below. |
| 384 | RADV reports more on the same chips. | ||
| 305 | 385 | ||
| 306 | To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for | 386 | To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for |
| 307 | `run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes, | 387 | `run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes, |
| @@ -318,7 +398,10 @@ Without `VK_EXT_mesh_shader`, the `ms_*` tests are skipped; that's expected, not | |||
| 318 | runs them anyway, set `LEONIDA_MESH_COMPUTE=1` for `run_gpu_tests.py`, together with `LEONIDA_W64_EMULATE=1` on a | 398 | runs them anyway, set `LEONIDA_MESH_COMPUTE=1` for `run_gpu_tests.py`, together with `LEONIDA_W64_EMULATE=1` on a |
| 319 | 32-wide GPU (every mesh shader is wave64). The mesh shaders are then translated with `--mesh-compute`, dispatched as | 399 | 32-wide GPU (every mesh shader is wave64). The mesh shaders are then translated with `--mesh-compute`, dispatched as |
| 320 | compute and drawn by a generated vertex shader (`docs/design.md`, "Mesh shaders as compute"), so the device needs | 400 | compute and drawn by a generated vertex shader (`docs/design.md`, "Mesh shaders as compute"), so the device needs |
| 321 | `bufferDeviceAddress` and `shaderInt64` instead. | 401 | `bufferDeviceAddress` instead, and `shaderInt64` for a module that declares `Int64`. The standalone tools |
| 402 | (`vk_harness`, `vk_compute_test`, `vk_texture_test`, `vk_store_test`, `vk_bindless_test`) read the modules' | ||
| 403 | capabilities first: they enable `shaderInt64` only for one that declares `Int64` (or `Int64Atomics`), and report 77 | ||
| 404 | (SKIP, with the reason) when the device lacks it. | ||
| 322 | 405 | ||
| 323 | ## Without a GPU: Mesa llvmpipe | 406 | ## Without a GPU: Mesa llvmpipe |
| 324 | 407 | ||
| @@ -327,32 +410,55 @@ for every pull request that touches the runtime, the scripts or a tool the jobs | |||
| 327 | lists them), and you can do the same on Linux without a GPU: | 410 | lists them), and you can do the same on Linux without a GPU: |
| 328 | 411 | ||
| 329 | ```sh | 412 | ```sh |
| 330 | sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools llvm-18 | 413 | sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools llvm-19 |
| 331 | cmake -S runtime -B runtime/build/linux && cmake --build runtime/build/linux --parallel | 414 | cmake -S runtime -B runtime/build/linux && cmake --build runtime/build/linux --parallel |
| 332 | python -I scripts/run_gpu_tests.py --build runtime/build/linux --llvm-mc /usr/lib/llvm-18/bin/llvm-mc | 415 | python -I scripts/run_gpu_tests.py --build runtime/build/linux --llvm-mc /usr/lib/llvm-19/bin/llvm-mc |
| 333 | LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime/build/linux \ | 416 | LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --build runtime/build/linux \ |
| 334 | --llvm-mc /usr/lib/llvm-18/bin/llvm-mc --filter cs_ | 417 | --llvm-mc /usr/lib/llvm-19/bin/llvm-mc --filter cs_ |
| 335 | LEONIDA_BARY_FALLBACK=1 python -I scripts/run_gpu_tests.py --build runtime/build/linux \ | 418 | LEONIDA_BARY_FALLBACK=1 python -I scripts/run_gpu_tests.py --build runtime/build/linux \ |
| 336 | --llvm-mc /usr/lib/llvm-18/bin/llvm-mc | 419 | --llvm-mc /usr/lib/llvm-19/bin/llvm-mc |
| 337 | ``` | 420 | ``` |
| 338 | 421 | ||
| 339 | With Mesa 25.2 (llvmpipe, LLVM 20) the first run passes 52 of 88 and skips 36, the second passes 37 of 39 and | 422 | With Mesa 25.2 (llvmpipe, LLVM 20) the first run passes 52 of 88 and skips 36, the second passes 37 of 39 and |
| 340 | skips 2. The skips are expected: llvmpipe has 8-wide subgroups (so every wave64 test skips without emulation, and | 423 | skips 2. The skips are expected: llvmpipe has 8-wide subgroups (so every wave64 test skips without emulation, and |
| 341 | the 32-lane tests `ps_bitmask_perm`, `cs_wqm_w32` and `cs_w32_lane_wrap` skip in both runs), no | 424 | the 32-lane tests `ps_bitmask_perm`, `cs_wqm_w32` and `cs_w32_lane_wrap` skip in both runs), no |
| 342 | `VK_KHR_fragment_shader_barycentric` (`ps_bary`, `ps_uniform_branch`, `ps_scc_mask32`) and no | 425 | `VK_KHR_fragment_shader_barycentric` (`ps_bary`, `ps_persp_bary`, `ps_uniform_branch`, `ps_scc_mask32`) and no |
| 343 | `VK_KHR_maintenance8` (`ps_texoff`). The third run draws those three barycentric tests through the fallback below | 426 | `VK_KHR_maintenance8` (`ps_texoff`). The third run draws those four barycentric tests through the fallback below |
| 344 | (with Mesa 26.0.8 it passes 123 of 189, the first run 120), and CI fails it unless every shader that got a fallback | 427 | (with Mesa 26.0.8 it passes 123 of 189, the first run 120), and CI fails it unless every shader that got a fallback |
| 345 | geometry shader passes. With | 428 | geometry shader passes. With |
| 346 | `LEONIDA_W64_EMULATE=1` the mesh tests abort inside llvmpipe's compiler ("LLVM ERROR: Cannot emit physreg copy | 429 | `LEONIDA_W64_EMULATE=1` the mesh tests fail on llvmpipe, which is why the second run is limited to compute. This is |
| 347 | instruction"), which is why the second run is limited to compute. llvmpipe is not a substitute for a result from a | 430 | an llvmpipe bug, not the translator's (TEST-782, #3127): llvmpipe stores a mesh shader's per-primitive |
| 431 | `CullPrimitiveEXT` by bitcasting the boolean (`<N x i1>`) to a float vector, an invalid LLVM cast | ||
| 432 | (`emit_store_mesh_chan` in `lp_bld_nir_soa.c`, Mesa 26.3.1 and `main`). A constant cull flag is folded away before | ||
| 433 | that, so the native mesh tests pass; the emulated ones carry it through memory, so it reaches the cast. What the | ||
| 434 | cast becomes depends on the backend: on x86_64 at 256 bits, LLVM aborts ("LLVM ERROR: Cannot emit physreg copy | ||
| 435 | instruction"); at 128 bits (`LP_NATIVE_VECTOR_WIDTH=128`) some draw correctly and some draw nothing (with Mesa | ||
| 436 | 26.0.3, `ms_tri`, `ms_w64x_ballot`, `ms_clip` and `ms_f16_pack` pass, while `ms_wave_info_s3` and `ms_v5_workgroup` | ||
| 437 | stay at the clear color); on arm64 (128 bits) `ms_tri`'s primitive comes out culled, so nothing is drawn. Storing a | ||
| 438 | constant `false` there instead makes the emulated `ms_tri` draw a frame byte-identical to RADV's (Mesa 26.3.1), and | ||
| 439 | `ms_tri`, `ms_wave_info_s3`, `ms_w64x_ballot` and `ms_v5_workgroup` byte-identical to NVIDIA's at both widths (Mesa | ||
| 440 | 26.0.3, [measured by @TreXito](https://github.com/ItsNotRexed/Leonida/pull/3838#issuecomment-7086696759), with a 42-line reduced | ||
| 441 | reproducer). llvmpipe is not a substitute for a result from a | ||
| 348 | real GPU in [#166](https://github.com/ItsNotRexed/Leonida/issues/166): it catches regressions, not hardware | 442 | real GPU in [#166](https://github.com/ItsNotRexed/Leonida/issues/166): it catches regressions, not hardware |
| 349 | differences. | 443 | differences. |
| 350 | 444 | ||
| 445 | ## Macs in CI | ||
| 446 | |||
| 447 | The `macos` job in `.github/workflows/runtime.yml` builds the runtime on GitHub's `macos-26` arm64 runner and runs | ||
| 448 | `ctest` and `run_gpu_tests.py` on MoltenVK; `macos-python` in `ci.yml` runs the Python suites. The runner is a VM | ||
| 449 | whose Metal device is "Apple Paravirtual device" (Metal family Mac2, not Apple7): MoltenVK runs on it with 32-wide | ||
| 450 | subgroups, so the wave64 and "32 lanes on request" tests skip there (about 75 of 190 in November 2026), and Mesa's | ||
| 451 | KosmicKrisp finds no device. `macos-15` can't build the runtime: Xcode 16's libc++ has no floating-point | ||
| 452 | `std::from_chars`. A test known to fail on MoltenVK is listed in the step's `EXPECTED_FAILURES` with the pull | ||
| 453 | request or coordination-issue finding that tracks it; it still runs, and `scripts/ci_expected_failures.py` fails the step | ||
| 454 | on any other failure. It takes `FAILED_LIST EXIT_STATUS [EXPECTED ...]`, answers `--help`, and reports a list it cannot | ||
| 455 | read or a non-numeric status as one line with exit code 2. | ||
| 456 | |||
| 351 | ## GPUs without fragment barycentrics (NVIDIA Volta, Pascal and older) | 457 | ## GPUs without fragment barycentrics (NVIDIA Volta, Pascal and older) |
| 352 | 458 | ||
| 353 | `ps_bary`, `ps_uniform_branch` and `ps_scc_mask32` read raw barycentrics, which need | 459 | `ps_bary`, `ps_persp_bary`, `ps_uniform_branch` and `ps_scc_mask32` read raw barycentrics, which need |
| 354 | `VK_KHR_fragment_shader_barycentric`. NVIDIA has it from Turing on; Volta (V100, Titan V) and older lack it, as do | 460 | `VK_KHR_fragment_shader_barycentric`. NVIDIA has it from Turing on; Volta (V100, Titan V) and older lack it, as do |
| 355 | llvmpipe and some other drivers. Where the device lacks it those three are skipped; that's expected, not a failure. | 461 | llvmpipe and some other drivers. Where the device lacks it those four are skipped; that's expected, not a failure. |
| 356 | To test the fallback that runs them anyway, set `LEONIDA_BARY_FALLBACK=1`, **for both `build.py` and `check.py`** | 462 | To test the fallback that runs them anyway, set `LEONIDA_BARY_FALLBACK=1`, **for both `build.py` and `check.py`** |
| 357 | (or for `run_gpu_tests.py`; CI does this on llvmpipe). The shaders are then translated with `--bary-fallback` and | 463 | (or for `run_gpu_tests.py`; CI does this on llvmpipe). The shaders are then translated with `--bary-fallback` and |
| 358 | drawn through a pass-through geometry shader that supplies the barycentrics (`docs/design.md`, "Barycentric | 464 | drawn through a pass-through geometry shader that supplies the barycentrics (`docs/design.md`, "Barycentric |
| @@ -363,6 +469,20 @@ too and which `--bary-fallback` can't express. With `LEONIDA_F16_INTERP_FALLBACK | |||
| 363 | exports decoded instead (see Macs, below) and run with or without the bary fallback; `run_gpu_tests.py` turns that | 469 | exports decoded instead (see Macs, below) and run with or without the bary fallback; `run_gpu_tests.py` turns that |
| 364 | on by itself where the device lacks the extension. Under the bary fallback without it they skip. | 470 | on by itself where the device lacks the extension. Under the bary fallback without it they skip. |
| 365 | 471 | ||
| 472 | Intel Arc with Mesa ANV currently advertises the native barycentric feature but has a driver bug where translated | ||
| 473 | pixel shaders can read `BaryCoordKHR.i` as zero (SHADER-925). `make_game.py` detects ANV and automatically translates | ||
| 474 | with `--bary-fallback`; both entry points accept `LEONIDA_BARY_FALLBACK=1` to force it and | ||
| 475 | `LEONIDA_BARY_FALLBACK=0` to force native barycentrics. The CLI `--bary-fallback` flag also remains available for | ||
| 476 | game builds and other manually built fixtures. | ||
| 477 | |||
| 478 | AMD's Windows driver on gfx90c iGPUs (Renoir, Lucienne, Cezanne, Barcelo: Ryzen 4000/5000 mobile and 5000G, GCN 5) | ||
| 479 | also advertises the feature but returns a wrong third `BaryCoordKHR` component, about 0.99 where a small value is | ||
| 480 | expected (#5933: Vega 8, PCI 1002:15E7, driver 31.0.21921.13001). `ps_bary`, `ps_persp_bary` and `ps_ij_computed` | ||
| 481 | fail natively; through the fallback `ps_bary` and `ps_persp_bary` pass. `tools/vk_subgroup_info.py` reports | ||
| 482 | `barycentric_fallback` for these PCI IDs under `VK_DRIVER_ID_AMD_PROPRIETARY`, so `make_game.py` and | ||
| 483 | `run_gpu_tests.py` turn the fallback on by themselves there, with the same `LEONIDA_BARY_FALLBACK` override. RADV and | ||
| 484 | other GCN 5 GPUs are not covered: none has been measured. | ||
| 485 | |||
| 366 | ## Macs: 16-bit interpolation without PerVertexKHR | 486 | ## Macs: 16-bit interpolation without PerVertexKHR |
| 367 | 487 | ||
| 368 | `ps_interp_f16_high` (and `ms_f16_pack`) normally read 16-bit interpolants through `PerVertexKHR` inputs, which | 488 | `ps_interp_f16_high` (and `ms_f16_pack`) normally read 16-bit interpolants through `PerVertexKHR` inputs, which |
| @@ -413,6 +533,11 @@ specification allows a driver to split GLSL `Fma` into two roundings, which is w | |||
| 413 | `LEONIDA_FMA=exact` (`--fma exact`) builds the single rounding from plain f32 operations and needs no extension; with | 533 | `LEONIDA_FMA=exact` (`--fma exact`) builds the single rounding from plain f32 operations and needs no extension; with |
| 414 | it `cs_fma_fused` passes on both of those, on an RTX 3050 Laptop (617.42), an RTX 5060 Laptop (621.01), an RTX 5070 Ti | 534 | it `cs_fma_fused` passes on both of those, on an RTX 3050 Laptop (617.42), an RTX 5060 Laptop (621.01), an RTX 5070 Ti |
| 415 | (621.24) and a Radeon 780M (26.11.2). | 535 | (621.24) and a Radeon 780M (26.11.2). |
| 536 | Intel UHD Graphics (Xe-LP, Windows 101.7088) splits it too, words 0, 2, 3 and 5 (`v_fma_f32`, `v_fmaak_f32`, | ||
| 537 | `v_fmac_f32`), and has no `VK_KHR_shader_fma`, so `khr` can't be used there. For such a device, | ||
| 538 | `LEONIDA_FMA=exact` (`--fma exact`) builds the single rounding from plain f32 operations and needs no extension; | ||
| 539 | under it, as under `khr`, all 8 words must be strictly fused, and they are on that Intel UHD and on an RTX 3050 | ||
| 540 | Laptop (617.42). | ||
| 416 | 541 | ||
| 417 | ## Hardware oracle (optional, AMD) | 542 | ## Hardware oracle (optional, AMD) |
| 418 | 543 | ||
| @@ -438,23 +563,39 @@ over integrated, the first on a tie, `vulkan_device_rank` in `runtime/src/vulkan | |||
| 438 | `LEONIDA_VK_DEVICE=radeon`. The D3D12 tests (`vk_test_device.h`) and the layer's standalone device read it, | 563 | `LEONIDA_VK_DEVICE=radeon`. The D3D12 tests (`vk_test_device.h`) and the layer's standalone device read it, |
| 439 | and a value that matches no device fails the run instead of testing | 564 | and a value that matches no device fails the run instead of testing |
| 440 | another GPU. For the host side of the comparison tests, `LEONIDA_HOST_ADAPTER` picks the D3D12 adapter the same way. | 565 | another GPU. For the host side of the comparison tests, `LEONIDA_HOST_ADAPTER` picks the D3D12 adapter the same way. |
| 566 | Unset, the host side is the adapter behind the layer's Vulkan device (`runtime/test/host_adapter.h`; `d3d12_buffer_tiles` | ||
| 567 | by the layer's `GetAdapterLuid()`), so on a PC with two GPUs the layer is compared with its own GPU's driver. | ||
| 441 | The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) read it the same way through | 568 | The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) read it the same way through |
| 442 | `vk_device_pick.h`, and fail with a message naming the filter when it matches no device. | 569 | `vk_device_pick.h`, and fail with a message naming the filter when it matches no device. |
| 443 | 570 | ||
| 571 | Two test settings make the layer's standalone device look like a GPU with fewer Vulkan queues, so D3D12 queues share | ||
| 572 | them (`docs/d3d12_vulkan.md` section 4.4) on any GPU: `LEONIDA_VK_MAX_QUEUES_PER_FAMILY=N` (1 to 16) creates at most | ||
| 573 | N Vulkan queues per queue family, and `LEONIDA_VK_GRAPHICS_FAMILY_ONLY=1` puts COMPUTE and COPY queues in the | ||
| 574 | graphics family, as on a GPU without async compute or transfer families. Both together give the shape of the Intel | ||
| 575 | UHD 770 on Windows and of lavapipe, one family with one queue; the `d3d12_queue_share_one_queue` and | ||
| 576 | `d3d12_queue_wait_one_queue` tests run that way, and any other test can be run so by hand. The device logs what it | ||
| 577 | applied; a queue count outside 1 to 16 is ignored, with a message. Only tests apply them: the device that | ||
| 578 | `gta6rt --run` creates for a game (`LEONIDA_D3D12=vulkan`) ignores both and prints `... is a test setting; the | ||
| 579 | game's device ignores it`, so leaving them set cannot slow a game down (`run_tiny_frame_queue_test_settings`). | ||
| 580 | |||
| 444 | ## Known problems | 581 | ## Known problems |
| 445 | 582 | ||
| 446 | | What you see | Cause | What to do | | 583 | | What you see | Cause | What to do | |
| 447 | |---|---|---| | 584 | |---|---|---| |
| 585 | | Under Wine 9.0 (Ubuntu 24.04's `wine`), a test or the runtime waits out every `std::condition_variable` timeout: `wait_registration_admission` ("native drainage complete"), `vk_presenter_sync` (`unblocked_during_present`), `frame_pacer`, `vk_fence_dispatcher_sync`, `context_concurrent_detach` | The STL's timed wait (`_Cnd_timedwait_for_unchecked`) is linked statically from `msvcprt.lib` and reads Windows' `_Mtx_t` layout, while `_Mtx_lock`/`_Mtx_unlock` come from Wine's builtin msvcp140, which used another layout until wine-10.1 (757bd7909fda); the wait never released the mutex (#3796) | Fixed in the build: `runtime/src/crt_timed_wait.cpp` routes the wait through msvcp140's own `_Cnd_timedwait` in every `/MD` binary, and `crt_timed_wait_test` checks it. A binary built before that fix still needs Wine 10.1 or newer (or Proton) | | ||
| 448 | | `ctest` passes but runs far fewer tests than expected (about 45 instead of 125 on Windows), no `d3d12_*` GPU tests, and `LEONIDA_D3D12=vulkan` does nothing | CMake found no Vulkan headers: `VULKAN_SDK` was not set in the environment that ran CMake (for example a user variable set after the terminal opened), and `CMakeCache.txt` keeps that failed lookup. The configure prints a `CMake Warning` "Vulkan headers not found" | Set `VULKAN_SDK` in that environment (or pass `-DLEONIDA_VULKAN_HEADERS_FETCH=ON`), delete `CMakeCache.txt` and configure again. `-DLEONIDA_REQUIRE_VULKAN=ON` makes this a configure error; CI and `scripts/build_runtime.ps1` (with `VULKAN_SDK` set) pass it | | 586 | | `ctest` passes but runs far fewer tests than expected (about 45 instead of 125 on Windows), no `d3d12_*` GPU tests, and `LEONIDA_D3D12=vulkan` does nothing | CMake found no Vulkan headers: `VULKAN_SDK` was not set in the environment that ran CMake (for example a user variable set after the terminal opened), and `CMakeCache.txt` keeps that failed lookup. The configure prints a `CMake Warning` "Vulkan headers not found" | Set `VULKAN_SDK` in that environment (or pass `-DLEONIDA_VULKAN_HEADERS_FETCH=ON`), delete `CMakeCache.txt` and configure again. `-DLEONIDA_REQUIRE_VULKAN=ON` makes this a configure error; CI and `scripts/build_runtime.ps1` (with `VULKAN_SDK` set) pass it | |
| 449 | | Windows refuses to start freshly built test programs ("An Application Control policy has blocked this file"), and the runner stops with a traceback | Smart App Control on Windows 11 | Turn Smart App Control off for the run | | 587 | | Windows refuses to start freshly built test programs ("An Application Control policy has blocked this file"), and the runner stops with a traceback | Smart App Control on Windows 11 | Turn Smart App Control off for the run | |
| 588 | | `tools/hw_oracle` works once, then stops with "hardware oracle unavailable: Windows Defender blocked the launcher ... (WinError 225)" (older runs: an `OSError: [WinError 225] ... contains a virus or potentially unwanted software` traceback) | Defender's machine-learning check flags the small unsigned `leonida_hw_oracle_<hash>.exe` that the runner builds in `%TEMP%` (seen as `Trojan:Win32/Bearfoos.A!ml`) and quarantines it; every later run rebuilds and loses it again | Add an exclusion for the build folder (`%TEMP%`) in Windows Security, Virus & threat protection, Manage settings, Exclusions, restore the file from Protection history if you want it back, and rerun. The program is built from `tools/hw_oracle/hw_oracle.c` and is a false positive | | ||
| 450 | | Validation errors without a VUID, or messages from a layer you didn't ask for | An implicit Vulkan layer from other software (Rockstar Social Club, ReShade, MangoHud, an overlay) | Set `VK_LOADER_LAYERS_DISABLE=~implicit~`. Overlays that hook the swapchain (RivaTuner `VK_LAYER_RTSS`, OBS `VK_LAYER_OBS_HOOK`) can stay loaded: see the next row | | 589 | | Validation errors without a VUID, or messages from a layer you didn't ask for | An implicit Vulkan layer from other software (Rockstar Social Club, ReShade, MangoHud, an overlay) | Set `VK_LOADER_LAYERS_DISABLE=~implicit~`. Overlays that hook the swapchain (RivaTuner `VK_LAYER_RTSS`, OBS `VK_LAYER_OBS_HOOK`) can stay loaded: see the next row | |
| 451 | | Validation errors that only your machine shows (e.g. `xbox_present`'s sRGB swapchain `STORAGE` message), with MSI Afterburner/RivaTuner or OBS installed | An overlay layer that hooks the swapchain: while RivaTuner Statistics Server is running, its `VK_LAYER_RTSS` adds `STORAGE` usage to it (OBS's `VK_LAYER_OBS_HOOK` injects `VK_IMAGE_USAGE_STORAGE_BIT` too). In an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE` (`VK_LOADER_DEBUG=all` says so), so `~implicit~` leaves the layer in | Run the tests from a normal terminal, close the overlay application, or set the layer's own switch, which works elevated too: `DISABLE_RTSS_LAYER=1`, `DISABLE_VULKAN_OBS_CAPTURE=1` (OBS). Any other layer's switch is the `disable_environment` entry in its manifest (the JSON listed under `HKLM\SOFTWARE\Khronos\Vulkan\ImplicitLayers` or `HKCU\...`). `VK_LOADER_DEBUG=layer` prints the layers that were actually inserted | | 590 | | Validation errors that only your machine shows (e.g. `xbox_present`'s sRGB swapchain `STORAGE` message), with MSI Afterburner/RivaTuner or OBS installed | An overlay layer that hooks the swapchain: while RivaTuner Statistics Server is running, its `VK_LAYER_RTSS` adds `STORAGE` usage to it (OBS's `VK_LAYER_OBS_HOOK` injects `VK_IMAGE_USAGE_STORAGE_BIT` too). In an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE` (`VK_LOADER_DEBUG=all` says so), so `~implicit~` leaves the layer in | Run the tests from a normal terminal, close the overlay application, or set the layer's own switch, which works elevated too: `DISABLE_RTSS_LAYER=1`, `DISABLE_VULKAN_OBS_CAPTURE=1` (OBS). Any other layer's switch is the `disable_environment` entry in its manifest (the JSON listed under `HKLM\SOFTWARE\Khronos\Vulkan\ImplicitLayers` or `HKCU\...`). `VK_LOADER_DEBUG=layer` prints the layers that were actually inserted | |
| 591 | | GPU tests crash with an access violation (`0xC0000005`, exit `-1073741819`) right after device creation, with no layer message and validation off (e.g. `d3d12_method_variants` 9 of 10 runs, `xbox_present` 10 of 10, on `main` 561b65a83, RTX 4070 Ti, NVIDIA 616.56) | An implicit layer from an overlay or game tool you did not install for these tests. FPS Monitor's `fpsmonvk64.json` (listed under `HKLM\SOFTWARE\Khronos\Vulkan\ImplicitLayers`) names itself `VK_LAYER_RENDERDOC_Capture`, so `DISABLE_VULKAN_OBS_CAPTURE=1` does not disable it | `VK_LOADER_DEBUG=layer` prints the layers that were actually inserted. That manifest's `disable_environment` is `DISABLE_LAYER=1`; `DISABLE_LAYER=1` or `VK_LOADER_LAYERS_DISABLE=~implicit~` gave 20 of 20 clean runs (a layer's own switch is its `disable_environment` entry, as the row above says) | | ||
| 452 | | `vk_sync_validation` fails with `LEONIDA_VK_VALIDATION=1` ("the write-after-write hazard was not reported") | Synchronization validation is off although the tests ask for it: an older layer, or a layer setting such as `VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false` or a `vk_layer_settings.txt` that overrides it. Every other GPU test then reports "0 validation errors" without having been checked | Remove the override or update the Vulkan SDK, then rerun `ctest -R vk_sync_validation` until it passes | | 592 | | `vk_sync_validation` fails with `LEONIDA_VK_VALIDATION=1` ("the write-after-write hazard was not reported") | Synchronization validation is off although the tests ask for it: an older layer, or a layer setting such as `VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false` or a `vk_layer_settings.txt` that overrides it. Every other GPU test then reports "0 validation errors" without having been checked | Remove the override or update the Vulkan SDK, then rerun `ctest -R vk_sync_validation` until it passes | |
| 453 | | On RADV with Mesa 25.2 (Ubuntu 24.04's default; 25.2.8 measured) or 25.3 (from the source, not run), `cs_w32_salu64` fails with word 2 = `0` (want `0xFFFFFFFF`) and `cs_signed_zero_nan` fails with word 5 = `0` (want `1`) | Two Mesa bugs, not translator bugs (#166). `cs_w32_salu64`: ACO's `combine_add_sub_b2i` reads a temporary without counting the use, so dead-code elimination removes it (`ACO ERROR: ... never defined` with `MESA_SHADER_CACHE_DISABLE=true`); `RADV_DEBUG=llvm` passes. `cs_signed_zero_nan`: NIR's range analysis (`fmul_is_a_number`) calls `0 * x` a number when `x` may be infinite, so the `x != x` check folds to false despite `SignedZeroInfNanPreserve`. The same NIR code is behind llvmpipe's word 5 (#664) | Expected with these Mesa versions. From the source, the ACO function is gone from Mesa 26.0 and the NIR code was replaced in 26.1 (neither run); RADV from Mesa 26.3.1 passes both on an 8060S (gfx1151) | | 593 | | On RADV with Mesa 25.2 (Ubuntu 24.04's default; 25.2.8 measured) or 25.3 (from the source, not run), `cs_w32_salu64` fails with word 2 = `0` (want `0xFFFFFFFF`) and `cs_signed_zero_nan` fails with word 5 = `0` (want `1`). The `cs_signed_zero_nan` failure alone is also measured on RADV 25.0.7 (RX 7800 XT, Debian 13; @mrbean56, #4421) and on ANV 25.2.8 (Intel UHD 630; @theswiss24, #4571); llvmpipe on Mesa 26.0.8 (Ubuntu 26.04) still gives word 5 = `0`, which `check.py` does not judge there (`UNJUDGED_WORDS`) | Two Mesa bugs, not translator bugs (#166). `cs_w32_salu64`: ACO's `combine_add_sub_b2i` reads a temporary without counting the use, so dead-code elimination removes it (`ACO ERROR: ... never defined` with `MESA_SHADER_CACHE_DISABLE=true`); `RADV_DEBUG=llvm` passes. `cs_signed_zero_nan`: NIR's range analysis (`fmul_is_a_number`) calls `0 * x` a number when `x` may be infinite, so the `x != x` check folds to false despite `SignedZeroInfNanPreserve`. The same NIR code is behind llvmpipe's word 5 (#664) and ANV's, since both drivers run NIR; `cs_w32_salu64` is ACO's, so only RADV has it | Expected with these Mesa versions. From the source, the ACO function is gone from Mesa 26.0 and the NIR code was replaced in 26.1 (neither run); RADV from Mesa 26.3.1 passes both on an 8060S (gfx1151) | |
| 454 | | Every test crashes inside `libnvidia-eglcore.so` | NVIDIA's 535 server driver (Ubuntu 24.04's default) | Use driver 615 or newer | | 594 | | Every test crashes inside `libnvidia-eglcore.so` | NVIDIA's 535 server driver (Ubuntu 24.04's default) | Use driver 615 or newer | |
| 455 | | `build.py`: 0 translated, reason `.text` | An old `build.py` with LLVM 19 | Update to current `main` | | 595 | | `build.py`: 0 translated, reason `.text` | An old `build.py` with LLVM 19 | Update to current `main` | |
| 456 | | `vk_harness` doesn't compile: `VK_KHR_maintenance8` names unknown | Vulkan headers older than the SDK the code was written against | Update to current `main` (the code now builds without it), or use current Khronos Vulkan-Headers; conda-forge's package is too old | | 596 | | `vk_harness` doesn't compile: `VK_KHR_maintenance8` names unknown | Vulkan headers older than the SDK the code was written against | Update to current `main` (the code now builds without it), or use current Khronos Vulkan-Headers; conda-forge's package is too old | |
| 457 | | `ps_bary` and `ps_uniform_branch` fail by about 0.9 | The GPU runs pixel shaders wave64 without fragment barycentrics (GCN3 and RDNA1 on RADV), or an old AMD Windows driver (22.40) | Current `main` skips them on such devices; on Windows, update the driver | | 597 | | `ps_bary` and `ps_uniform_branch` fail by about 0.9 | The GPU runs pixel shaders wave64 without fragment barycentrics (GCN3 and RDNA1 on RADV), or an old AMD Windows driver (22.40) | Current `main` skips them on such devices; on Windows, update the driver | |
| 598 | | `ps_bary`, `ps_persp_bary` and `ps_ij_computed` read the third barycentric as about 0.99 on a gfx90c iGPU (Vega 8, AMD Windows driver 31.0.21921.13001; #5933) | The driver's native `BaryCoordKHR` is wrong there: the same tests pass through `--bary-fallback`, and natively on RADV (Radeon 8060S) | `tools/vk_subgroup_info.py` turns the fallback on by itself for gfx90c under AMD's driver, and `make_game.py`, `run_gpu_tests.py`, `build.py` and `check.py` follow it when `LEONIDA_BARY_FALLBACK` is unset; `=1` forces the fallback and `=0` forces native barycentrics, where they still fail | | ||
| 458 | | `cs_w32_salu64` gives eight wrong words on RDNA1 under RADV Mesa 25.2.8 (`0x1E6A2C48 0x1234 0 0x100 47 48 0xFFFF8000 0xFFFFFFFE`, where word 2 should be `0xFFFFFFFF`) | Only the high word of the `s_bfe_i64` result is wrong. The same words appear on four pinned V540s (Navi 12, PCI `1002:7360`) and on a clean upstream/main worktree, and three different valid SPIR-V sign-extension formulations give the same result while the CPU interpreter matches, so this is the driver version rather than the translator (SHADER-276) | Expected with Mesa 25.2.8; the fixture passes on NVIDIA and on AMD's Windows driver. Try a newer Mesa before treating it as a translator bug; do not weaken the fixture's expectation | | 599 | | `cs_w32_salu64` gives eight wrong words on RDNA1 under RADV Mesa 25.2.8 (`0x1E6A2C48 0x1234 0 0x100 47 48 0xFFFF8000 0xFFFFFFFE`, where word 2 should be `0xFFFFFFFF`) | Only the high word of the `s_bfe_i64` result is wrong. The same words appear on four pinned V540s (Navi 12, PCI `1002:7360`) and on a clean upstream/main worktree, and three different valid SPIR-V sign-extension formulations give the same result while the CPU interpreter matches, so this is the driver version rather than the translator (SHADER-276) | Expected with Mesa 25.2.8; the fixture passes on NVIDIA and on AMD's Windows driver. Try a newer Mesa before treating it as a translator bug; do not weaken the fixture's expectation | |
| 459 | | `d3d12_typeless_rtv` fails its WARP comparison on an AMD desktop iGPU (TEST-591) | [Reported on the Ryzen 5 7600X iGPU with Windows 10 build 19045 and AMD 23.40.02](https://github.com/ItsNotRexed/Leonida/issues/166#issuecomment-7083403389). The exact cause is still open. | Retest on a newer Windows and AMD driver combination. Passing results were reported on the [Ryzen 9 7900 iGPU with AMD 25.10.30.02](https://github.com/ItsNotRexed/Leonida/issues/3232#issuecomment-7085263408), a [gfx1036 iGPU with AMD 26.5.2](https://github.com/ItsNotRexed/Leonida/issues/2891#issuecomment-7084023801), and the [Ryzen 7 9800X3D iGPU with driver 32.0.21045.29003](https://github.com/ItsNotRexed/Leonida/pull/3440). | | 600 | | `d3d12_typeless_rtv` fails its WARP comparison on an AMD desktop iGPU (TEST-591) | [Reported on the Ryzen 5 7600X iGPU with Windows 10 build 19045 and AMD 23.40.02](https://github.com/ItsNotRexed/Leonida/issues/166#issuecomment-7083403389). The exact cause is still open. | Retest on a newer Windows and AMD driver combination. Passing results were reported on the [Ryzen 9 7900 iGPU with AMD 25.10.30.02](https://github.com/ItsNotRexed/Leonida/issues/3232#issuecomment-7085263408), a [gfx1036 iGPU with AMD 26.5.2](https://github.com/ItsNotRexed/Leonida/issues/2891#issuecomment-7084023801), and the [Ryzen 7 9800X3D iGPU with driver 32.0.21045.29003](https://github.com/ItsNotRexed/Leonida/pull/3440). | |
| 460 | | `ps_interp_f16_high` fails on a Mac: `PerVertexKHR decoration is not supported in MSL`, then `vkCreateGraphicsPipelines` -3 | MoltenVK can't convert `PerVertexKHR` inputs to Metal | Current `main` translates it with `--f16-interp-fallback` on MoltenVK (see "Macs: 16-bit interpolation") | | 601 | | `ps_interp_f16_high` fails on a Mac: `PerVertexKHR decoration is not supported in MSL`, then `vkCreateGraphicsPipelines` -3 | MoltenVK can't convert `PerVertexKHR` inputs to Metal | Current `main` translates it with `--f16-interp-fallback` on MoltenVK (see "Macs: 16-bit interpolation") | |
| @@ -464,7 +605,10 @@ The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) r | |||
| 464 | | `cs_dpp_ops` fails on a Mac with MoltenVK 1.4.2: `out[0..7] = 100 100 11 ...`, want `100 10 11 ...` | MoltenVK 1.4.2's SPIRV-Cross moves the DPP lowering's subgroup ballot and shuffle into a short-circuiting `&&` and `?:`, so only some lanes run them and lane 1 sees its source lane 0 as inactive. SPIRV-Cross `5c372ffb` (in MoltenVK `main`) keeps them out of `?:`; a ballot on the right of `&&` is still moved there in SPIRV-Cross `57e4efcc` | Expected with MoltenVK 1.4.2; it passes with MoltenVK `main` (point `LEONIDA_VULKAN_LOADER` at its `libMoltenVK.dylib`) and on KosmicKrisp | | 605 | | `cs_dpp_ops` fails on a Mac with MoltenVK 1.4.2: `out[0..7] = 100 100 11 ...`, want `100 10 11 ...` | MoltenVK 1.4.2's SPIRV-Cross moves the DPP lowering's subgroup ballot and shuffle into a short-circuiting `&&` and `?:`, so only some lanes run them and lane 1 sees its source lane 0 as inactive. SPIRV-Cross `5c372ffb` (in MoltenVK `main`) keeps them out of `?:`; a ballot on the right of `&&` is still moved there in SPIRV-Cross `57e4efcc` | Expected with MoltenVK 1.4.2; it passes with MoltenVK `main` (point `LEONIDA_VULKAN_LOADER` at its `libMoltenVK.dylib`) and on KosmicKrisp | |
| 465 | | `check.py`'s `cs_fma_fused` fails on a Mac with MoltenVK 1.4.2: word 7 reads `15360` (`0x3c00`), want `29521` (`0x7351`) | The f16 multiply-add (round to odd). The MSL of 1.4.2 and of MoltenVK `main` differ only in SPIRV-Cross's precise-arithmetic helpers (`[[clang::optnone]]` and `fma(l, r, 0)` against `math_mode(safe)` and `fma(l, r, -0.0)`, the SHADER-182 / SHADER-234 change) | Expected with MoltenVK 1.4.2; it passes with MoltenVK `main` | | 606 | | `check.py`'s `cs_fma_fused` fails on a Mac with MoltenVK 1.4.2: word 7 reads `15360` (`0x3c00`), want `29521` (`0x7351`) | The f16 multiply-add (round to odd). The MSL of 1.4.2 and of MoltenVK `main` differ only in SPIRV-Cross's precise-arithmetic helpers (`[[clang::optnone]]` and `fma(l, r, 0)` against `math_mode(safe)` and `fma(l, r, -0.0)`, the SHADER-182 / SHADER-234 change) | Expected with MoltenVK 1.4.2; it passes with MoltenVK `main` | |
| 466 | | `gs_tri` and `ms_tri` fail on a Mac | MoltenVK has no geometry stage and no `VK_EXT_mesh_shader` | Current `main` reports them as skipped | | 607 | | `gs_tri` and `ms_tri` fail on a Mac | MoltenVK has no geometry stage and no `VK_EXT_mesh_shader` | Current `main` reports them as skipped | |
| 608 | | With `LEONIDA_W64_EMULATE=1` on llvmpipe, the `ms_*` tests fail. Measured with Mesa 26.3.1: on x86_64 at 256-bit vectors (the default there) all six abort with "LLVM ERROR: Cannot emit physreg copy instruction"; on arm64 (128-bit) `ms_tri` draws nothing (the frame stays at the clear color); on x86_64 at 128 bits (`LP_NATIVE_VECTOR_WIDTH=128`) `ms_tri` happened to draw correctly, but with Mesa 26.0.3 `ms_wave_info_s3` and `ms_v5_workgroup` draw nothing there (4 of 6 pass, [measured by @TreXito](https://github.com/ItsNotRexed/Leonida/pull/3838#issuecomment-7086696759)) ([measured runs](https://github.com/ItsNotRexed/Leonida/issues/3127#issuecomment-7086469679)) | An llvmpipe bug: a mesh shader's runtime `CullPrimitiveEXT` is stored through an invalid `bitcast <N x i1> to <N x float>` (TEST-782, #3127; see "Without a GPU: Mesa llvmpipe") | Run the mesh tests on llvmpipe without `LEONIDA_W64_EMULATE`, or add `LEONIDA_MESH_COMPUTE=1` (the compute fallback): with it all 6 `ms_*` pass emulated on llvmpipe (x86_64, 256-bit) | | ||
| 467 | | On a Mac, `valu_fuzz.py --family f16` reads `+0` where the model wants `-0`, from a multiply whose exact product is -0 (`v_mul_f16`, `v_pk_mul_f16`) or from an FMA whose product and addend are both -0 (`v_fma_f16`, `v_fmac_f16`, `v_pk_fma_f16`) | MoltenVK computes a `NoContraction` multiply as `fma(l, r, +0)`, which drops the sign. MoltenVK 1.4.2 and `main` up to at least `5189f8de` are affected (SHADER-182, [design notes](design.md#translator-status-and-runtime-contract)) | Expected with these MoltenVK versions. To run the rest of the fuzzer clean, add `--skip-op` for each of the five ops. To see them match, install Homebrew's `mesa` and use its KosmicKrisp driver: `LEONIDA_VULKAN_LOADER=/opt/homebrew/opt/vulkan-loader/lib/libvulkan.1.dylib VK_DRIVER_FILES=/opt/homebrew/share/vulkan/icd.d/kosmickrisp_mesa_icd.aarch64.json python3 -I tools/valu_fuzz.py --family f16 --build runtime/build/linux`. Or build MoltenVK with SPIRV-Cross `300681bb` or newer in `ExternalRevisions/SPIRV-Cross_repo_revision`, and point `LEONIDA_VULKAN_LOADER` at its `libMoltenVK.dylib` | | 609 | | On a Mac, `valu_fuzz.py --family f16` reads `+0` where the model wants `-0`, from a multiply whose exact product is -0 (`v_mul_f16`, `v_pk_mul_f16`) or from an FMA whose product and addend are both -0 (`v_fma_f16`, `v_fmac_f16`, `v_pk_fma_f16`) | MoltenVK computes a `NoContraction` multiply as `fma(l, r, +0)`, which drops the sign. MoltenVK 1.4.2 and `main` up to at least `5189f8de` are affected (SHADER-182, [design notes](design.md#translator-status-and-runtime-contract)) | Expected with these MoltenVK versions. To run the rest of the fuzzer clean, add `--skip-op` for each of the five ops. To see them match, install Homebrew's `mesa` and use its KosmicKrisp driver: `LEONIDA_VULKAN_LOADER=/opt/homebrew/opt/vulkan-loader/lib/libvulkan.1.dylib VK_DRIVER_FILES=/opt/homebrew/share/vulkan/icd.d/kosmickrisp_mesa_icd.aarch64.json python3 -I tools/valu_fuzz.py --family f16 --build runtime/build/linux`. Or build MoltenVK with SPIRV-Cross `300681bb` or newer in `ExternalRevisions/SPIRV-Cross_repo_revision`, and point `LEONIDA_VULKAN_LOADER` at its `libMoltenVK.dylib` | |
| 610 | | A pixel shader exporting non-canonical f32 NaNs reads back `0x7fc00000` from an RGBA32F color attachment | KosmicKrisp (Mesa 26.3.1), reproduced on Apple M3 Max, M2 Ultra and M1 Pro ([#3125](https://github.com/ItsNotRexed/Leonida/issues/3125)): `nir_to_msl` emits `(NAN)` for `float`-typed NaN constants (`MESA_KK_DEBUG=msl`); MoltenVK 1.4.2 preserved both tested payloads on the same hardware | `ps_nan_payload` allows the measured canonical word only for the NaN channels and only when `vk_harness` reports `driver: KosmicKrisp`. Finite channels and other drivers still require exact words. Integer or storage-buffer readback still canonicalizes constants that NIR infers as `float` (see the `cs_bvh` row below). | | ||
| 611 | | `cs_bvh` and `cs_bvh32` fail on a Mac with KosmicKrisp: `out[3]` reads `0x7fc00000`, want `0xffffffff` | KosmicKrisp's `nir_to_msl` compiler (Mesa 26.3.1, measured on Apple M2 Ultra, macOS 27.3), not the translator or the buffer format. The triangle branch writes bitcast `float` words and the box branch writes `OpSelect %uint` with `0xffffffff` (`-1`) into the same VGPRs; NIR erases `OpBitcast`, type inference marks the shared register and `bcsel` as `float`, and `nir_to_msl` prints any `float`-typed 32-bit constant in the IEEE-754 NaN range (`0x7f800001..0x7fffffff`, `0xff800001..0xffffffff`) as `(NAN)` (`0x7fc00000`) | Expected with KosmicKrisp in Mesa 26.3.1; MoltenVK 1.4.2 and llvmpipe (Mesa 26.3.1) return `0xffffffff` on the same machine. Do not weaken `vk_compute_test`'s expected BVH words | | ||
| 468 | | CMake stops with "needs the Windows SDK 10.0.26100 or newer", or MSVC reports `'Desc_1_2': is not a member of 'D3D12_VERSIONED_ROOT_SIGNATURE_DESC'` | A Windows SDK older than 10.0.26100 (10.0.22621 is the common one), which has no version 1.2 root signatures | `winget install Microsoft.WindowsSDK.10.0.26100`, or add it in the Visual Studio Installer, then delete `runtime/build` and configure again | | 612 | | CMake stops with "needs the Windows SDK 10.0.26100 or newer", or MSVC reports `'Desc_1_2': is not a member of 'D3D12_VERSIONED_ROOT_SIGNATURE_DESC'` | A Windows SDK older than 10.0.26100 (10.0.22621 is the common one), which has no version 1.2 root signatures | `winget install Microsoft.WindowsSDK.10.0.26100`, or add it in the Visual Studio Installer, then delete `runtime/build` and configure again | |
| 469 | | `ctest` lists `fsr_dispatch` and `bvh_builder` as failed (`Not Run`) after clang-cl hits an internal compiler error in `fsr_dispatch_test.cpp` and `bvh_builder_test.cpp` | clang-cl 22.1.8 on Fedora (Linux cross-build) and Windows, plus 22.1.7 on Windows | Use clang-cl 23.1.6 (both files compile on Windows) | | 613 | | `ctest` lists `fsr_dispatch` and `bvh_builder` as failed (`Not Run`) after clang-cl hits an internal compiler error in `fsr_dispatch_test.cpp` and `bvh_builder_test.cpp` | clang-cl 22.1.8 on Fedora (Linux cross-build) and Windows, plus 22.1.7 on Windows | Use clang-cl 23.1.6 (both files compile on Windows) | |
| 470 | | `d3d12_compute`, `d3d12_draw` or another test that writes a shader library under the temp directory fails now and then (a PSO creation `line N: SUCCEEDED(...)`, or exit 3 with no message) but passes when run alone | Two copies running at once (`ctest -j`, or two suites sharing one Wine prefix or `TMPDIR`) used the same `leonida_<test>` folder under the temp directory, and one copy deleted the shader modules the other was loading: 6 of 40 runs failed with four copies of `d3d12_compute` at once on a Mac under Wine | Current `main` gives each process its own folder (`<temp>/leonida_<test>_<pid>`) | | 614 | | `d3d12_compute`, `d3d12_draw` or another test that writes a shader library under the temp directory fails now and then (a PSO creation `line N: SUCCEEDED(...)`, or exit 3 with no message) but passes when run alone | Two copies running at once (`ctest -j`, or two suites sharing one Wine prefix or `TMPDIR`) used the same `leonida_<test>` folder under the temp directory, and one copy deleted the shader modules the other was loading: 6 of 40 runs failed with four copies of `d3d12_compute` at once on a Mac under Wine | Current `main` gives each process its own folder (`<temp>/leonida_<test>_<pid>`) | |
| @@ -475,6 +619,63 @@ The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) r | |||
| 475 | | `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in the runtime and every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. | | 619 | | `vulkaninfo` lists `Microsoft Direct3D12 (<gpu>)` next to the real GPU and the tests run on it | The Windows "OpenCL™, OpenGL® and Vulkan® Compatibility Pack" installs Mesa's Dozen, a Vulkan-on-D3D12 layer that reports `DISCRETE_GPU` like the native card | Current `main` prefers a native ICD over Microsoft's vendor (`0x1414`) in the runtime and every harness; set `LEONIDA_VK_DEVICE=<part of the real GPU name>` to select explicitly. See #915. | |
| 476 | | A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) | | 620 | | A GPU test that uses `image_load` (or lighting built from real shaders) reads zeros from its image; @Silliana saw every texel except pixel (0,0) come back zero in their own layer (#603, not reproduced here) | In this runtime the shader turns the T# words into an index through the descriptor hash table (`runtime/src/descriptor_table.h`: a miss gives index 0), and index 0 is a 1×1 image of zeros (`runtime/src/vulkan_bindless.h`), so a hand-built or zeroed T# that was never registered reads zeros even at (0,0). The translator does not compare coordinates with the T# size, and `cs_imgload.asm` only uses its T# words as a hash key | Register the descriptor through the runtime (for D3D12, create it with `CreateShaderResourceView`) so its T# hits the table, with the image's real width and height (stored as size − 1, see `runtime/src/gfx10_descriptors.h`) | |
| 477 | | `cs_sample_lz_int_d16`, `ps_sample_implicit_sint`, `ps_ssharp`, `ps_tex`, `ps_texture_mip0`, `ps_texture_sample` and `ps_texture_sample_d16` crash (exit -11 or 139) on an Intel GPU on Linux, while NVIDIA and llvmpipe pass them (TEST-399) | A bug in Mesa ANV's shader compiler: compiling these texture-sampling shaders, `nir_opt_gcm` (`nir_opt_gcm.c:430`, `gcm_schedule_early_src`) dereferences a phi source an earlier pass has freed. The SPIR-V passes `spirv-val`. Seen with Mesa 26.1.6 (Arrow Lake) and 26.2.7 (Iris Xe, ADL GT2); Mesa 26.3.1 and `main` (bb98606) pass the whole suite on the same Iris Xe | Use Mesa 26.3.1 or newer. To check a newer Mesa without installing it, build its Intel Vulkan driver and point `VK_DRIVER_FILES` at its `src/intel/vulkan/intel_devenv_icd.x86_64.json` | | 621 | | `cs_sample_lz_int_d16`, `ps_sample_implicit_sint`, `ps_ssharp`, `ps_tex`, `ps_texture_mip0`, `ps_texture_sample` and `ps_texture_sample_d16` crash (exit -11 or 139) on an Intel GPU on Linux, while NVIDIA and llvmpipe pass them (TEST-399) | A bug in Mesa ANV's shader compiler: compiling these texture-sampling shaders, `nir_opt_gcm` (`nir_opt_gcm.c:430`, `gcm_schedule_early_src`) dereferences a phi source an earlier pass has freed. The SPIR-V passes `spirv-val`. Seen with Mesa 26.1.6 (Arrow Lake) and 26.2.7 (Iris Xe, ADL GT2); Mesa 26.3.1 and `main` (bb98606) pass the whole suite on the same Iris Xe | Use Mesa 26.3.1 or newer. To check a newer Mesa without installing it, build its Intel Vulkan driver and point `VK_DRIVER_FILES` at its `src/intel/vulkan/intel_devenv_icd.x86_64.json` | |
| 622 | | A test exits with `3221225477` (`0xC0000005`, an access violation) on AMD, only when `VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_api_dump` is set (`d3d12_sparse_queue_family_contract` sets it itself) | The Vulkan SDK's API dump layer (1.4.363.0) crashes the test process now and then: on an RX 9060 XT (RDNA4, Windows driver 32.0.32029.2010) `d3d12_buffer_tiles` and `d3d12_queue_wait` crashed in 1 and 4 of 8 runs in one session and in 3 and 1 of 30 in another; the layer's `detailed` and `pre_dump` settings make no difference. Not seen in 24 runs of those tests without the layer, nor in 8 runs each of the SDK's `vkcube` and `vulkaninfo` with it, so it is not simply the layer on that driver | Run the test again. Do not read a crash under the layer as a failure of the test: run the same program without the layer to check its result, and use `LEONIDA_VK_VALIDATION=1` (the Khronos layer) for validation messages | | ||
| 623 | | On an AMD integrated GPU (gfx1036) with AMD's Windows driver (`32.0.21042.62` and `32.0.21045.16010` measured), `crosslane_fuzz.py --wave 64 --w64-native --dpp --no-maskdata --seed 82001 --programs 600` reports one native mismatch: `cs_xl64_8200346406` differs in 96 words (32 lanes of each of its three waves), while `--wave64-emulate` and the hardware oracle match | AMD's Windows driver, not the translator (SHADER-705; the driver's generated code was not inspected). The same native wave64 SPIR-V is exact under RADV (Mesa 26.3.1) on another gfx1036 and on an RX 7900 XTX, and in the CPU interpreter. The wrong instruction is a `v_permlanex16_b32` that reads a register a DPP op with a partial `row_mask` has just written ([shader_validation.md](shader_validation.md), FUZZ-7) | Nothing to change in a build: no shader of the game has that shape (0 of 26,503; the two instructions meet in 6 shaders, all wave32 compute). `--wave64-emulate auto` stays native on this driver because of #857, and the emulated translation of the program matches there | | ||
| 624 | | With `--wave64-emulate` (or `LEONIDA_W64_EMULATE=1`) on an NVIDIA RTX 5080 with Windows driver 32.0.16.1692 (616.92), `crosslane_fuzz.py --seed 91001 --dpp --no-maskdata` reports a hard mismatch for `cs_xl64_9100373886`: after `s_xor_b64 s[16:17], vcc, vcc` (0 in every lane), the second of two nested `v_cndmask_b32_e64 … s[16:17]` returns the old register instead of the lane id | An NVIDIA driver miscompile, not the translator (SHADER-720). The same SPIR-V (spirv-val clean) matches the model on an RTX 3060 with 616.64, an RTX 5060 Ti (Blackwell) with 621.14, an RTX 5070 Ti with 621.24 and an RTX 5080 with the Linux 580.65.06 driver. Hand edits narrow it to a value selected through the `%active` gate of a store; on the Linux 580 driver a similar pattern, a subgroup shuffle selected by an `%active` that is false, still fails in three wave32 `v_permlane16`/`v_permlanex16` programs of the same seed (#3796, #3918) | Update the NVIDIA driver to 621.14 or newer on Windows. If a crosslane mismatch only shows on one driver, check another driver or GPU before changing the translator | | ||
| 625 | | `lds_fuzz.py --wave 64` (native, not `--emulate`) reports a `ds_bpermute_b32` mismatch on an AMD GPU on Windows, e.g. `cs_ldsfuzz_s7031_496_w64` (seed 7031): small values like `0x14` where the model wants another lane's data, while `--oracle hw` and `--emulate` on another GPU agree with the model | The AMD Windows driver (32.0.21042.62, gfx1036) miscompiles a native wave64 compute shader with two subgroup shuffles; a reduced SPIR-V module is in #4613 | Not a translator regression: check the same seed with `--oracle hw` and with `--emulate`. Native wave64 results on that driver need that cross-check | | ||
| 626 | | On AMD's Windows driver a compute pipeline creation takes tens of minutes: `vk_pipeline_check` prints `still compiling <name> after ...s` with one busy thread, or a compute PSO creation through the D3D12 layer seems never to return | The driver's compiler on one module in the dispatch-loop form (`"control_flow": "dispatch loop"` in the translated `index.json`). Measured on a Radeon gfx1036 iGPU, driver 32.0.21042.62 (SHADER-995): `XboxBvhBuilder.dll`'s `LeafRehydration` in that form (a 581-case switch in a loop) was created after 34 minutes of one busy thread (XXTESTING), while its structured module is created in 2.9 s and an RTX 3070 (NVIDIA 610.74) created the dispatch-loop one in 11 s. It is not every such module: ten other programs of that DLL compile in that form on the Radeon in 0.4 to 40 s ([embedded_shaders.md](embedded_shaders.md), section 7). Not tried on another AMD GPU or driver branch | Translate with current `main`. Since SHADER-427 only a tree nested deeper than 64, a graph that cannot be made reducible or `--dispatch-loop` gives that form, and none of that DLL's programs has it; the shaders stage translates again by itself when the translator changed. A wave64 compute shader that still has it comes out in another form with `--wave64-emulate on` (12.4 s for this program on that driver), which that driver can crash on for other programs (#857) | | ||
| 627 | |||
| 628 | ### Signed zero in a float storage image (SHADER-605) | ||
| 629 | |||
| 630 | Build `vk_store_test` as above and put `spirv-as` and `spirv-val` on PATH. Run this standalone | ||
| 631 | probe from the repository root, passing the path to the executable you built: | ||
| 632 | |||
| 633 | ```powershell | ||
| 634 | python -I runtime/test/shaders/probe_signed_zero.py runtime/build/vulkan/vk_store_test.exe | ||
| 635 | ``` | ||
| 636 | |||
| 637 | The probe assembles and validates two hand-written Vulkan 1.2 compute modules. Each requests | ||
| 638 | `SignedZeroInfNanPreserve 32` and executes three constant `OpImageWrite` instructions into | ||
| 639 | a `VK_FORMAT_R32G32B32A32_SFLOAT` image. Only the SPIR-V image format changes (`Unknown` or | ||
| 640 | `Rgba32f`). The harness copies the images back, issues a transfer-write to host-read barrier, | ||
| 641 | waits for completion, and compares all 768 words, including 756 prefilled guard words. | ||
| 642 | A bit mismatch prints the word index and returns exit code 1. Both variants run even if the | ||
| 643 | first comparison fails. | ||
| 644 | |||
| 645 | On a GeForce RTX 5070 with Windows driver 616.56, both formats matched 765/768 words. | ||
| 646 | In the first texel, `(-0, +0, +0, +0)`, word 0 read back as positive zero. The second texel, | ||
| 647 | `(-0, 1, +0, +0)`, retained every bit. In the third, `(-0, -0, +0, +0)`, words 8 and 9 both | ||
| 648 | read back as positive zero. All guards matched. This reproduces the discrepancy independently | ||
| 649 | of RDNA translation. Independent runs of the same probe reproduced those three mismatches on | ||
| 650 | a Linux RTX 5090 (595.99.02). On Windows, a Ryzen 7 9800X3D Radeon iGPU (25.10.30.02), | ||
| 651 | an RTX 3080 (616.64) and an RTX 3060 (621.14) preserved all 768 words in both formats. | ||
| 652 | The device reports are in [PR #3260](https://github.com/ItsNotRexed/Leonida/pull/3260). | ||
| 653 | |||
| 654 | ### Which known problems the game's shaders reach | ||
| 655 | |||
| 656 | Several rows of the table above are tied to particular instructions. A GPU test or fuzzer that hits one does | ||
| 657 | not by itself mean the game does. The counts below say how many of the 26,503 1.0.2.1 shaders (`shaders.rpf`, | ||
| 658 | LLVM gfx1013) contain those instructions, by stage and by the wave size their FSSM header gives. They are | ||
| 659 | counts of instructions over the program up to each listing's last `s_endpgm`. They are not reproductions: a | ||
| 660 | shader that contains an instruction does not have to take the exact path a row describes. | ||
| 661 | |||
| 662 | ```sh | ||
| 663 | python -I tools/op_reach.py <work>/shaders/dxbc/disasm --index <work>/shaders/dxbc/index.json \ | ||
| 664 | --fssm <work>/shaders/dxbc/fssm s_bfe_i64 '*_dpp' v_permlanex16_b32 ds_bpermute_b32 v_mul_f16 ... | ||
| 665 | ``` | ||
| 666 | |||
| 667 | The corpus has 2,662 wave32 shaders (1,535 CS, 1,127 PS) and 23,841 wave64 shaders (every VS, GS and MS, 1,154 | ||
| 668 | CS, 10,974 PS). | ||
| 669 | |||
| 670 | | Row | What the game's shaders contain (1.0.2.1) | | ||
| 671 | |---|---| | ||
| 672 | | `cs_w32_salu64` on RDNA1 / RADV 25.2.8 (the high word of `s_bfe_i64`) | **No shader uses `s_bfe_i64`** (nor `s_bfe_u64`). The fixture's failure does not reach a game shader. | | ||
| 673 | | `lds_fuzz.py --wave 64` `ds_bpermute_b32` on AMD's Windows driver | **No wave64 shader uses `ds_bpermute_b32`**: it occurs in 5 wave32 CS (74 instructions), and `ds_permute_b32` in none. | | ||
| 674 | | `crosslane_fuzz.py --wave 64` on an AMD iGPU (a `v_permlanex16_b32` after a partial-`row_mask` DPP) | DPP in 4,313 shaders, 2,496 of them wave64 (2,364 PS, 113 CS, 17 MS, 2 VS). `v_permlanex16_b32` in 2,293 shaders, 561 of them wave64. Whether any of them pairs the two with a partial `row_mask` is not counted, so these are upper bounds. | | ||
| 675 | | `cs_dpp_ops` on MoltenVK 1.4.2 | DPP (any `*_dpp`) in 4,313 shaders (66,354 instructions): 1,817 wave32, 2,496 wave64. | | ||
| 676 | | `valu_fuzz.py --family f16` signed zero on MoltenVK | `v_mul_f16` 124 shaders, `v_fma_f16` 124, `v_fmac_f16` 130, `v_pk_mul_f16` 55, `v_pk_fma_f16` 47, mostly PS (113–115 for the scalar forms). | | ||
| 677 | | `ps_interp_f16_high` on MoltenVK (16-bit interpolation) | `v_interp_p1ll_f16` / `v_interp_p2_f16` in 4,776 PS (679 wave32, 4,097 wave64), 59,367 instructions each. The count is the instruction, not the `high` operand. | | ||
| 678 | | `gs_tri` and `ms_tri` on a Mac | 195 GS and 9,282 MS, all wave64. | | ||
| 478 | 679 | ||
| 479 | ## Posting your result | 680 | ## Posting your result |
| 480 | 681 | ||
| @@ -482,3 +683,16 @@ Use the template at the top of [#166](https://github.com/ItsNotRexed/Leonida/iss | |||
| 482 | range, OS, the commit you built, the tool versions and the counts each script printed. Post counts and pass/fail | 683 | range, OS, the commit you built, the tool versions and the counts each script printed. Post counts and pass/fail |
| 483 | lines only, never shaders or logs from the game. A failure that isn't in the table above gets its own issue, linked | 684 | lines only, never shaders or logs from the game. A failure that isn't in the table above gets its own issue, linked |
| 484 | from your entry. | 685 | from your entry. |
| 686 | |||
| 687 | The CPU, GPU, VRAM and RAM fields come from `tools/pc_checker.py`, which compares this PC with the Xbox Series X | ||
| 688 | reference specs (or `--profile 2` for the community 1080p Low estimate). Run it in text mode; the default form opens a | ||
| 689 | window: | ||
| 690 | |||
| 691 | ```powershell | ||
| 692 | python -I tools/pc_checker.py --cli --check # spec lines, then exit 0 good, 1 weak, 2 unknown | ||
| 693 | python -I tools/pc_checker.py --cli --check --json | ||
| 694 | ``` | ||
| 695 | |||
| 696 | `--cpu`, `--gpu` and `--ram` override the detected values when a VM or a remote session hides them. Its scores are | ||
| 697 | rough estimates made for this tool, not benchmarks, so put the detected model names in the #166 entry, not the score. | ||
| 698 | `python -I tests/test_pc_checker.py` checks the parsing and the comparison with the window mocked. | ||