Commit Graph

594 Commits

Author SHA1 Message Date
37e66e90ba GPU tests: preserve wave32 process failures on narrow subgroups 2026-11-22 22:12:41 -05:00
71d8f86853 Translator: v_permlane16/x16 FI=0 and BOUND_CTRL for source lanes off in EXEC (SHADER-74)
op_sel:[FI, BOUND_CTRL] decides what a lane gets when the lane it reads is off in EXEC (or absent from a
workgroup smaller than the wave): FI=1 reads its value, FI=0 keeps the destination (BOUND_CTRL=0) or writes 0
(BOUND_CTRL=1). Measured on RDNA2 (issue #374). The activity of the source lane is shuffled with absent lanes
redirected first, as ds_lane_read does, and the old destination is a plain load, as dst() does.
cs_w32_permlane_fi (GPU) and test_permlane_fi (CPU); the shuffle-count and destination-select controls of
test_valu_permlane16 follow the extra activity shuffle on the FI=0 path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 21:37:38 -05:00
c14daecc6b Report GPU test workspace creation errors 2026-11-23 03:16:12 +01:00
7de2d4461b rdna2spirv: ignore omod on f16 results with denormals kept, keep clamp (gfx1036) 2026-11-23 04:39:01 +03:00
87da932770 run_gpu_tests: an unsupported: reason wins over the generic wave64 skip
For a whole-wave dump a missing OpFmaKHR was reported as "no 64-wide compute
subgroup" on a device that does have one, because the wave64 rule ran before
the reason the program printed. Read the "unsupported:" line first; without
one the old text stays.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpL5aWzXuYTbhn6b52
2026-11-22 21:35:01 -03:00
b9a8aca16a GPU tests: skip a draw when any stage needs OpFmaKHR the device lacks
docs/testing.md says a module that needs OpFmaKHR exits 77 (a SKIP) on a
device without VK_KHR_shader_fma, but only the fragment module was checked
in vk_harness, and vk_texture_test, vk_sampler_test and vk_bindless_test
never refused the vertex module (vs_ids carries FMAKHR). Under
LEONIDA_FMA=khr such a pair failed vkCreateGraphicsPipelines with -13 and
run_gpu_tests.py reported a FAIL.

ShaderFma::accepts_file() checks one module file. vk_harness (vertex module,
VKH_MESH_COMPUTE module), vk_texture_test, vk_sampler_test and
vk_bindless_test use it for every stage; vk_sampler_test also enables the
feature when the device has it, like the others. judge_cs_dump treats exit 77
with an "unsupported:" line as a skip for the non-wave64 dumps too
(cs_w32_new_ops).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015z45kpL5aWzXuYTbhn6b52
2026-11-22 21:19:17 -03:00
c5e6cc5c38 run_gpu_tests: a missing or partial readback fails its test, not the suite
ps_interp_f16_high (also drawn by ms_f16_pack) and ps_ij_computed still
unpacked their readbacks with a bare struct.iter_unpack("<4I", ...): a
file whose size isn't a multiple of 16 raised struct.error, a missing
one FileNotFoundError, and nothing caught either, so the run ended there
and every other test's result was lost. They now read it like #3442's
Mandelbrot fix, read_raw_u32(raw) if the file exists, else no pixels,
which the checkers already report as a failure of that test.

tests/test_run_gpu_readback_size.py: the suite with the harness stood
in for, a missing, empty, partial-pixel and one-byte-short readback for
each test (6 of the 8 cases crash the suite on main).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:15:02 +01:00
4f760c1aed Shader: isolate wave32 pixel operations in wider subgroups (SHADER-731) 2026-11-22 20:07:05 -04:00
e58a605118 GPU test cs_global_mem_ext: global/buffer atomics, 8/16-bit global stores, d16 loads
global_atomic_*, global_atomic_*_x2, buffer_atomic_*_x2 and the 8/16-bit
global stores and d16 loads were merged with semantic tests only.
cs_global_mem_ext.asm, laid out like cs_global_neg_offset (40 groups, one
thread, heap offsets as addresses), seeds a heap and stores eight words;
check.py (GLOBAL_OFFSET) and run_gpu_tests.py expect them.

tests/semantic/test_global_mem_ext_fixture.py runs the fixture on the
CPU against values computed in the test and checks both runners expect
the same words. test_shader_checks.py's fake harness answers every
GLOBAL_OFFSET entry.
2026-11-22 20:53:26 -03:00
9668102f53 GPU test ps_cndmask_sign_mods: v_cndmask_b32 modifiers keep NaN and denormal bits
Signalling NaNs and a denormal through -v, |v| and -|v| on src0 and src1.
On an RTX 5060 Ti (driver 621.14) the old FAbs path gave 0x7fffffff for
|0xff800001| (the driver's canonical NaN); with the sign-bit moves all
4096 pixels are exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:45:02 +01:00
d2e989c46e Merge main into valu-int-misc (#1492)
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/regen_fixtures.py
tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 23:49:26 +01:00
1291a6878c GPU tests: raw barycentrics under perspective (ps_persp_bary, vs_persp)
The raw-barycentric tests draw with vs_ids, where clip w = 1 at every vertex, so nothing checked that the raw
i/j (and the attributes) follow perspective-correct weights. vs_persp draws one triangle at screen (5,8),
(57,16), (21,55) with clip w = 1, 2, 4 and per-vertex attr0; ps_persp_bary is ps_bary's code drawn with it.
check.py's bary_persp_problem compares every pixel with CPU weights p_k = (l_k / w_k) / sum(l_m / w_m) from the
screen-space weights l_k, checks that pixels outside stay clear, and requires the affine weights to differ by
more than 100x the tolerance on every judged pixel, so a NoPerspective regression can't pass. run_gpu_tests.py
uses the same reference (PIXEL_VS, DRAWN_WITH). Suggested by Vonsek in #794.

On main it runs the native BaryCoordKHR path (it skips without VK_KHR_fragment_shader_barycentric, like
ps_bary); any barycentric fallback that lands (#804) is exercised by it too. Checked on an RX 5700 XT (RADV)
through a GS fallback: passes at wave32 and wave64; with NoPerspective on the fallback's input, all 1149
covered pixels fail while the interpolated attributes still match. New tests/test_bary_persp_oracle.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:37:21 -06:00
ed91cd250a Tests: GPU checks for v_med3_f32/f16 with a NaN in S2 or in two operands
ps_fnan_med3 puts its NaN in S0 only, so no GPU test reached the cases
ps_fnan_med3_s2 (f32) and ps_f16_fnan_med3 (f16), with inputs read from
memory at run time and words derived from the measured rule in
docs/design.md (with any NaN operand, med3 is min3 with the NaNs
ignored). The all-NaN case is left out: its payload is not modelled.

Registered in check.py and run_gpu_tests.py; the semantic fixtures and
GpuFixtures tests run them through the interpreter, where the
translator before #2029 fails them (undefined FClamp on a NaN).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:18:01 +01:00
6da1c717fc Merge main into hw-mad-u32-u16 (#2494)
docs/design.md
tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 23:15:36 +01:00
cd30309409 Merge main into gpu-vopc-int (#2220)
tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 23:12:43 +01:00
e8c9155965 Merge remote-tracking branch 'origin/main' into run-gpu-tests-exit-status-in-fail-line
# Conflicts:
#	tests/test_run_gpu_tests.py
2026-11-23 00:05:29 +02:00
5816b2404d Merge pull request #3786 from DanielDeGiorgio 2026-11-22 17:03:47 -05:00
aec744e39d Tests: account for KosmicKrisp NaN readback (TEST-783) 2026-11-23 01:03:29 +03:00
eab0ac15ef Merge pull request #3442 from Vonsek 2026-11-22 17:02:03 -05:00
7c403b8602 Merge pull request #3423 from Shrey Ratna 2026-11-22 17:01:56 -05:00
8860b36ebf Merge pull request #3004 from Moaaz Gewili
# Conflicts:
#	docs/design.md
#	docs/testing.md
2026-11-22 17:00:22 -05:00
5bed65414b Merge pull request #2965 from Vonsek 2026-11-22 17:00:15 -05:00
04361d0a39 Translator: --fma exact, a single-rounded f32 FMA without VK_KHR_shader_fma (SHADER-497) 2026-11-23 00:00:12 +02:00
4ec7c06c69 Merge pull request #2697 from Vonsek 2026-11-22 16:59:35 -05:00
0ec32fe027 Merge pull request #1938 from undeadhuman37 2026-11-22 16:58:55 -05:00
d4d8c9c3a9 run_gpu_tests: a test program that dies puts its exit status in the FAIL line
Nineteen rows show the last output line of a test program that judges itself
(cs_wavemask, cs_lds, cs_exec64, cs_bvh, cs_bvh32, the vk_store_test,
vk_texture_test and vk_bindless_test rows). A program that died before its
verdict had only printed its device or extension line, or nothing, so the row
read "FAIL  ps_tex" or "FAIL  cs_sample_lz_int_d16  device: ..." (#3174).

verdict_line() keeps the last line for exit 0 and uses check.py's failure()
otherwise: "exit -11: device: ...", "exit 3221225477: no test output". The
texture-constant rows no longer report "4096 pixels differ" for a frame that
was never read. Pass/fail and the suite's exit code do not change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 23:37:05 +02:00
99fb9e372a TEST-837: Require fresh GPU test readbacks 2026-11-22 22:36:56 +01:00
8e28bd70bf Merge main into gpu-far-branch (#2697)
docs/design.md
runtime/test/shaders/check.py
scripts/run_gpu_tests.py

AI-assisted.
2026-11-22 21:57:04 +01:00
01763ffeeb Merge main into image-sample-c (#2965)
tools/rdna2spirv.py

AI-assisted.
2026-11-22 21:53:14 +01:00
2de7daaf15 Merge main into hw-mad-u32-u16 (#2494)
docs/design.md
tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 21:39:51 +01:00
e3e1eece51 Merge main into valu-int-misc (#1492)
scripts/run_gpu_tests.py

AI-assisted.
2026-11-22 21:34:35 +01:00
0db72c42a5 fix(tests): require full Mandelbrot readback in the GPU suite
The oracle accepts arbitrary square frames, so an empty or one-pixel readback passed a draw that was expected to produce 4096 pixels.
2026-11-22 21:32:26 +01:00
6e083c17d9 rdna2spirv, run_gpu_tests: folders outside the ANSI code page reach the native tools
On Windows, spirv-as, spirv-val and the GPU test programs read their command line in the ANSI code page, so a folder
name with a character outside it (a Cyrillic or CJK user name, as under %TEMP%) reached them as '?' and every shader
failed with "file does not exist": run_gpu_tests.py's default work folder broke for such users, and so did
make_game.py's shaders stage under such a work folder.

- assemble_spirv pipes the .spvasm into `spirv-as -` and runs both tools in the output folder with the staging file's
  bare name, so no path reaches them.
- run_gpu_tests.py runs the suite in the work folder's 8.3 short name when its path doesn't fit the code page, and
  stops with one error line when the volume keeps no short names.
- tests/test_native_tool_paths.py: 8 tests with a private-use character in the folder name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:57:30 +05:30
0808dfa96e Tests for SHADER-328: constant SGPR offsets in SMEM loads, CPU and GPU
The 64-bit fold itself landed with #1948. This adds what #1938 still carries:
two semantic tests (a constant sOFF of -4 is out of bounds, not a 32-bit
wrap; a constant sOFF of 2^20 is not sign-extended) and the GPU fixture
cs_smem_sconst_off. Its run-time sOFF is now in range (4): an out-of-range
run-time sOFF made llvmpipe do the guarded load and segfault (review on

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:17:58 +03:00
a66a71ffd3 Merge pull request #3318 from pmilewsskiedu-gif 2026-11-22 15:16:55 -05:00
b9ed33b241 Merge pull request #3263 from Dominik 2026-11-22 15:16:18 -05:00
83047c2ea4 Merge pull request #3074 from Wasler
# Conflicts:
#	docs/design.md
2026-11-22 15:14:36 -05:00
ee44e79112 Merge pull request #2953 from Vonsek 2026-11-22 15:13:32 -05:00
66ff7cb82a Merge pull request #2039 from Vonsek 2026-11-22 15:10:04 -05:00
c4eaab94c9 Merge pull request #1518 from Henrique Vinagre 2026-11-22 15:09:42 -05:00
94a6cba5e7 Merge pull request #1299 from Vonsek 2026-11-22 15:09:39 -05:00
58024a3a6f Merge pull request #896 from DiazE117 2026-11-22 15:09:38 -05:00
04c99b0825 Translator: --fma exact, a single-rounded f32 FMA without VK_KHR_shader_fma (SHADER-497) 2026-11-22 22:07:33 +02:00
c82fbe37d1 Shader: flush legacy f32 multiply operands and results in default MODE
Match RDNA2 mode-0 denormal semantics and legacy zero override; flush product before output scaling and normalize modifier zeros. Add synthetic semantic/GPU fixtures and documentation. AI-assisted (GPT-6).
2026-11-22 15:03:13 -05:00
61a9adc2a8 vk_compute_test: VKC_HEAP_INIT seeds the heap from a file before the dispatch
A compute program that reads its inputs from memory (a root table, descriptors,
data) needs them in the heap before it runs; VKC_SGPRS only reaches s4..s31.
VKC_HEAP_INIT=<file> copies the file to Xbox VA 0 after the default fill. A file
larger than the buffer, or one that can't be read, is refused (exit 2).

cs_heap_init.asm loads four words the file put at 0x100 and stores them at 0;
check.py and run_gpu_tests.py write the file and check the words and the
file's zeros past them. First part of TEST-594 (the BVH builder's programs read
their root table from the heap).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:56:18 +00:00
4c3d624bda Merge main into hw-mad-u32-u16 (#2494)
Conflicts:
	docs/design.md
	tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 20:31:52 +01:00
3eb80d77e3 Merge main into cov-d16fmt (#2039)
Conflicts:
	scripts/run_gpu_tests.py
	tests/semantic/regen_fixtures.py
	tests/test_shader_checks.py

AI-assisted.
2026-11-22 20:27:12 +01:00
82cb279597 rdna2spirv: fix TwoSum overflow in Gen.f64_add_mode via FastTwoSum 2026-11-22 21:17:31 +02:00
a922e9edd4 tests: CPU value tests for 8/16-bit and 64/96/128-bit LDS accesses
Two wave32 GPU tests, cs_w32_lds_subdword (ds_write_b8/_b16 and their
_d16_hi forms, ds_read_u8/_i8/_u16/_i16) and cs_w32_lds_wide
(ds_write/ds_read _b64/_b96/_b128, ds_read2st64_b32), and a semantic
test that runs them in the SPIR-V interpreter against a byte-level LDS
model of the ISA rules, with three SPIR-V sabotages as negative
controls. These ops were checked only by lds_fuzz.py, which needs a GPU.

No translator change. RTX 4070 SUPER, driver 610.88: both dumps match.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:17:14 -06:00
23b458b5f8 rdna2spirv: image_sample_c and image_sample_c_b, depth compares with implicit LOD (EGEN-MIMG-SAMPLE-C)
image_sample_c / image_sample_c_b (and their _o forms) were Unsupported. In a
pixel shader they are OpImageSampleDrefImplicitLod (Bias for _c_b); LOD 0 for
_c elsewhere. The _c_b address order is bias then z-compare (the parser read
the compare first). vk_texture_test now honours LEONIDA_VK_DEVICE. GPU tests
ps_sample_c and ps_sample_c_b, semantic tests, design.md row.

AI-assisted.
2026-11-22 19:57:23 +01:00