Commit Graph

114 Commits

Author SHA1 Message Date
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
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
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
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
7e7275915c MoltenVK: size the bindless set by its update-after-bind limits, not its layout-support answer
MoltenVK's vkGetDescriptorSetLayoutSupport compares every layout with maxPerSetDescriptors (1212, the limit without
argument buffers) and rejects even 1212 itself, although it creates and samples a 65536-image, 4096-sampler
update-after-bind set correctly (native repro; d3d12_descriptor_test under Wine with the set grown). On MoltenVK the
D3D12 device no longer asks it: size_bindings' per-type update-after-bind limits, which MoltenVK takes from Metal's
argument-buffer limits, decide, and the set grows to 65536 2D images and 4096 samplers on an M3 Max.
2026-11-22 20:29:38 +04:00
fc52e96723 Tests: let focused GPU runs require a pass (TEST-364) 2026-11-22 17:13:19 +01:00
fd2050071a TEST-251: GPU checks of wave64 geometry shaders, and no false tier C for a GS's ring address
rdna2spirv maps a legacy GS's LDS write to an output slot from its
offset alone and drops the VGPR address (the lane's GSVS area), but
wave64_halves read that address as the store's data, so a GS whose lane
id only forms its GSVS base was tier C lane-id. It now checks only the
data operands of a GS ds_write.

w64_graphics.py draws gs_w64_a_ring and gs_w64_c_lane_id at wave64 and
wave32 (RADV_PERFTEST=gewave32), build.py builds gs_* fixtures with
gs_tri's signatures, docs/testing.md explains how to run and extend the
wave64 graphics checks, and docs/design.md records the rule and that the
corpus GS are written for wave64. Checked on an RX 9070 XT (GFX1201) and
a Ryzen 9800X3D iGPU (GFX1036), RADV Mesa 26.3.1: 23/23.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:03:34 +03:00
4f574add4b d3d12_descriptor_test: the bindless capacity check follows the set's room
On MoltenVK (1.4.2, 1.4.3) the check sampled zeros: vkGetDescriptorSetLayoutSupport there accepts only layouts
of fewer than maxPerSetDescriptors (1212) descriptors, so size_bindings keeps the default 4096 2D images and
1024 samplers, and the test's 5001st view and 2100th sampler were refused as the arrays filled. MoltenVK does
create and sample a 65536-image, 4096-sampler set correctly (a native reproduction, and the whole test passes
under Wine with growth forced), so that is MoltenVK's to fix; the runtime keeps following the driver's answer.

The test now asks the set how much room it has (rt::d3d12::bindless_room, from BindlessSet::free_images and
free_samplers). Where the set holds the full counts nothing changes. Where it holds fewer, the test fills each
short array to its last index, checks the last view through the last sampler gives the texture, and that one
more view and sampler are refused and read as the fallbacks. The device logs at startup when its set holds
fewer samplers than a full shader-visible sampler heap. bindless_sizing_test gets MoltenVK's limits;
vk_bindless_test checks the free counts.
2026-11-22 20:01:37 +04:00
ce4660c3b0 docs: one row per topic again in design.md, README.md and testing.md (PROC-106)
tests/test_docs_design_rows.py failed on main again: merges after
64ece042 and abbb3dce kept both sides of rows two branches had edited.
design.md had 24 topics repeated (two to five rows each), README.md one
and testing.md two.

Each group is now one row at the first copy's place, keeping every fact
any copy stated. Where copies disagreed, the newer wording (by git blame
and the commit that wrote it) wins: for example, the --f16-interp-fallback
row no longer also gives the pre-SHADER-291 locations 29 - 2N / 30 - 2N,
the "Not GPU-verified" notes give way to the SHADER-137 hardware results
added to the same rows, and "tbuffer_store_format_* is not translated"
gives way to the paragraph describing how it is translated.

A sentence-by-sentence check of every copy against the merged row finds
only those deliberately replaced. The four docs tests pass.

AI-assisted.
2026-11-22 16:50:02 +01:00
0093aa9097 Merge pull request #1799 from Dominik 2026-11-22 10:38:54 -05:00
28ef599619 Runtime: pick the Vulkan GPU by the harnesses' rank (native over Dozen)
The runtime's standalone device (d3d12_vulkan_device.cpp) still took
"the first usable device, replaced by every later discrete GPU". #915
fixed that rule in the test harnesses because Mesa's Dozen (Microsoft
vendor 0x1414, "Microsoft Direct3D12 (<gpu>)") reports a discrete GPU, so
on a PC with the OpenCL/OpenGL/Vulkan Compatibility Pack the runtime
could run on the Vulkan-on-D3D12 wrapper while the tests used the native
driver. Even without Dozen, on a two-dGPU PC the runtime took the last
GPU and vk_test_device.h the first.

- runtime/src/vulkan_device_filter.h: vulkan_device_rank() (native over
  Microsoft's layers, then discrete > integrated > virtual > CPU), with
  the device type as an int so the header stays Vulkan-free.
- d3d12_vulkan_device.cpp: the first usable device of the highest rank.
- vk_device_pick.h: device_rank forwards to it (static_assert on the
  VkPhysicalDeviceType values).
- d3d12_indirect_rt_test, dxgi_swapchain_test, vk_image_fuzz,
  vk_sampler_test had the old loop and ignored LEONIDA_VK_DEVICE: they
  now filter and rank like the rest, and an unmatched filter fails
  instead of skipping.
- vulkan_device_filter_test: the rank order; docs/testing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:27:09 +00:00
dfd692f9b8 Refresh the standalone Vulkan build option on current main 2026-11-22 12:24:36 -03:00
c3bc62bb45 Merge pull request #1835 from Vonsek
# Conflicts:
#	docs/README.md
#	docs/testing.md
2026-11-22 09:48:37 -05:00
eceeb9f5a5 Merge pull request #1653 from Felix Croasdale 2026-11-22 09:48:06 -05:00
4056172304 docs/testing.md: one overlay-layer row, with the elevated-terminal cause (TEST-228 follow-up)
Both commits of #1653 and #1656 landed by hand on main, which left the
Known-problems table with the implicit-layer row twice and three
overlapping overlay rows, and the validation paragraph saying overlays
ignore VK_LOADER_LAYERS_DISABLE=~implicit~ outright. Keep one
implicit-layer row and the overlay row that has @Rainmaker33's finding
(the loader ignores the variable only in an elevated terminal, and RTSS
adds STORAGE only while it runs), and correct the paragraph to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:40:49 -06:00
abbb3dce9f docs: one row per topic in the docs index and testing's Known problems
docs/README.md listed models.md, audio.md and rsc8_audio.md twice with
different text; keep the current row of each. docs/testing.md had the
RTSS/OBS overlay advice in four rows that partly contradicted each other;
keep the implicit-layer row and the newest overlay row (the elevated-terminal
cause), with OBS's layer named. The row test now covers both pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:27:54 +01:00
2a30f92d29 Merge pull request #1653 from Felix Croasdale
# Conflicts:
#	docs/testing.md
2026-11-22 09:14:49 -05:00
f5b198404e docs/testing.md: one overlay-layer row, with the elevated-terminal cause (TEST-228 follow-up)
#1653's first commit and #1656 both landed, leaving the Known-problems
table with the implicit-layer row twice and two overlapping overlay
rows, and the validation paragraph saying the overlays ignore
VK_LOADER_LAYERS_DISABLE=~implicit~. Per @Rainmaker33's loader log, they
only stay in when the terminal is elevated: the loader ignores
VK_LOADER_LAYERS_DISABLE with administrator rights, while each layer's
disable_environment switch still works, and RTSS adds the STORAGE usage
only while RivaTuner Statistics Server runs. Keep one implicit-layer row
and one overlay row that say so, and correct the paragraph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:43:49 -06:00
10cf6ffca6 Merge pull request #1699 from AimLogin
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:33 -05:00
ab8eeda70f Merge pull request #1653 from Felix Croasdale
# Conflicts:
#	docs/testing.md
2026-11-22 08:38:15 -05:00
2da09963d8 docs/testing.md: the overlay row names the elevated-terminal cause and closing the overlay
From @Rainmaker33's review of #1653: VK_LOADER_LAYERS_DISABLE didn't
remove RTSS on their machine because the terminal was elevated, and the
loader ignores that variable with administrator rights (VK_LOADER_DEBUG=all
says so); a layer's own disable_environment switch still works there. The
STORAGE message also needs RivaTuner Statistics Server itself running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:30:48 -06:00
a5a1eb231e Tests: prove Vulkan synchronization validation is active (TEST-198)
vk_sync_validation_selftest records two vkCmdCopyBuffer into the same
bytes on vk_test_device.h's device. With LEONIDA_VK_VALIDATION=1 the
write-after-write hazard must be reported, and the same copies with a
transfer -> transfer barrier must not be. Without validation, or without
a Vulkan device, it exits 77 (ctest skip).

Synchronization validation can be off although the tests ask for it,
for example with VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false, and every
other GPU test then reports 0 validation errors without having been
checked. This test fails in that case, and with the Khronos layer
missing. docs/testing.md gets a row in its known problems.

No runtime code changes, no game files. AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 14:24:16 +01:00
9ed235e77a Merge pull request #1656 from Luv Bhargava
# Conflicts:
#	docs/testing.md
2026-11-22 08:08:31 -05:00
b2257fa4f0 Merge pull request #1653 from Felix Croasdale 2026-11-22 08:08:29 -05:00
af0c2c7608 Merge pull request #1566 from AlxcBTW
# Conflicts:
#	docs/related_projects.md
2026-11-22 08:08:06 -05:00