Commit Graph

190 Commits

Author SHA1 Message Date
ff07b0b6e3 Merge pull request #821 from stayjuced 2026-11-21 22:37:49 -05:00
78c5b429bc Merge pull request #795 from DANISBR1 2026-11-21 22:37:44 -05:00
b07409135d Merge pull request #677 from nicolas 2026-11-21 22:37:39 -05:00
52a357c604 Merge pull request #341 from AlxcBTW 2026-11-21 22:37:36 -05:00
c2df6ab458 Warn when post-install llvm-mc cleanup fails 2026-11-21 22:31:40 -05:00
710c5e724b Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 04:27:11 +01:00
84e1d2ebe9 Merge pull request #769 from mohamedsaad.lahlou 2026-11-21 22:08:46 -05:00
b288ad9638 Merge pull request #680 from kotorvr 2026-11-21 22:08:12 -05:00
10f5b63a26 Merge updated GPU runner checks while preserving packed-format coverage 2026-11-21 20:07:25 -07:00
f577bf0318 vk_pipeline_check --stats: the driver's statistics for each translated shader
vk_pipeline_check <spirv dir> --stats FILE enables VK_KHR_pipeline_executable_properties, creates the
pipelines with CAPTURE_STATISTICS and writes, for the executable that runs each translated shader (not
the partner stub's), every statistic the driver reports as CSV rows name,stage,statistic,value. On RADV:
instructions, VGPRs, SGPRs, spills, scratch size, waves per SIMD, and more.

scripts/shader_stats.py <stats.csv> <disasm dir> [--details] compares them with the original RDNA
listings: code growth, VGPRs against the highest VGPR the original uses, and which shaders use scratch or
spill (a register file that went to memory, e.g. through v_movrels with an unbounded index). Over the
corpus it says how many shaders compile badly.

RX 5700 XT (RADV), the repository's test shaders: 47 pipelines, no scratch or spills in any.
New tests/test_shader_stats.py (standard library only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:06:49 -06:00
1b6cc3f2c2 Translator: ds_read_u8/i8_d16[_hi] 8-bit LDS reads into a 16-bit half (SHADER-85)
ds_read_u8_d16, ds_read_u8_d16_hi, ds_read_i8_d16 and ds_read_i8_d16_hi
(RDNA2 DS opcodes 162-165) were rejected. They reuse the u8/i8/u16_d16
path: the byte is zero- or sign-extended 8->16 into one half of the
destination and the other half is kept.

Tests: CPU value test on the new cs_w32_lds_u8_d16 fixture (mini
interpreter now accepts Workgroup variables for one invocation), GPU
dump cs_w32_lds_u8_d16.asm registered in check.py and run_gpu_tests.py,
lds_fuzz generates the four reads. Contract row in docs/design.md and
shader_validation.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:02:47 -05:00
71812aac05 GameInput shim: download SDL3 only when asked (LEONIDA_SDL3_FETCH)
The shim is built with an installed SDL3 (find_package) or with
-DLEONIDA_SDL3_FETCH=ON / FETCHCONTENT_SOURCE_DIR_SDL3; otherwise configure
prints a message, gta6rt builds without it, and CTest lists gameinput as
disabled. build_runtime.ps1 gains -FetchSdl3 and warns that its cl.exe
fallback never builds the shim. Review nits: delivering_thread is atomic,
and SDL's own GameInput joystick driver is pinned off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:58:46 +00:00
9f8cac64f5 Tests: isolate shader inputs when reusing GPU test work 2026-11-22 03:46:04 +01:00
5879d22055 Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 03:41:57 +01:00
1511d2bff2 Merge pull request #747 from Ayoze Torres 2026-11-21 21:37:57 -05:00
b0476248e8 Merge pull request #720 from fearkov 2026-11-21 21:37:52 -05:00
dc1c424ca1 Merge pull request #710 from bbareth 2026-11-21 21:37:50 -05:00
fcd51e74ba Merge pull request #708 from Spaghetih 2026-11-21 21:37:50 -05:00
1df0045b5c Merge pull request #500 from troythedecoyx 2026-11-21 21:37:44 -05:00
fcea57d5d9 Merge pull request #455 from fearkov 2026-11-21 21:37:44 -05:00
48f2164427 Merge pull request #399 from fearkov 2026-11-21 21:37:44 -05:00
f4fcbdc2bb Tests: run_gpu_tests.py reports a pixel test the device can't run once
A vk_harness exit 77 appended the SKIP row twice, so the shader was listed twice and the summary counted it twice (n/total and skipped).
2026-11-21 22:16:26 -04:00
ce87bf7ede Merge upstream GPU runner coverage into the packed format fixture branch 2026-11-21 19:14:27 -07:00
5e7b00ecec audit_shader4_regs.py: count SGPR reads by s_addk/s_mulk/s_cmovk, reject a negative --limit
rbw_registers() treated the first operand of s_addk_i32, s_mulk_i32 and
s_cmovk_i32 as a pure write, so `s_addk_i32 s3, 1` with s3 never written
before it reported no read-before-write at all. These three read their
destination; they now use shader_meta.SGPR_RMW, the list shader_meta already
keeps for the same reason, and the s3 pattern shows the register as read.

--limit -1 sliced files from the end of the list and reported a shorter
audit. A negative limit is now an argparse-style error (exit 2) before any
output, and audit() raises ValueError for one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:14:13 +01:00
c86977584a CI: run the Windows runtime tests under Wine on Linux
The Windows job uploads its executables, DLLs and the CTest list; a new
wine job runs them with scripts/run_wine_tests.py on ubuntu-24.04
(Wine, Xvfb, llvmpipe). The loader tests and gta6rt --run tiny_game must
pass; the other tests are reported in the job summary.
2026-11-22 02:13:39 +00:00
54d3ea1a88 GPU test: s_barrier sites in different wave-uniform branches meet (SHADER-91)
cs_barrier_divergent: wave32, 128 threads. Wave 0 and waves 1-3 take different branches, each with its own s_barrier; on RDNA they count against the same workgroup barrier, so wave 0 reads what wave 3 wrote to LDS (out[i] = 127 - i). Registered in check.py and scripts/run_gpu_tests.py as a wave32 dump that doesn't need 32-lane subgroups.

Passes on an RTX 4070 Ti with the current translator; it guards the behaviour for any change to barrier handling.

AI-assisted.
2026-11-22 03:12:48 +01:00
b707035ca0 Tests: vk_texture_test enables shaderResourceMinLod for a MinLod clamp
A shader that declares MinLod (image_sample_d_cl) needs the feature, and without it the validation layer reports VUID-VkShaderModuleCreateInfo-pCode-08740. A device without it is now a skip (exit 77), as in the other texture tests.
2026-11-21 22:11:02 -04:00
bd880b85cc Tests: a16 bias, d_cl and depth compare samples on a GPU 2026-11-21 22:10:52 -04:00
8de6eb2875 Tests: vk_texture_test dref checks depth compare samples on a GPU 2026-11-21 22:10:21 -04:00
ad6bb01d06 GPU and value test for SHADER-46: s_ff0/s_ff1_i32_b32 of an immediate
The follow-up to #349 that the #374 coordination note asked for. #349
fixed s_ff0_i32_b32 reading an inline constant or literal as a lane mask;
this adds a hardware and interpreter check for it.

ps_sff_imm runs s_ff1_i32_b32 on the inline constant 4 and the literal
0x00100000, and s_ff0_i32_b32 on the inline constant 61 and the literal
0x0000ffff: 2, 1, 20, 16. Read as a lane mask (all ones or zero from bit
0) the two s_ff0 words are -1; the s_ff1 words guard the path that was
already right.

- runtime/test/shaders/ps_sff_imm.asm, with its expected words in
  check.py and run_gpu_tests.py
- the fixture (regen_fixtures.py) and a value test in
  tests/semantic/test_value_semantics.py that runs it through the
  interpreter, with an independent reference

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (subgroup
32), driver 32.0.16.2124, Windows 11: see the PR for the run on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:10:09 -06:00
2736407127 Merge pull request #665 from mohamedsaad.lahlou 2026-11-21 21:08:36 -05:00
6d2303e0a7 Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 03:02:50 +01:00
8cf0a8f6fc Run the packed 10:10:10:2 fixture in both GPU test suites 2026-11-21 18:46:06 -07:00
a412225fcc Tests: reject unmatched GPU test filters 2026-11-22 02:43:37 +01:00
ff094ce885 Merge pull request #639 from FJBP-code 2026-11-21 20:39:03 -05:00
c0a93d29f0 Merge pull request #628 from SirAmong 2026-11-21 20:39:01 -05:00
e5d9f28a4f Merge pull request #489 from eIBart0 2026-11-21 20:38:47 -05:00
b95f0f8b25 Merge pull request #398 from troythedecoyx 2026-11-21 20:38:43 -05:00
b90a2d0914 D3D-56: add GPU descriptor hash-table micro-benchmark (vk_descriptor_bench) 2026-11-22 02:27:59 +01:00
dbb3319681 Shader: pack d16 image sample/gather results with integer f32->f16 RTE
Work around an amdvlk64 pipeline-creation crash (0xC0000005 on RX 9070 XT)
triggered when GLSL.std.450 PackHalf2x16 on an OpImageSampleExplicitLod d16
result feeds a structured loop (OpLoopMerge inside OpSelectionMerge) using
OpGroupNonUniformAny.

Replace PackHalf2x16 at the two d16 image_gather4*/image_sample* sites in
tools/rdna2spirv.py with a branchless pure-integer IEEE-754 binary16 RTE
packer (Gen.f32_to_f16_int / Gen.pack_f16_pair_int). Leave all other
PackHalf2x16 call sites unchanged.

Add unit tests covering edge cases and a 58,368-value sweep across all 256
exponents (tests/test_d16_pack.py), SPIR-V translation/validation tests for
d16 image_sample and image_gather4 (tests/test_translate.py), and a synthetic
GPU sample shader (runtime/test/shaders/ps_texture_sample_d16.asm).
2026-11-21 22:24:31 -03:00
b3688332f2 Merge origin/main into fuzz-3-f32-valu (regen_fixtures.py: keep ps_f32_mods and ps_f64_mods)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:22:45 +01:00
0726e3f26b Translator: ds_permute_b32, the forward (scatter) cross-lane permute (SHADER-90)
Each source lane on in EXEC sends its data to lane ((addr + offset) >> 2) mod 32
of its own half (like ds_bpermute_b32); a destination nobody targets gets 0, an
off destination keeps its VDST. Highest-numbered source wins a collision.
Native: per-source shuffles with a ballot guard for missing lanes; wave64
emulation: two buffer rounds and a %x_perm variable.

Tests: tests/semantic/test_ds_permute.py, GPU tests cs_w32_permute and
cs_w64x_permute. Contract row in docs/design.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 20:22:15 -05:00
b92801178b GPU tests: run #300's cs_cvt_f32_sat on every input through VKC_SGPRS
cs_cvt_f32_sat (#300) takes its binary32 input in s4, so neither runner
ran it. Now both do: one dispatch per input of
tests/semantic/test_float_to_int.py (check.CVT_F32_SAT_CASES), each
judged on both words (v_cvt_u32_f32 in out[0], v_cvt_i32_f32 in out[1]).

- check.cvt_f32_sat_test() and the run_gpu_tests.py branch report
  "16/16 inputs exact", or how many were wrong and the first one.
- tests/test_shader_checks.py: the fake device answers from the word in
  VKC_SGPRS; every input must be sent, one wrong input must fail and be
  named, and the table must equal the interpreter test's CASES.

On NVIDIA this checks the fixed translation, but it cannot catch the old
bug: with the translator from before #300 (273e53c^1) the RTX 4060 Ti
also gives 16/16, since SPIR-V leaves an out-of-range conversion
undefined and this hardware saturates anyway. A driver that does not
(@EchoTD's RADV case on #300, constant inputs) is where it can fail;
tests/semantic/test_float_to_int.py pins the rule itself.

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (Ada,
subgroup 32), driver 32.0.16.2124, Windows 11, on main d937b7f:
run_gpu_tests.py cs_cvt_f32_sat "16/16 inputs exact" natively and with
LEONIDA_W64_EMULATE=1; check.py cs_cvt_f32_sat ok;
tests/test_shader_checks.py 18/18.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:22:13 -06:00
95ab84432d vk_compute_test: seed s4.. from VKC_SGPRS, so a compute test can take an input word
vk_compute_test always put the output V# in s[0:3] and zero in every
other user SGPR, so a compute test shader could not be given an input
word: #300's cs_cvt_f32_sat reads its float from s4 and could only be
checked on a GPU by building one shader variant per input by hand.

- VKC_SGPRS=w4,w5,... sets s4, s5, ... up to s31 (s[0:3] stay the output
  V#), with the same syntax and checks as vk_harness's VKH_SGPRS: decimal
  or 0x hex, no sign, nothing above 32 bits, no trailing comma, at most
  28 words; anything else exits 2 with a message.
- cs_user_sgprs.asm declares eight user SGPRs (RSRC2 0x8090) and stores
  s4..s7 back. Both runners seed it with 0x4f000000,0xdeadbeef,7,
  0xffffffff (check.USER_SGPRS) and expect those words, then the
  0xEEEEEEEE fill.
- check.compute_test() takes an env for vk_compute_test.
- tests/test_shader_checks.py: the fake harness only answers
  cs_user_sgprs with the seeded words when VKC_SGPRS was passed, and no
  other test may get VKC_SGPRS.

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (Ada,
subgroup 32), driver 32.0.16.2124, Windows 11, on main d937b7f:
- run_gpu_tests.py cs_user_sgprs PASS natively and with
  LEONIDA_W64_EMULATE=1; check.py cs_user_sgprs ok
- vk_compute_test directly: unset -> s4..s7 read 0; "5" sets s4 only;
  28 words accepted; "1,2,", "-1", "0x1ffffffff", "abc" and 29 words
  exit 2
- test_shader_checks.py fails (7) if check.py stops passing VKC_SGPRS
- full suite: see the PR

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 19:22:03 -06:00
7a23552d7e Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 02:21:40 +01:00
8521b0b465 Merge origin/main into fuzz-3-f32-valu
spirv_mini_interp.py: keep main's _F32 (sNaN bits, #533) and its vector-aware
RoundEven/Floor/Ceil/Trunc; keep this branch's fma_f32, OpFDiv and
Exp2/Log2/Sqrt/InverseSqrt. regen_fixtures.py: both sides' shaders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:21:00 +01:00
81f0bab87c Merge pull request #549 from NRXM 2026-11-21 20:09:19 -05:00
6a55f981e0 Merge pull request #503 from Tomgamer 2026-11-21 20:09:16 -05:00
2720df12a1 Merge origin/main into f64-output-modifiers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
#	tests/semantic/regen_fixtures.py
2026-11-22 02:07:19 +01:00
9cc407c84d tests: skip the wave32 lane-mask dumps below 32 lanes (llvmpipe CI)
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane
EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute
subgroups are 8 wide, they can't produce their words, and the
"GPU tests on llvmpipe" step in runtime.yml has failed on main since
91b36cf. Skip them where vk_compute_test reports a widest subgroup
below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and
run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or
more lanes still run and judge them.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
(cherry picked from commit be466779a2a1e988f58803ab1eedca6cc6a07375)
2026-11-21 22:06:20 -03:00