Commit Graph

335 Commits

Author SHA1 Message Date
d7b38c36fc docs/testing.md: emulated mesh tests fail on llvmpipe because of an llvmpipe bug (TEST-782)
llvmpipe stores a mesh shader's runtime CullPrimitiveEXT through an
invalid `bitcast <N x i1> to <N x float>` (emit_store_mesh_chan,
lp_bld_nir_soa.c, Mesa 26.3.1 and main). On x86_64 at 256 bits LLVM
aborts ("Cannot emit physreg copy instruction"), on arm64 the primitive
comes out culled (#3127). The translator's SPIR-V is valid: with only
that store made a constant false, the emulated ms_tri frame is
byte-identical to RADV's. A Known problems row gives the workaround
(LEONIDA_MESH_COMPUTE=1: 6/6 ms_* pass on llvmpipe).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 01:00:36 +03:00
d3ec646a7d Merge pull request #3023 from Jolymmiles 2026-11-22 17:00:25 -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
d6354821a8 Merge pull request #2972 from Davide 2026-11-22 17:00:16 -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
efa9dc1c5c Merge pull request #2886 from Jolymmiles
# Conflicts:
#	docs/testing.md
2026-11-22 17:00:01 -05:00
84f8f1b04a docs: say Homebrew's llvm-mc is not on PATH and where the tests find it
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-22 22:59:10 +01:00
5243c3a261 Merge pull request #1518 from Henrique Vinagre
# Conflicts:
#	docs/design.md
#	docs/testing.md
2026-11-22 16:58:50 -05:00
53bc2c4943 GPU tests: wire cs_fma_fused in run_gpu_tests and accept GLSL Fma split on RADV 2026-11-22 21:43:14 +00:00
b28832bab4 Tests: give each process its own temp folder for its shader library
d3d12_compute and the other tests that write a translator-style shader library under
the temp directory (d3d12_draw, d3d12_set0_compute, d3d12_msaa_draw, d3d12_fspx_compute,
d3d12_pipeline_library, d3d12_subgroup, d3d12_bundle, d3d12_typeless_families,
shader_library) used one fixed folder name. Two copies running at once (ctest -j, or two
suites in one Wine prefix or TMPDIR) shared it, and one copy's remove_all deleted the
modules the other was loading: on an Apple M3 Max under Wine with MoltenVK 1.4.3, four
copies of d3d12_compute at once failed 6 of 40 runs (PSO creation at lines 245/357, or
exit 3 from an uncaught filesystem_error in copy_file), while 125 runs one at a time all
passed.

test_temp_dir.h names the folder <temp>/<name>_<pid>, removes it on scope exit (early
returns included), and copies the compiled-in LEONIDA_TEST_*_SPV files with an error
code, so a missing file is reported by name instead of ending the test with abort().
docs/testing.md lists both symptoms.
2026-11-23 01:41:31 +04:00
129d357562 Record the Windows version and another AMD retest 2026-11-22 23:01:05 +02:00
d466ebc06b Link the Ryzen 9800X3D typeless RTV verification 2026-11-22 22:59:47 +02:00
549e857f40 docs/testing.md: two traps of the Linux cross-build and Wine setup
Two rows for Known problems, both hit while setting up the clang-cl
cross-build and the Wine tests on Ubuntu 24.04:

- clang-cl-19 isn't in the clang-19 package: Debian and Ubuntu put the
  versioned clang-cl link in clang-tools-19.
- Ubuntu's Wine 9.0 aborts at once (free(): invalid pointer, or a
  segfault) when /run/user/<uid> doesn't exist, as in a container or a
  root shell without a login session. Creating the folder fixes it;
  setting XDG_RUNTIME_DIR alone does not (checked both ways).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jcpJWD4phrXJyDgED6
2026-11-22 20:55:57 +00:00
507830e162 Document the legacy AMD typeless RTV test failure 2026-11-22 22:31:30 +02:00
b000451dc9 docs(testing): record the RDNA1 RADV s_bfe_i64 limitation (SHADER-276) 2026-11-22 20:20:33 +00:00
16fd347b8c Merge pull request #3313 from Shrey Ratna 2026-11-22 15:16:53 -05:00
e447b4f95b Merge pull request #3243 from romainveurrier 2026-11-22 15:16:07 -05:00
3c7618a787 Merge pull request #3182 from Kacper Serewis 2026-11-22 15:15:30 -05:00
1d43be2658 Merge pull request #3136 from SashaTun 2026-11-22 15:15:02 -05:00
8a8eae6cc7 Merge pull request #3035 from CaravelaLabs 2026-11-22 15:14:15 -05:00
aef623982c Merge pull request #2869 from Shrey Ratna 2026-11-22 15:12:43 -05:00
f689de662e Merge pull request #2707 from justr4mzi 2026-11-22 15:11:27 -05:00
c9cb94ad14 Merge pull request #2048 from whoalin1 2026-11-22 15:10:07 -05:00
c4eaab94c9 Merge pull request #1518 from Henrique Vinagre 2026-11-22 15:09:42 -05:00
d3e09d12f2 docs: RADV splits GLSL Fma too (measured in #3004's review); khr or exact fix it there 2026-11-22 22:07:34 +02: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
a13d955159 vk_compute_test: probe only with compute ballots, main's LocalSize, width apart from lane order
Review of #2886: the probe needs subgroup operations in compute (supportedStages) with basic and ballot
(supportedOperations), or the size stays "not available". LocalSize is the one of the GLCompute entry point "main"
the pipeline is made from, not the last in the module. The width is checked from each subgroup's own lane numbers
and ballot (a wrong width fails the test); 32-lane subgroups that aren't in invocation order, which Vulkan doesn't
promise and the translator assumes, print "not available" and the runners skip.
2026-11-23 00:04:20 +04:00
777d218770 vk_compute_test: run 32-lane tests where the size is fixed but not requirable (MoltenVK)
MoltenVK reports subgroups 4..32 and requiredSubgroupSizeStages 0, so VKC_SUBGROUP_SIZE=32 printed "not available"
and the 32-lane compute tests skipped. The translator emits SPIR-V 1.5, where varying subgroup sizes are not allowed,
so Vulkan fixes SubgroupSize at the device's subgroupSize (32 there). vk_compute_test now runs a probe shader
(cs_wave_probe.comp, embedded) with the test's local size and flags first, checks every invocation's lane, subgroup
number and ballot width, and runs the test if they match. If they don't, the test fails (exit 1) instead of being
skipped. Full subgroups are requested where local size X is a multiple of maxSubgroupSize. Devices whose default
isn't the requested size keep printing "not available".
2026-11-23 00:04:20 +04:00
c94a631217 docs(testing): say which Mesa versions were run in the RADV row
Only 25.2.8 was run; 25.3, 26.0 and 26.1 come from reading the source.
25.2 is Ubuntu 24.04's default, not 25.3 (Kam471's review).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:02:28 +01:00
446270b08a GPU tests: fix the two errors GPU-assisted validation reports
Run under VK_LAYER_KHRONOS_validation with GPU-assisted validation (VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1),
which instruments the translated shaders, the llvmpipe GPU suite gives two errors. Both are in the tests,
not the translator, and both passed only because llvmpipe tolerates them:

- vk_bindless_test (ps_tex): the synthetic T#'s word 1, 0x22222222, has FORMAT 34 (10_11_11_UINT). The
  translator picks the uint alias of the image array for a UINT T#, so every draw sampled the test's
  R8G8B8A8_UNORM views through a uint image, which Vulkan leaves undefined
  (VUID-vkCmdDraw-format-07753). The T# now has FORMAT 56 (8_8_8_8_UNORM), checked by a static_assert.
- cs_w64_mask_detect: every lane stored at lane * 64 through a V# that allows any offset, so lanes 4-63
  wrote past the 256 bytes vk_compute_test gives one group, through the buffer's device address
  (VUID-RuntimeSpirv-PhysicalStorageBuffer64-11819). It stores at lane * 4 now; out[0] is still 48.

docs/testing.md: how to run the shader test programs under validation, GPU-AV and sync validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:01:58 +00:00
7cfd20230a SHADER-605: reproduce signed-zero image stores with direct SPIR-V 2026-11-22 20:55:15 +01:00
95ba4d25f7 docs/testing.md: the seven Intel ANV texture-test crashes are a Mesa bug, fixed in 26.3 (TEST-399)
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 on Intel
GPUs with Mesa ANV on Linux. Each one segfaults while the driver compiles
the shader, in nir_opt_gcm (nir_opt_gcm.c:430, gcm_schedule_early_src): the
phi it schedules has a source an earlier pass freed (garbage SSA pointer,
use_link pointing at itself). The SPIR-V passes spirv-val, NVIDIA and
llvmpipe pass the same tests, and Mesa 26.3.1 and main (bb98606) pass the
whole suite on the same Iris Xe (131/189, 58 skipped) where 26.2.7 fails
these seven (124/189). A Known problems row says so and how to check a
newer Mesa without installing it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:50:12 +01:00
40f57cd08b Add a synthetic GPU readback for lighting multiplication 2026-11-22 20:37:19 +01:00
24418795b8 test: judge the swizzle sources that run in a narrow pixel shader (#618)
ps_bitmask_perm is skipped when a driver runs the wave32 pixel shader narrower
than 32 lanes (#1318), because the "pippi" pattern reads lanes 16-31, which
then do not run and have no defined value. The skip excused the whole test,
including the sources that do run: at 16 lanes wide every lane reads lane ^ 9,
which is inside the running lanes for lanes 0-7, so a wrong word there went
unnoticed on Intel.

The skip now excuses only the sources that are not there. Where the source
lane runs, its word has to be right, so a narrow run is judged instead of
skipped. At 8 lanes wide every "pippi" source is lane 8 or above, nothing can
be judged, and the test still skips.

The translator change this depends on is #2780: a source lane that is not
running reads 0 instead of an undefined value, which is what makes the narrow
run judgeable at all. Until it lands the note in docs/testing.md describes a
behaviour that main does not have yet.

Tested: python -I tests/test_shader_checks.py (70 tests, OK, on main
16282101). No GPU, no game files.

AI-assisted.
2026-11-22 22:28:37 +03:00
811a7831ad runtime.yml: a test keeps the path list in step with what the jobs read
tests/test_runtime_paths.py recomputes the tools/ files the Runtime jobs read (named by runtime/, the
workflow's steps and the scripts it runs, then sibling imports, modules and files named in strings, and
tools/ subdirectories, to a fixed point) and fails when one is not listed, when the push and pull_request
lists differ, or when a listed tool no longer exists. Without it, a new import in the translator would
leave the new module outside the list, and a later change to that module alone would skip the GPU tests.

.gitattributes joins the list: it decides the line endings of every file the build checks out.

docs/testing.md no longer says the llvmpipe suite runs on every pull request, and says that a commit on
main has a runtime-windows artifact only if it touched what the workflow builds or reads.
2026-11-22 20:23:43 +01:00
4a4443a46b docs/testing.md: Known problems row for the Mesa 25.2/25.3 RADV failures of cs_w32_salu64 and cs_signed_zero_nan
Both are Mesa bugs (ACO combine_add_sub_b2i use count, NIR fmul_is_a_number),
not translator bugs; RADV from Mesa 26.3.1 passes both on an 8060S (gfx1151). See #166.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:10:05 +01:00
b7bee40a9b docs/testing.md: keep the Wine prefix in the xvfb-run line, and name xauth
Review (@ramenbellic): the xvfb-run command dropped the WINEPREFIX of the block
above, so it ran in ~/.wine; and xvfb-run needs xauth, which minimal images
lack (CI installs both).
2026-11-22 18:43:54 +00: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
f1e8035314 CI: run the GPU suite on llvmpipe under the barycentric fallback
llvmpipe has no VK_KHR_fragment_shader_barycentric, so the native llvmpipe run skips ps_bary,
ps_uniform_branch and ps_scc_mask32, and nothing in CI drew a pixel shader through the --bary-fallback
geometry shader (tools/bary_fallback_gs.py). A third llvmpipe run sets LEONIDA_BARY_FALLBACK=1 and fails
unless every shader that got a fallback geometry shader passes, not just runs: a run where the fallback
builds no geometry shader, or one of them skips, is an error.

docs/testing.md: list the third run, and correct the f16 tests' line: with the f16 interpolation
fallback (on by itself without the extension) ps_interp_f16_high and ms_f16_pack run under the bary
fallback too, and natively on llvmpipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:32:22 +00:00
dd331fb185 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 20:20:22 +02:00
561a48abf1 Merge pull request #2707 from justr4mzi 2026-11-22 13:17:13 -05:00
4ac33f7e88 Merge pull request #2648 from skankhunt42 2026-11-22 13:16:47 -05:00
407a53923e Merge pull request #2048 from whoalin1
# Conflicts:
#	docs/testing.md
2026-11-22 13:12:54 -05:00
df6864d4b7 docs/testing.md: xwin version and Xvfb for the Wine runtime tests
Two things that stop the documented Linux cross-build and Wine run:
- xwin 0.6.5 cannot lay out SDK 10.0.26100 with the documented command
  ("unable to find x86_64 headers"); 0.10.0 can.
- Without a display, Wine has no graphics driver for Vulkan, so every Vulkan
  test fails with vkCreateInstance -3. Run ctest under xvfb-run, as CI does.
2026-11-22 17:57:59 +00:00
90f399e953 Runtime: warn loudly (or fail) when CMake finds no Vulkan headers
Without Vulkan headers everything under if(TARGET Vulkan::Headers) is left
out: the D3D12 COM objects, the Vulkan D3D12 device in gta6rt
(LEONIDA_D3D12=vulkan) and most of ctest. The only output was a STATUS line
naming four test tools, so a build whose VULKAN_SDK never reached CMake ran
45 of 125 tests and reported "100% tests passed".

- runtime/cmake/vulkan_headers_missing.cmake: a WARNING that names what is
  left out and that CMakeCache.txt keeps the failed lookup.
- LEONIDA_REQUIRE_VULKAN=ON turns it into a configure error; both CI
  configures pass it, and scripts/build_runtime.ps1 does when VULKAN_SDK is set.
- tests/test_cmake_vulkan_missing.py runs the module with cmake -P and checks
  that CMakeLists.txt and CI use it; docs/testing.md gets a troubleshooting row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:41:47 +01: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
3fd09d4ecd Merge pull request #2232 from Jolymmiles 2026-11-22 11:43:11 -05:00
94d7bfddae Merge pull request #2184 from AvantBras 2026-11-22 11:42:34 -05:00
cdb907aa8f Merge pull request #2127 from AwkGrep256
# Conflicts:
#	docs/design.md
2026-11-22 11:42:03 -05:00
6c35af1256 Merge pull request #2063 from sovljanskii
# Conflicts:
#	docs/design.md
2026-11-22 11:41:25 -05:00