upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/testing.md
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 22:12:48 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-24 22:13:02 -0500
commit3ee0037fd3accba459d0d5ecd8acad831174d4d7 (patch)
tree55953ce44091103e4f7c4a2f45490be961282b27 /docs/testing.md
parent9b8707c03dabb59ba2e29b9b0749d3c3eb1f3903 (diff)
parent5115f0887940595aa0f46fed7fc9db28b64151ff (diff)
Merge main into RT-DIRECT-HEAP-GRAPHICS (#1232)
This merges #1064 as prepared (its head + a merge of main), so it brings #1232 up to date with main and with #1064. #1232's branch carried #974 (merged into main since) and an older head of #1064 (7c47fd946). main already supplies the directly indexed heaps to graphics draws (integration #984): graphics_user_data() on DrawInstanced, DrawIndexedInstanced and DispatchMesh, at RootArgumentLayout::graphics_arguments_end (pack_stage(Stage::Pixel)'s end_sgpr, set when the console layout places the signature), LEONIDA_GRAPHICS_DIRECT_HEAPS=0, its notes for a signature on the s0 layout or one that fills s31, and d3d12_graphics_direct_heaps_test (recorded draws and the VS/PS GPU reads). That form stays. What this pull request adds beyond it is carried onto it: the mesh case. Conflicts (all taken from #1064's merged branch, then the PR's mesh parts carried over): - runtime/shims/d3d12_com.cpp: main's graphics_user_data()/with_direct_heaps() and notes. The PR's own graphics_user_data(), GetEnvironmentVariableA switch and no-room notes are main's in another form and dropped. Carried: the comment says a mesh shader reads push dword d as s(d + 8) through #974's window, so it gets the heaps after its arguments from s16 (main's comment still said the mesh stage gets none); and DispatchMesh reports once when a heap falls past the mesh window (push dword 24 and up, s32 for the mesh shader), the case raised in the review of #1232 (mesh_ok accepts arguments up to push dword 24). - runtime/shims/d3d12_com.h, runtime/shims/d3d12_vulkan_device.cpp: main's (graphics_arguments_end from pixel.end_sgpr; the PR set it from its Spill::block form, which main did not take from #974). - runtime/test/glsl/cs_user_data.comp: main's (identical direct-indexing mode). - docs/d3d12_vulkan.md: main's section 3.4 with #1064's compute paragraph; the graphics paragraph's "a mesh shader ... is not modelled" replaced by the mesh window position, cited to issue #14 comment 7143020922 as a report not reproduced here, the window-overflow note and the mesh test. - runtime/test/d3d12_mesh_test.cpp (no conflict): the PR's recorded-argument checks kept (vertex and mesh draw with 4 constants, resource-only rebind, 23 constants, 30 constants); the 30-constant comment now says it keeps pack()'s s0 layout on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
-rw-r--r--docs/testing.md193
1 files changed, 172 insertions, 21 deletions
diff --git a/docs/testing.md b/docs/testing.md
index f8246f888..ffe729d24 100644
--- a/docs/testing.md
+++ b/docs/testing.md
@@ -56,9 +56,9 @@ This page collects the setup steps and the problems testers have run into so far
56 56
57## Build the test programs 57## Build the test programs
58 58
59On a Windows runtime build with Vulkan enabled, CMake only registers `d3d12_translated_draw`, `d3d12_m2_textured`, 59On a Windows runtime build with Vulkan enabled, CMake only registers `d3d12_translated_draw`, `d3d12_rect_list`,
60`d3d12_m2_formats`, `d3d12_m3_frame`, `d3d12_m4_compute` and `d3d12_buffer_uav` when it finds `llvm-mc`, 60`d3d12_quad_index`, `d3d12_m2_textured`, `d3d12_m2_formats`, `d3d12_m3_frame`, `d3d12_m4_compute` and
61`spirv-as` and `spirv-val`. It registers `d3d12_subgroup` only when it finds `llvm-mc` and `glslangValidator`. 61`d3d12_buffer_uav` when it finds `llvm-mc`, `spirv-as` and `spirv-val`. It registers `d3d12_subgroup` only when it finds `llvm-mc` and `glslangValidator`.
62Without `glslangValidator`, other tests are also omitted, including `d3d12_compute`, `d3d12_draw`, 62Without `glslangValidator`, other tests are also omitted, including `d3d12_compute`, `d3d12_draw`,
63`d3d12_set0_compute` and `d3d12_mesh`; some registered tests run only part of their checks. These tests can be 63`d3d12_set0_compute` and `d3d12_mesh`; some registered tests run only part of their checks. These tests can be
64**absent**, not reported as skipped, when their build prerequisites are missing, so a passing `ctest` percentage 64**absent**, not reported as skipped, when their build prerequisites are missing, so a passing `ctest` percentage
@@ -173,6 +173,25 @@ python -I runtime/test/shaders/check.py <out dir> <folder with the test programs
173 173
174For D3D12/runtime tests, `LEONIDA_VK_VALIDATION=1` enables `VK_LAYER_KHRONOS_validation`. When running with validation, set `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` if MSI Afterburner (RivaTuner) or OBS is installed: their overlay layers can add unsupported swapchain usage, and in an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE=~implicit~` (see "Known problems"). 174For D3D12/runtime tests, `LEONIDA_VK_VALIDATION=1` enables `VK_LAYER_KHRONOS_validation`. When running with validation, set `DISABLE_RTSS_LAYER=1` and `DISABLE_VULKAN_OBS_CAPTURE=1` if MSI Afterburner (RivaTuner) or OBS is installed: their overlay layers can add unsupported swapchain usage, and in an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE=~implicit~` (see "Known problems").
175 175
176On Windows, `run_gpu_tests.py` assembles and translates the D3D-78 fixture and runs the UAV readback and WARP
177comparison from the same build folder. Use `--filter cs_texture_uav` to run only this case:
178
179```powershell
180$env:LEONIDA_VK_VALIDATION = "1"
181python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_texture_uav
182```
183
184Use the actual configuration subfolder for the executables with a multi-config generator. The native Windows
185case reports SKIP without WARP or a sufficiently capable Vulkan device; failed translation, a missing test
186executable on Windows, and readback mismatches fail the runner. Devices without sliced 3D views still run the 1D,
187array and whole-mip cases and check that partial views are refused.
188
189CTest runs the same D3D-78 descriptor creation, copy, range/refusal and clear checks with `--descriptors-only`.
190That mode requires Vulkan, but not a translated shader or WARP. The GPU runner still exercises dispatch and readback.
191
192Use `--filter cs_imgload_mip` to check 2D `image_load_mip` on FLOAT (UNORM), UINT and SINT sampled views with
193both full-width and D16 loads; mip 0 contains decoy data and mip 1 holds the expected texels.
194
176`vk_compute_test`, `vk_bindless_test` and `vk_image_fuzz` read `LEONIDA_VK_VALIDATION` too (`vk_compute_test` 195`vk_compute_test`, `vk_bindless_test` and `vk_image_fuzz` read `LEONIDA_VK_VALIDATION` too (`vk_compute_test`
177through `runtime/test/vk_validation.h`): each validation message goes to stderr and a validation error makes the 196through `runtime/test/vk_validation.h`): each validation message goes to stderr and a validation error makes the
178program exit 1, so `LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python scripts/run_gpu_tests.py` fails 197program exit 1, so `LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python scripts/run_gpu_tests.py` fails
@@ -218,6 +237,49 @@ and `vk_presenter_sync`, `xbox_present` and `dxgi_swapchain` pass, while they fa
218compositor for those three. Six still failed with a real display: `device_proxy`, `d3d12_xs_root_signature`, 237compositor for those three. Six still failed with a real display: `device_proxy`, `d3d12_xs_root_signature`,
219`xdxr_build`, `d3d12_xdxr_rt`, `d3d12_present` and `d3d12_compute`. 238`xdxr_build`, `d3d12_xdxr_rt`, `d3d12_present` and `d3d12_compute`.
220 239
240Run one after another as above, the suite takes several seconds per test, although a test started by hand takes 0.1 to
2411 second. Four settings make a local run of the cross-build much faster:
242
243```sh
244export WINEPREFIX="$HOME/.local/share/leonida-wine" WINEDEBUG=-all \
245 WINEDLLOVERRIDES="winedbg.exe=d;winemenubuilder.exe=d"
246mkdir -p "$WINEPREFIX"
247xvfb-run -a sh -c 'wineserver -p; wine wineboot -u </dev/null >/dev/null 2>&1
248 ctest --test-dir runtime/build/windows -j 6 --timeout 120; wineserver -k'
249```
250
251Start the server before `wineboot`: `wineserver -p` does nothing while another server runs for the prefix. Run
252`wineboot` after it, with its output thrown away: the first Wine program a server runs starts the prefix's services,
253which keep that program's output open for as long as the server lives, so a first test that started them would wait
254for the end of its output until the timeout.
255
256- `wineserver -p` keeps one Wine server for the whole run; without it a new one starts for each test.
257- `winedbg.exe=d`: a test that crashes otherwise waits in Wine's debugger until its timeout.
258- `winemenubuilder.exe=d`: without it `wineboot` on a fresh prefix writes `wine-extension-*.desktop` files and the MIME
259 cache into `~/.local/share/applications`, pointing your file associations at the test prefix. Set it before the
260 prefix is first made.
261- `ctest -j 6` runs six tests at a time. The tests that share files under the temp directory (see "Known problems")
262 can then fail now and then; rerun such a failure on its own before you count it.
263
264Measured with Wine 11.22 on llvmpipe, 40 tests of a clang-cl build (`ctest -R '^(d3d12_[a-c]|vk_[a-d]|xg)'`), adding
265one setting at a time:
266
267| Settings | Seconds |
268|---|---|
269| As above: one test after another | 179 |
270| `wineserver -p` (and `wineboot` after it) | 35 |
271| and `WINEDEBUG=-all` | 35 |
272| and `winedbg.exe=d` | 35 |
273| and `ctest -j 6` | 5.6 |
274| `ctest -j 6` and the overrides, without `wineserver -p` | 18 |
275
276The kept server is most of it: a test that takes 0.05 seconds with it took about 3.4 without, the time of a server
277starting and stopping. `WINEDEBUG=-all` and `winedbg.exe=d` changed nothing here because no test crashed; with a crash,
278`winedbg.exe=d` saves the rest of that test's timeout. The full suite (about 310 tests) took about 28 minutes run one
279after another, and 67 seconds with all four settings for two devices (llvmpipe and an integrated GPU) run at the same
280time. `scripts/run_wine_tests.py` (below) does the same: 32 seconds for those 40 tests with `--jobs 1`, 6 with
281`--jobs 6`, and 19 seconds for all 312 tests with `--jobs 6`.
282
221The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. 283The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`.
222`make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build 284`make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build
223runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are 285runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are
@@ -290,7 +352,12 @@ WINE=wine WINEPREFIX="$(mktemp -d)" WINEDLLOVERRIDES="mscoree,mshtml=" WINEDEBUG
290 352
291The session script initializes a dedicated prefix and stops its Wine processes at exit. On a headless host, 353The session script initializes a dedicated prefix and stops its Wine processes at exit. On a headless host,
292put `xvfb-run -a` before `bash` so prefix initialization and the tests share one virtual display. The test runner 354put `xvfb-run -a` before `bash` so prefix initialization and the tests share one virtual display. The test runner
293maps the recorded Windows drive to the Linux checkout for shaders referenced by absolute Windows paths. It prints 355maps the recorded Windows drive to the Linux checkout for shaders referenced by absolute Windows paths. It keeps one
356wineserver alive for the run and stops it at the end, and adds `winedbg.exe=d;winemenubuilder.exe=d` to each test's
357`WINEDLLOVERRIDES` (an entry of yours for the same program wins). `--jobs N` runs N tests at a time (default 1): tests
358marked `RUN_SERIAL` run alone, tests that share a `RESOURCE_LOCK` never overlap, and the verdicts are printed in the
359same order as with `--jobs 1`; the tests that share temp files can fail now and then in parallel (see "Known
360problems"). It prints
294every verdict and returns a failure status if any required test fails, skips or is missing. Check the printed 361every verdict and returns a failure status if any required test fails, skips or is missing. Check the printed
295verdicts for failures outside the required set. 362verdicts for failures outside the required set.
296 363
@@ -336,6 +403,28 @@ on an Apple M3 Max (MoltenVK 1.4.2 and 1.4.3): 17 workgroup shapes from 1 to 102
336subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default 403subgroups, with and without full subgroups and register pressure, all 32 lanes in order. A device whose default
337isn't the requested size still prints `not available`, and those tests skip. 404isn't the requested size still prints `not available`, and those tests skip.
338 405
406`cs_w32_salu_ext` runs 38 scalar ALU ops that no other fixture runs: `s_sub_i32`, `s_andn2_b32`, `s_orn2_b32`,
407`s_xor_b32`, `s_ashr_i32`, `s_mul_hi_u32`, `s_lshl3_add_u32`, `s_lshl4_add_u32`, `s_pack_ll_b32_b16`,
408`s_pack_hh_b32_b16`, `s_abs_i32`, `s_bcnt0_i32_b32`, `s_bitset0_b32`, `s_bitset1_b32`, `s_brev_b32`, `s_flbit_i32`,
409`s_flbit_i32_b32`, `s_sext_i32_i8`, the six `s_cmp_*_i32`, `s_cmp_gt_u32`, `s_cmp_le_u32`, `s_bitcmp0_b32`,
410`s_bitcmp1_b32`, `s_addk_i32`, `s_mulk_i32`, `s_cmovk_i32`, `s_ashr_i64`, `s_lshl_b64`, `s_lshr_b64`,
411`s_bcnt0_i32_b64`, `s_bitset0_b64`, `s_cmov_b64` and `s_ff0_i32_b64`. Its sixteen operand words arrive in `s4..s19`
412through `VKC_SGPRS`, so each op reaches the driver as SPIR-V: a scalar op on literals is folded by the translator
413(the "Chained scalar constant folding" row of [design.md](design.md)) and only its result is stored. One thread stores
414every destination and four words of SCC bits: SCC after each op that writes it, each run on operands that set it
415and on operands that clear it; each compare and bit test both ways, the signed and the unsigned ones on words that
416tell the two apart; and SCC after each op that must keep it, set to 1 and to 0 in turn before them. The 73 expected
417words are literals in `check.py`, derived in the fixture's header, and `tests/test_gpu_salu_ext.py` recomputes them
418from the fixture's own instruction lines with the reference of `tools/salu_diff.py`, the model that was compared
419with hardware. Both GPU runners compare the whole 80-word heap, the untouched fill after the results included. Run
420it alone with `python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_salu_ext --require-pass`.
421On an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 80 words match. Nine
422translator rules broken one at a time each failed it on both: `s_ashr_i32` shifting in zeros (word 8),
423`s_lshlN_add_u32` taking SCC from the add's carry alone (word 69), `s_abs_i32` negating (word 17), `s_mulk_i32` and
424`s_addk_i32` zero-extending their immediate (words 37 and 21), `s_cmovk_i32` ignoring SCC (word 38), the 64-bit
425shifts taking their count modulo 32 and `s_ashr_i64` shifting in zeros (word 51), and the 64-bit shifts taking SCC
426from the low dword alone (word 72).
427
339`cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases: 428`cs_w32_shift64` checks `v_lshlrev_b64`, `v_lshrrev_b64` and `v_ashrrev_i64` with 64 memory-fed cases:
340eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python 429eight boundary values crossed with counts 0, 1, 31, 32, 33, 63, 64 and 65. The expected values come from Python
341integers using the low six count bits, as specified by the [RDNA2 ISA, VOP3 opcodes 767–769](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content). 430integers using the low six count bits, as specified by the [RDNA2 ISA, VOP3 opcodes 767–769](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content).
@@ -347,6 +436,85 @@ It needs shader Int64 support; a device that lacks it reports a skip. This is a
347independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count 436independent of wave64 emulation. On RTX 3080 Ti (616.92, Windows 11), all 640 words matched; replacing the count
348mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively. 437mask with 31 or the arithmetic shift with a logical shift made the test fail at words 66 and 251 respectively.
349 438
439`cs_w32_frexp_ldexp` checks `v_frexp_mant_f32`, `v_frexp_exp_i32_f32`, `v_ldexp_f32`, `v_frexp_mant_f64` and
440`v_frexp_exp_i32_f64`, which the translator computes with integer ops on the float's words. 64 records of a binary32
441value, an `ldexp` exponent and a binary64 value are loaded at run time: normals, the clamp of the exponent at ±512
442and beyond, results that overflow to an infinity and that fall below the smallest normal, binary32 denormals (read
443as zero), binary64 subnormals (normalized; single fraction bits on both sides of the dword boundary and patterns
444with several), zeros, infinities and NaNs. Each thread stores the five results, `v_frexp_mant_f32` with a `neg`
445source and `v_ldexp_f32` with an `abs` source run with the odd threads turned off, whose destination must keep the
446word it held. The expected words come from an oracle written from the rows of [design.md](design.md)
447(`frexp_mant_f32`, `frexp_exp_i32_f32`, `ldexp_f32` and `frexp_f64` in `check.py`), and
448`tests/test_gpu_frexp_ldexp.py` checks it against `math.frexp` and `math.ldexp` wherever those agree with the
449hardware. Both GPU runners compare all 768 heap words, the 256 unchanged input words included. Run it alone with
450`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_frexp_ldexp --require-pass`.
451On an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 768 words match. While
452the binary32 ops still applied `neg` and `abs` with `OpFNegate` and `FAbs`, six words differed on the 4070 Ti and none
453on llvmpipe: every NaN source under a modifier came back as `0x7fffffff`, the driver's default NaN (word 419 is the
454first: the mantissa of the negated `0x7fc00000`). Rules broken one at a time each failed the test on both devices:
455the mantissa given the exponent field 127 (word 0) or, for binary64, 1023 (word 5), the exponent subtracting 127
456(word 1), `v_ldexp_f32` without its clamp (word 258) or overflowing to the largest finite value (word 106), a
457binary32 denormal not read as zero (word 352), the binary64 subnormal exponent off by one in the low or in the high
458dword (words 134 and 150), and the fixture without its `v_cmpx` (word 15).
459
460`cs_w32_cmp_f64` checks the 32 binary64 vector compares, `v_cmp_*_f64` into VCC and `v_cmpx_*_f64` on EXEC, with
461256 memory-fed operand pairs: the product of 16 values (±inf, ±max, the 1-ULP neighbours of ±1, the smallest
462subnormals, ±0, the smallest normal, a NaN whose payload is only in the low dword and a negative quiet NaN). Each
463thread stores one bit per predicate for both forms, a bit for `tru` run with the odd threads turned off (an inactive
464lane gets VCC 0 from `v_cmp_` and stays off through `v_cmpx_`) and two bits for `lt` and `nge` with VOP3 `abs`/`neg`.
465The expected words come from Python floats (`cmp_f64_words` in `check.py`): IEEE-754 ordering, with every pair that
466has a NaN unordered. Both GPU runners compare all 1536 heap words (512 result words and 1024 unchanged input words);
467the operands are loaded at run time, so neither the translator nor the driver can fold a compare. Run it alone with
468`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_cmp_f64 --require-pass`.
469It is a wave32 test and no step of it needs a particular subgroup width, so it also runs on llvmpipe; the SGPR-pair
470and constant operand forms are CPU-checked only (`tests/semantic/test_cmp_f64.py`). On an RTX 4070 Ti (NVIDIA
471620.70.06, Linux) all 1536 words matched, and seven translator rules broken one at a time each failed it: no `-0`
472canonicalization at word 206, a NaN test that ignores the low dword at word 28, an ordering key without the low
473dword at word 70, the raw result written to an inactive lane's VCC at word 2, `v_cmpx_` replacing EXEC at word 3,
474`abs` ignored and `nlt` lowered as the negation of `le` at word 0.
475
476`cs_w32_round_f64` checks `v_trunc_f64`, `v_ceil_f64`, `v_rndne_f64` and `v_floor_f64`, which the translator gives
477to the driver's double-precision `Trunc`, `Ceil`, `RoundEven` and `Floor` (`shaderFloat64`). 64 inputs are loaded at
478run time: signed zeros, the smallest subnormals and normals, values around 0.5 and 1 (the largest value below 0.5
479among them), ties from 0.5 to 5.5 and at 2^31 + 0.5, 2^51 + 0.5 and 2^52 - 0.5, integers from 2^52 to 2^63, 1e300,
480the largest finite value, the infinities, and quiet and signalling NaNs. Each thread stores the four roundings,
481`v_trunc_f64` with a `neg` source, `v_ceil_f64` with an `abs` source, a `v_floor_f64` whose destination pair overlaps
482its source pair, and a `v_rndne_f64` run with the odd threads turned off, whose destination must keep the pair it
483held. The expected words come from Python (`round_f64` in `check.py`: exact IEEE-754, the result keeping its
484source's sign), and `tests/test_gpu_round_f64.py` checks that oracle against exact rational rounding. All 1152 heap
485words are compared exactly, the 128 unchanged input words included: a NaN and a subnormal are rounded by the
486translated code with integer ops and not by the driver, as the row in [design.md](design.md) says. (llvmpipe gets
487one allowance, for what it does to `Trunc` and `RoundEven` on some CPUs; see below.) Run it alone with
488`python -I scripts/run_gpu_tests.py --build runtime/build --filter cs_w32_round_f64 --require-pass`.
489It needs `shaderFloat64`; a device without it reports a skip.
490
491Measured: on an RTX 4070 Ti (NVIDIA 620.70.06, Linux) and on llvmpipe (Mesa 26.2.6, LLVM 23.1.4) all 1152 words
492match. While those two kinds of input still went to the driver's function, 15 of the 512 results differed on the
4934070 Ti, those of the two signalling NaNs, which came back quiet with sign and payload kept (`0x7ff0000000000001`
494gave `0x7ff8000000000001`), and five more on llvmpipe, which read the two smallest subnormals as zero (`v_ceil_f64`
495of the positive one gave +0 instead of 1, `v_floor_f64` of the negative one -0 instead of -1). Rules broken one at a
496time each failed the test on both devices: a NaN left to the driver (word 784), the NaN and subnormal tests ignoring
497the low dword, `v_ceil_f64` or `v_floor_f64` lifting the subnormal of the wrong sign (words 34 and 38), a subnormal's
498result losing its sign (word 40), a NaN's low word dropped (word 784), `rndne` lowered as `floor(x + 0.5)` (word 20,
499the sign of -0), `trunc` or `ceil` lowered as `Floor`, the `neg` or the `abs` source modifier ignored (words 8 and
50026), the two result words swapped (word 8), and the fixture without its `v_cmpx` (word 30). Two changes are not
501caught everywhere: a subnormal left to the driver fails on llvmpipe (word 34) and passes on the 4070 Ti, which keeps
502binary64 denormals, and `RoundEven` replaced by GLSL `Round` changes nothing on either device, since both send a tie
503to the even integer.
504
505llvmpipe gave those results on a CPU with AVX-512. On one without it, `Trunc` and `RoundEven` of a double go through
506the code llvmpipe has for a float, because its double vectors are twice its native width (512 bits at the usual 256)
507and it only has the exact rounding for a width the CPU has an extension for. There a magnitude above 2^24 comes back
508unchanged (`v_trunc_f64` of 123456789.0625 is 123456789.0625) and `RoundEven` of a smaller one can give the other
509neighbouring integer (1 for 1.5, 0 for the value just above 0.5): 48 of the 512 results, the same 48 with Mesa
51025.2.8 (LLVM 20.1.2) on a CI runner and with Mesa 26.2.6 under `GALLIUM_OVERRIDE_CPU_CAPS=avx`, which is how to see
511it on a CPU that has AVX-512. `Floor` and `Ceil` are exact on that path. The CI's runners differ in this, so the
512unchanged fixture passed or failed there by the machine it got. On llvmpipe the judge therefore lets `v_trunc_f64`
513and `v_rndne_f64` return what that path can give, the source itself above 2^24 and either neighbouring integer
514from 0.5 up to it, and nothing else (`ROUND_F64_FLOAT_PATH` in `check.py`); `v_floor_f64`, `v_ceil_f64`, the kept
515pair and the inputs stay exact there, and no other device gets the allowance. `LP_NATIVE_VECTOR_WIDTH=128` makes
516llvmpipe exact on a CPU with AVX.
517
350## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`) 518## Wave64 pixel, vertex and geometry shaders (`w64_graphics.py`)
351 519
352Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the 520Graphics stages have no emulation: on a 32-wide subgroup a wave64 VS, PS or GS runs as two 32-lane halves, and the
@@ -386,23 +554,6 @@ Each line prints `ok`, a `SKIP` with its reason, or what differed. To add a fixt
3863. Add it to `EXPECT` in `tests/test_wave64_halves_fixtures.py` with the tier, reasons and idioms the translator 5543. Add it to `EXPECT` in `tests/test_wave64_halves_fixtures.py` with the tier, reasons and idioms the translator
387 should give it, and run `python -m pytest tests/test_wave64_halves_fixtures.py`. 555 should give it, and run `python -m pytest tests/test_wave64_halves_fixtures.py`.
3884. Run `w64_graphics.py` on a RADV GPU and say which GPU and Mesa version in the pull request. 5564. Run `w64_graphics.py` on a RADV GPU and say which GPU and Mesa version in the pull request.
389## GPUs with 128 bytes of push constants (AMD RDNA2 iGPUs on Windows, some Intel Arc drivers)
390
391The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose
392`maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through
393`vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit.
394AMD'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
3957600's iGPU on 24.10.24); 26.11.2 reports 256 on a Radeon 610M, where these tests run without the variable below.
396RADV reports more on the same chips.
397
398To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for
399`run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes,
400and the heap base and code base move to a uniform block at set 1 (`docs/design.md`, "Push-constant tail as a uniform
401block"), which `vk_compute_test`, `vk_store_test`, `vk_harness`, `vk_texture_test`, `vk_sampler_test` and
402`vk_bindless_test` bind (`runtime/test/vk_pc_tail.h`). If you set it
403only for `check.py`, the shaders read the tail from push constants the programs no longer declare. `--mesh-compute`
404(`LEONIDA_MESH_COMPUTE=1`) isn't combined with it yet: its vertex shader still reads the output address from push
405constants, so those tests skip.
406 557
407## GPUs with 128 bytes of push constants (AMD RDNA2 iGPUs on Windows, some Intel Arc drivers) 558## GPUs with 128 bytes of push constants (AMD RDNA2 iGPUs on Windows, some Intel Arc drivers)
408 559