Commit Graph

594 Commits

Author SHA1 Message Date
9fe7fee5e1 Merge main into gpu-vopc-int (#2220)
tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 19:53:43 +01:00
161fdf545a fix(test): verify the barycentric fixture gradient
Collapsed interpolation could satisfy the comparison between the raw and interpolated results. Use the known full-screen triangle gradient to verify their agreement is meaningful.
2026-11-22 19:53:30 +01:00
16a98e4bb7 Merge main into valu-int-misc (#1492)
tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 19:52:33 +01:00
676c6abae3 Merge main into coverage-gaps (#1299)
runtime/test/shaders/check.py
scripts/run_gpu_tests.py
tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 19:52:12 +01:00
2426df3d5e GPU tests: wire cs_fma_fused in run_gpu_tests and accept GLSL Fma split on RADV 2026-11-22 18:34:11 +00:00
47449d3e29 Merge pull request #2729 from itsRevela
# Conflicts:
#	docs/design.md
2026-11-22 13:17:24 -05:00
7fe2918ac8 Merge pull request #2607 from Vonsek 2026-11-22 13:16:31 -05:00
40055efb95 Merge pull request #2531 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 13:15:58 -05:00
c64494b9fe Merge pull request #2411 from TurboSosiska304 2026-11-22 13:15:07 -05:00
45e4a2e370 Merge pull request #2404 from S1m0ne1997 2026-11-22 13:15:04 -05:00
c4bee344ef Merge pull request #2399 from AAyberkU 2026-11-22 13:14:44 -05:00
151c372ee1 Merge pull request #2395 from Matheus Gomes 2026-11-22 13:14:40 -05:00
fbd598c2d0 Merge pull request #2187 from Vonsek 2026-11-22 13:13:12 -05:00
407a53923e Merge pull request #2048 from whoalin1
# Conflicts:
#	docs/testing.md
2026-11-22 13:12:54 -05:00
51d954a2cd Merge pull request #436 from S1m0ne1997 2026-11-22 13:12:27 -05:00
90c4ea6701 test: GPU fixtures for sub-dword MUBUF loads and GFX10_FORMAT_8_UINT (TEST-510)
The docs/design.md "Sub-dword MUBUF loads and GFX10_FORMAT_8_UINT" row was
CPU-checked only. Two single-thread compute fixtures in run_gpu_tests.py's
dump list now run the translated loads through Vulkan:

cs_buf_load_sub: buffer_load_ubyte/sbyte/ushort/sshort zero- and
sign-extended, the dword-crossing ushort at offset 3, and the RAW end check
by element size (a ubyte at 8 and a ushort at 7 of 8 bytes read 0; a
start-only check would read 0xeefe from the 0xee filler).

cs_buf_fmt8: tbuffer_load_format_x format:[BUF_FMT_8_UINT] at offsets 0..3,
one byte past the end, an INVALID V# format (0), and buffer_load_format_xyzw
with V# format 8_UINT and DST_SEL (X, 0, 1, 1), whose w is integer 1.

Both pass on an RTX 3070 Ti (driver 610.88); the expected words follow the
CPU test's byte table and rules. The row now says so; AMD hardware is still
unmeasured.
2026-11-22 12:02:47 -06:00
37c29f6c82 Tests: GPU test for the far-branch idiom, and no crash on it without encodings
ps_far_branch runs s_getpc_b64 / s_add_u32|s_sub_u32 / s_addc_u32|s_subb_u32 /
s_setpc_b64: two forward jumps, a sub/subb loop, an add/addc -1 loop and a
conditional far jump, with K derived by hand. fold_far_branches now folds the
idiom only when its instructions have encodings, so a listing without them
gives Unsupported instead of a TypeError.

AI-assisted.
2026-11-22 18:54:57 +01:00
64184fc835 Merge main into sdwa-dword-hi16 (#2187)
Conflicts:
	tests/semantic/test_value_semantics.py

AI-assisted.
2026-11-22 18:53:24 +01:00
29b1ba10d9 Tests: GPU test for 16-bit float v_cmpx compares (all 16 f16 predicates, e32 and e64)
Two pixel tests, ps_vcmpx_f16 (e32) and ps_vcmpx_f16_e64 (swapped operands),
on the operand pairs of ps_vcmp_f16: the EXEC result of each predicate, VCC
kept, and EXEC only ANDed. Words derived by hand in the headers; semantic
fixture and test added.

AI-assisted.
2026-11-22 18:37:20 +01:00
f161481d34 Merge main into valu-int-misc (#1492)
Conflicts:
	tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 18:29:33 +01:00
dd678a7681 Merge main into coverage-gaps (#1299)
Conflicts:
	tests/semantic/regen_fixtures.py

AI-assisted.
2026-11-22 18:29:28 +01:00
6bbc893ea2 Tests: GPU test for 16-bit float VOPC compares (all 16 f16 predicates, e32 and e64)
Two pixel tests, ps_vcmp_f16 (e32, VCC) and ps_vcmp_f16_e64 (SGPR destination,
swapped operands), with NaN, +-0, +-inf, f16 denormals and junk high halves.
Words derived by hand in the headers; semantic fixture and test added.

AI-assisted.
2026-11-22 18:24:00 +01:00
c921b244ab rdna2spirv: v_mad_u32_u16 / v_mad_i32_i16 op_sel on S2 and D, and clamp
These forms were refused. Measured on RDNA2 (gfx1036, raw kernels through
tools/hw_oracle, wave32 and wave64): op_sel bit 2 adds S2[31:16]
zero-extended (in the i16 op too), op_sel bit 3 writes the result shifted
left by 16, and clamp saturates the sum to u32 / i32 before that shift.

GPU test ps_valu16_mad_sel (4096/4096 on RTX 5080 and the gfx1036 iGPU), the
same shader as a semantic fixture, test_alu_mad_32_16 checks the measured
rule instead of the refusal, and a docs/design.md row (EGEN-HW-MAD-U32-U16).

AI-assisted.
2026-11-22 18:15:11 +01:00
97afefdebc Merge remote-tracking branch 'origin/main' into shader-33-vs-inputs
# Conflicts:
#	tests/test_shader_checks.py
2026-11-22 18:06:20 +01:00
a012fe0c1f SHADER-337: GPU test of image_sample_o, image_sample_b_o and image_gather4_l_o with texel offsets
ps_texoff_forms runs the three forms on vk_texture_test's texture with ps_texoff's per-pixel offset (all 64 pairs in
-4..3). check.py and run_gpu_tests.py judge it with texoff_words(..., "ps_texoff_forms"); unit tests check that a
dropped or swapped offset fails. 4096/4096 pixels exact on an RTX 4090 and on a gfx1036 iGPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:56:02 +01:00
a1343528f7 scripts, viewer: a redirected stdout no longer dies on a path outside the code page
Under `python -I` on Windows a redirected stdout is strict ANSI, so printing a path with a character outside the
code page raised UnicodeEncodeError. tools/ guards against it at the start of every __main__ block and
tests/test_tool_stdout_encoding.py enforces that, but only for tools/. viewer/serve.py died before it started
serving and scripts/audit_shader4_regs.py exited 1 after writing its report; bench_wave64.py and run_gpu_tests.py
print the same kind of output unguarded. All four get the guard, and the check now covers scripts/ and viewer/.

Co-Authored-By: Claude Mythos 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ABh36DZ2sZNq3ChN6EZJs
2026-11-22 19:55:36 +03:00
da3f01cee7 gpu tests: skip a fixture whose wave size the device cannot pin
cs_barrier_loop is a wave32 fixture (subgroup_size 32 in index.json): its
expected words are four waves of 32 lanes. run_gpu_tests.py pinned the size
through VKC_SUBGROUP_SIZE but, unlike check.py, judged the dump when
vk_compute_test reported "compute subgroup size: 32 not available" and ran it
at 64 lanes anyway. A device with 64..64 compute subgroups (GCN3/GCN4 on RADV)
therefore reported a failure that is really an unpinnable wave size: 139/180
passed with 1 failed, where check.py reported 0 failed on the same work folder.

Reuse check.py's unpinned_subgroup_skip for cs_barrier_loop only. The other
pinned dumps are still judged at the device's own width, which is how cs_store
and the cs_w32_* fixtures keep being tested on a 64-only device (skipping all
of them cost 12 passes: 128/180).

RX 570 (gfx803, RADV Mesa 26.2.6, Vulkan 1.4.354), commit 4947579:
run_gpu_tests 139/180 passed, 41 skipped, 0 failed; check.py 0 failed.
2026-11-22 19:54:22 +03:00
33456ca4e7 fix(test): enable shaderFloat64 for compute SPIR-V that declares it
Use the existing SPIR-V capability scan to request the feature before creating the Vulkan device, or report an unsupported-device skip. Add a synthetic compute case that checks both words of a binary64 result.
2026-11-22 13:53:56 -03:00
0ec464b0e1 GPU tests: bind the --pc-tail-ubo block, so 128-byte push-constant devices run the tests
With LEONIDA_PC_TAIL_UBO=1, build.py and run_gpu_tests.py translate with --pc-tail-ubo, and the test
programs (vk_compute_test, vk_store_test, vk_harness, vk_texture_test, vk_sampler_test, vk_bindless_test)
declare and push 128 bytes and, when a stage declares set 1, bind the tail block there
(runtime/test/vk_pc_tail.h: a host-visible buffer with one slot per dispatch or draw, bound as a dynamic
uniform buffer). vk_harness refuses --mesh-compute with the flag (exit 77): mesh_compute_vs.py's vertex
shader still reads its address from push constants. Without the variable nothing changes.

Step 2 of the uniform-buffer tail claimed in #1902.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:48:05 +02:00
ae21dddaa6 Merge pull request #2290 from 1TrickOmen 2026-11-22 11:43:51 -05:00
72758b9c5b Merge pull request #2270 from Tim Elery
# Conflicts:
#	docs/design.md
2026-11-22 11:43:39 -05:00
693b8c63af Merge pull request #2209 from Vonsek 2026-11-22 11:42:51 -05:00
94d7bfddae Merge pull request #2184 from AvantBras 2026-11-22 11:42:34 -05:00
1180c0b4a4 Merge pull request #2136 from Vonsek 2026-11-22 11:42:07 -05:00
3d1a9889df Merge pull request #2049 from Shrey Ratna 2026-11-22 11:41:12 -05:00
5cf0a1743d Merge pull request #1880 from Vonsek 2026-11-22 11:40:43 -05:00
ea00498d3f Merge pull request #664 from WHOISJARDAS 2026-11-22 11:40:30 -05:00
72d7e52dfa Translator: a mask copied to a VGPR respects EXEC (SHADER-21 part 2, #210) 2026-11-22 16:33:52 +00:00
fbe50b23fd rdna2spirv: align swizzled buffer addressing with native RDNA2 hardware (SHADER-343)
Measure MUBUF/MTBUF swizzled buffer addressing (V# SWIZZLE_ENABLE,
ADD_TID_ENABLE, INDEX_STRIDE, OOB_SELECT, multi-dword and typed
accesses, atomics, 32-bit offset wrap) natively on RDNA2 (gfx1036,
wave32 and wave64) via tools/buffer_swizzle_probe.py, and fix all six
observed silicon divergences in tools/rdna2spirv.py:

- idxen=1 ignores ADD_TID_ENABLE (both address and bounds).
- SWIZZLE_ENABLE=1 with idxen=0 and ADD_TID_ENABLE=0 stays linear and
  OOB_SELECT 3 remains RAW.
- Multi-dword raw accesses step by +4*IS only in scratch-swizzle mode
  (SWIZZLE_ENABLE=1, idxen=0, ADD_TID_ENABLE=1); indexed swizzle
  (idxen=1) steps linearly by +4 bytes even across IS boundaries.
- Scratch-swizzle mode suppresses typed formats > 4 bytes (MUBUF/MTBUF)
  and 8-byte buffer_atomic_*_x2 even under OOB_SELECT 2 (formats <= 4B
  execute normally); indexed swizzle executes them linearly.
- OOB_SELECT 3 with active swizzle and stride != 0 checks
  (index + soffset) >= num_records or off + payload > stride.
- off = uint32(voff + inst_offset) wraps at 32 bits before bounds
  checking, while RAW mode 3 uint64(off) + uint64(soffset) does not.

Update semantic tests, cs_buf_swizzle fixture expectation (word 4:
0x5eed0028 -> 0x5eed000c), unit tests, and docs/design.md /
docs/shader_validation.md.
2026-11-22 08:32:34 -08:00
3d1dbf1cef Merge main into test/coverage-gaps (#1299)
Conflicts: runtime/test/shaders/check.py, scripts/run_gpu_tests.py

AI-assisted.
2026-11-22 17:22:43 +01:00
9f03fc31e1 run_gpu_tests: ps_m3_query belongs to d3d12_m3_frame_test (OTHER_HARNESS)
#1825's single-output M3 occlusion shader is drawn by the ctest d3d12_m3_frame_test; run_gpu_tests picked it up
and failed it with "no checker defined".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:22:00 -05:00
7d370cdfbc Tests: GPU test for the 32-bit integer VOPC compares
ps_vcmp_int32 runs v_cmp_{eq,ne,lt,le,gt,ge,f,t}_{u32,i32} in the e32 and
e64 forms with inline constants and literals, on operands where signed and
unsigned disagree. Words derived by hand in the .asm header; the same shader
is a tests/semantic fixture with a plain-Python reference.

AI-assisted.
2026-11-22 17:21:18 +01:00
d78546fc92 rdna2spirv: apply the SDWA src_sel to an f16 inline float constant
In an f16 SDWA op, Gen.src_h returned a float inline constant as its f16
bits without the operand's src_sel. On RDNA2 the constant is the f16 value
over a zero high half and src_sel then narrows it like a register:
v_add_f16_sdwa d, 1.0, v src0_sel:WORD_1 reads +0.0 (measured on gfx1036).
The translator added 1.0.

GPU test ps_sdwa_f16_const (hand-derived words, measured on gfx1036) with a
semantic fixture; it also covers an SGPR source and the integer path
(v_cvt_f16_u16_sdwa of 1.0), which were already right. docs/design.md row.

AI-assisted.
2026-11-22 17:17:54 +01:00
fc52e96723 Tests: let focused GPU runs require a pass (TEST-364) 2026-11-22 17:13:19 +01:00
ecc6bd286e rdna2spirv: a 16-bit SDWA result with dst_sel:DWORD zeroes the high half
A 16-bit op in SDWA form (f16 VOP1/VOP2, v_cvt_u16/i16_f16, v_cvt_f16_u16/i16)
with dst_sel:DWORD writes the result zero-extended on RDNA2, whatever
dst_unused says. Gen.insn only marked an SDWA destination for a dst_sel other
than DWORD, so write_lo16 applied the non-SDWA keep-the-high-half rule and the
translator returned 0xdead4000 where gfx1036 returns 0x00004000.

Mark every SDWA VGPR destination and let write_lo16 skip the keep for it.
ps_sdwa_dword_hi.asm (GPU) and its semantic fixture pin four ops and three
dst_unused values; docs/design.md gets the contract row.

AI-assisted.
2026-11-22 17:13:04 +01:00
b2fc3f20c3 Merge main into test/valu-int-misc (#1492)
Conflicts: scripts/run_gpu_tests.py

AI-assisted.
2026-11-22 17:12:54 +01:00
21d01a9570 fix(tests): enforce the GPU timeout for texture cases
The texture harness needs a shader working directory, so two branches launched it directly and bypassed the configured deadline. Pass the working directory through the shared launcher so those cases time out and the suite can continue.
2026-11-22 17:04:37 +01:00
91b53e294b GPU test cs_fmt_int_narrow: 8/16-bit UINT/SINT typed buffers, words from gfx1036
A compute fixture loads through the nine narrow integer formats (DST_SEL
XYZW, X011 and d16) and stores edge values through each with the
runtime's selectors. check.py's 136 expected words are the same program's
output run natively on gfx1036 (tools/hw_oracle, wave32 and wave64), and
the interpreter test runs the fixture against them too.

Depends on #1871.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:58:11 +01:00
b87dc1e9af Tests: GPU and CPU checks for the untested d16_xyz/d16_xy typed-buffer forms
buffer_load_format_d16_xyz, tbuffer_load_format_d16_xy/_d16_xyz and
buffer_store_format_d16_xyz were translated but no test ran them. Add the
GPU test cs_fmt_d16_xyz (one thread; integer, f16 and UNORM8 loads with the
kept high half of an odd final component, the 16-bit clamp of 32-bit UINT
channels, and stores into 32_32_32_UINT and 32_32_32_FLOAT), compared over
the whole 80-word heap, and run the same fixture in test_value_semantics.py.

AI-assisted.
2026-11-22 16:41:27 +01:00
a47749b8de Merge pull request #1996 from Joao vitor alves
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 10:40:16 -05:00