Commit Graph

65 Commits

Author SHA1 Message Date
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
6ba36655a1 docs: document disabling RTSS and OBS overlay layers for validation runs (TEST-228)
- Document that RivaTuner (VK_LAYER_RTSS) and OBS (VK_LAYER_OBS_HOOK) stay loaded under VK_LOADER_LAYERS_DISABLE=~implicit~
- Document DISABLE_RTSS_LAYER=1 and DISABLE_VULKAN_OBS_CAPTURE=1 to eliminate false validation errors in xbox_present and present tests
- Note the layer disable variables in both the test running section and Known problems table
2026-11-22 18:28:18 +05:30
bce8149378 docs/testing.md: overlay layers' own disable switches for validation runs (TEST-228)
RivaTuner's VK_LAYER_RTSS adds STORAGE usage to the swapchain it hooks,
which gives validation errors only on machines with MSI Afterburner, and
on some setups it stays loaded under VK_LOADER_LAYERS_DISABLE=~implicit~
(@Rainmaker33's loader log). Each such layer has its own
disable_environment switch, which always works: name the RTSS and OBS
ones, where any other layer's is found, and how to see the inserted
layers with VK_LOADER_DEBUG=layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 06:57:49 -06:00
ad2f96798d Merge pull request #1579 from dcastell1
# Conflicts:
#	docs/testing.md
2026-11-22 07:38:21 -05:00
ca2e702e7a Merge pull request #1516 from Jolymmiles
# Conflicts:
#	docs/testing.md
2026-11-22 07:38:02 -05:00
4c544f5a79 Merge remote-tracking branch 'origin/main' into hw-oracle-image
# Conflicts:
#	tools/image_fuzz.py
2026-11-22 13:37:42 +01:00
4107b690a8 docs/testing: rebuild the GPU test programs after pulling (0xEE fill is a stale exe)
A vk_compute_test from an older commit still runs every shader, so a newer
translator rule that the old program does not set up (the raw V# in pc[2..3],
which drops every store when stride is 0) shows up as the untouched 0xEEEEEEEE
fill on every compute test, indistinguishable from a translator regression.
Measured on an RTX 5090 / 621.24: main 99f99890 with an exe from earlier the
same day gave 69/141, every compute test on the fill pattern; rebuilt from the
same commit, 141/141.
2026-11-22 13:22:35 +01:00
719565bbc7 image_fuzz: --oracle hw, the image_load fetches as native kernels with a per-family T#
Runs the same texel fetches as raw compute kernels on the AMD GPU through tools/hw_oracle/: a linear texture the
kernel carries in its own code (256-byte aligned, found with s_getpc_b64), a T# built in s[8:15] for the GPU's family
(hw_oracle/tsharp.py: GFX11 on gfx11xx, GFX10 on gfx103x/gfx10xx), image_load with every dmask for one texel per lane,
all four result registers stored and compared word for word with the CPU model. --oracle translator,hw runs both on
the same textures; --negative-control checks seven wrong models and a wrong T# FORMAT are caught. Exit 77 without the
tools. gfx1150 is RDNA3.5, not RDNA2: the docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:16:24 +01:00
6cef92a990 docs/testing.md: Mac shaders pay for MoltenVK's optnone precise helpers (SHADER-234) 2026-11-22 16:09:32 +04:00
66111c29d3 Merge pull request #1512 from Hamza
# Conflicts:
#	docs/design.md
#	docs/testing.md
2026-11-22 07:07:59 -05:00
792e53f599 Merge pull request #1497 from liang-kai-shui 2026-11-22 07:07:55 -05:00
79ab0c4a86 Merge pull request #1475 from alvaro-marquez-cobos 2026-11-22 07:07:48 -05:00
5c9315d971 Test tools: turn MoltenVK fast-math off so NaN compares are exact (SHADER-234)
MoltenVK compiles MSL with Metal fast-math on by default, and Metal then folds
an f32 compare of a NaN with itself: v_cmpx_eq/le_f32 on (NaN, NaN) give true
(ps_vcmpx_forms fails on every Mac). The MSL is byte-identical with fast-math
on and off, so it's Metal's compile option, not the translation; "on demand"
(2) doesn't help, 0 does.

runtime/test/vulkan_loader.h, which every Vulkan test program loads MoltenVK
through, now sets MVK_CONFIG_FAST_MATH_ENABLED=0 before loading it unless the
variable is already set. docs/design.md gets a contract row: fast-math off
doesn't remove the optnone NoContraction helpers (the cost part, @Jolymmiles)
and doesn't fix SHADER-182 (same valu_fuzz f16 mismatch either way).

Apple A18 Pro, macOS 26.6.2, MoltenVK 1.4.2: ps_vcmpx_forms 4096/4096 exact;
run_gpu_tests.py 85 pass/52 skip/2 fail -> 86/52/1 native, 114/23/2 ->
115/23/1 with wave64 emulation (the remaining failure is ps_interp_f16_high,
fixed by #1407); ctest 25/25 either way; semantic suite 1220 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted
2026-11-22 14:48:31 +03:00
f87945fa79 docs/testing: document the GPU test timeout
check.py kills a GPU test program after 120 s and counts it as a failure;
LEONIDA_GPU_TEST_TIMEOUT changes the limit and 0 turns it off. The variable
was only visible in a code comment, so add the paragraph next to the
--filter/--work note in "Run them".

Docs only, no game data.
2026-11-22 19:45:30 +08:00
05446c6357 Docs: check Windows ROCm llvm-mc support for TEST-71 f16 programs 2026-11-22 12:37:58 +01:00
f4e0f706e1 Merge pull request #1407 from Hamza 2026-11-22 06:37:56 -05:00
793787a5d8 Merge pull request #1376 from Jolymmiles 2026-11-22 06:37:54 -05:00
1681f3dc1e Translator: --f16-interp-fallback reads f16 halves without PerVertexKHR (SHADER-196)
MoltenVK can't compile PerVertexKHR to MSL, so ps_interp_f16_high failed at
pipeline creation on every Mac. With --f16-interp-fallback every VS/mesh param
(and the --mesh-compute VS) also exports its two f16 halves decoded to f32,
low halves at location 29 - 2N and high halves at 30 - 2N, and a PS *_f16 read
takes them as ordinary smooth inputs. A producer skips halves that would land
on its own params; a PS whose half location is also an attribute is rejected.
The index records f16_halves on both sides.

tools/vk_subgroup_info.py reports per_vertex_inputs (false without
fragmentShaderBarycentric or on MoltenVK); make_game.py and run_gpu_tests.py
turn the flag on where it is false. Without the flag all 139 GPU-test modules
are byte-identical to main's, so NVIDIA/AMD keep the exact per-vertex path.

Apple A18 Pro, macOS 26.6.2, MoltenVK 1.4.2: ps_interp_f16_high passes, all
4096 pixels bit-exact; run_gpu_tests.py 84 pass/50 skip/1 fail -> 85/50/0
native, 112/22/1 -> 113/22/0 with wave64 emulation; ms_f16_pack passes through
--mesh-compute. Semantic suite 1194 -> 1203 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI-assisted
2026-11-22 14:32:28 +03:00
1babaf7f8a docs: record the FMA measurement in the contract row (SHADER-182)
Add the seed 330 v_fmac_f16 run on aa217aeb, 300681bb and KosmicKrisp,
make the KosmicKrisp command runnable as written, and reword the FMA
symptom.
2026-11-22 15:21:26 +04:00
4ad7fb952f docs: f16 FMA hits the same MoltenVK helper (SHADER-182)
fma_f16_odd multiplies with a NoContraction OpFMul, so v_fma_f16,
v_fmac_f16 and v_pk_fma_f16 return +0 for a -0 product plus -0 on
MoltenVK 1.4.2 (valu_fuzz seed 330: 49/50 with the two multiply
skips, 50/50 with SPIRV-Cross 300681bb). The skip recipe now names
all five ops, and the KosmicKrisp line gives the manifest path.
2026-11-22 15:13:16 +04:00
b4d4f39e11 Merge pull request #1376 from Jolymmiles
# Conflicts:
#	docs/design.md
2026-11-22 06:08:06 -05:00
286f5e1bbe Merge pull request #1364 from AlxcBTW 2026-11-22 06:08:02 -05:00
54d767cb9d Merge pull request #1338 from liang-kai-shui 2026-11-22 06:08:00 -05:00
53e08a76b4 Merge remote-tracking branch 'origin/main' into fma-khr
# Conflicts:
#	runtime/test/vk_test_device.h
2026-11-22 11:58:52 +01:00
1c3524a078 docs/testing: say the CI-built runtime is Windows and expires
Review of #1338: the runtime-windows artifact holds Windows executables,
so say to use it on Windows or under Wine, note GitHub's 7-day expiry,
and use <unzipped runtime-windows> instead of a ~/Downloads path that
reads like Linux or macOS.
2026-11-22 18:55:19 +08:00
ca80ccb739 docs: name the affected MoltenVK builds and the workarounds (SHADER-182)
Council review: MoltenVK main at 5189f8de is affected too, the
translator claim is narrowed (SignedZeroInfNanPreserve is #664), the
counts carry their flags, and the known-problems row gives the
--skip-op and KosmicKrisp workarounds, both measured on an M3 Max.
2026-11-22 14:55:00 +04:00
ef40dbe558 docs: MoltenVK drops -0 from NoContraction multiplies (SHADER-182)
MoltenVK 1.4.2's SPIRV-Cross lowers a NoContraction OpFMul to
spvFMul, which returns fma(l, r, T(0)). A -0 product plus +0 is +0, so
valu_fuzz --family f16 reports +0 where the model wants -0 on Apple
GPUs (#1203). The translator's SPIR-V is correct. SPIRV-Cross 300681bb
fixes the helper; MoltenVK main still pins its parent.

Record the cause and the A/B measurement in the translator contract,
and add the symptom with a workaround to the known problems in
docs/testing.md.
2026-11-22 14:45:14 +04:00
59c34bdc91 Merge pull request #1338 from liang-kai-shui 2026-11-22 05:37:48 -05:00
b2c8fc1c48 Note the clang-cl 22.1.7/22.1.8 exception next to the LLVM 19+ requirement 2026-11-22 13:34:02 +03:00
e256a2547c Translator: --fma khr emits OpFmaKHR for fused multiply-adds
GLSL.std.450 Fma may be split into two roundings by a driver (Vulkan
environment: inherited from OpFMul followed by OpFAdd); RDNA2 v_fma_* round
once. --fma khr (default stays glsl) emits OpFmaKHR with capability FMAKHR and
SPV_KHR_fma and lists shaderFmaFloat32 in the index. Runtime device creation
and the vk_* test programs enable VK_KHR_shader_fma when present; cs_fma_fused
tests single rounding; the mini interpreter learns OpFmaKHR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:25:37 +01:00
43e4431cd8 docs/testing: run the GPU tests from a CI-built runtime
TEST-58/TEST-71 testers without VS2022 or CMake had no documented route
from the Runtime workflow's runtime-windows artifact to
scripts/run_gpu_tests.py. Add a short subsection: download the artifact
of the commit's run, unzip it, and pass the folder to --build;
build.py and check.py take the same folder as their second argument.
Repeats the same-commit rule the note above states.

Docs only, no game data, no CI change.
2026-11-22 18:20:23 +08:00
87320aec99 Document clang-cl crashes in Windows runtime test builds 2026-11-22 13:18:54 +03:00
01074fea96 docs/testing: use GPU test binaries from the same commit as the scripts
Measured on Windows 11 build 26300 with the 426023a script against the
48ad23f runtime-windows artifact: 28 false cs_* failures on both an
RTX 5070 Ti Laptop and a Radeon 610M. Either matching pair (48ad23f
script and artifact, or 426023a script and artifact) is clean, so the
failures are version skew, not a translator or driver bug.

TEST-58/TEST-71 testers without a compiler are likely to use a CI
artifact; say which commit it belongs to and to check that commit out.

Docs only, no game data, no CI change.
2026-11-22 17:36:27 +08:00
70b13bc600 Merge pull request #1251 from YaBulochka 2026-11-22 04:07:53 -05:00
4d94045fda Merge pull request #1229 from Kevin Morales 2026-11-22 04:07:46 -05:00
b15c964f84 docs/testing: remove the duplicated skip sentence in the barycentric section 2026-11-22 12:02:50 +03:00
57888e6f29 Merge pull request #1223 from Vonsek
# Conflicts:
#	docs/testing.md
2026-11-22 03:37:56 -05:00
e7d204c6dc Merge pull request #1214 from quackottu 2026-11-22 03:37:52 -05:00
273886db50 make_game.py: build the runtime stage on Linux with clang-cl and xwin
Off Windows the runtime stage refused to run without --runtime-build. It now
cross-builds gta6rt.exe and gta6rt_tls_host.dll into runtime/build/windows
with runtime/cmake/clang-cl-xwin.cmake (XWIN_DIR, or ~/.local/share/xwin-sdk
as in docs/testing.md), then packages them with the Wine launcher as before.

Preflight lists what the cross-build lacks (cmake, the LLVM tools, clang-cl
older than 19, an xwin splat without VC/Tools/MSVC or Windows Kits um/x64)
and then configures it, so any toolchain error stops the run before the
shader stage. Without the tools the default stages still leave runtime out;
asking for it lists what is missing. The pipelines stage's vk_pipeline_check
is built natively into runtime/build/linux at the end of preflight, for the
same reason.
2026-11-22 01:36:05 -07:00
650b3db705 docs/testing.md: Volta lacks fragment barycentrics too (TEST-166)
The barycentric section said only Pascal and older lack
VK_KHR_fragment_shader_barycentric. A Tesla V100 (Volta) doesn't have it
either, and LEONIDA_BARY_FALLBACK=1 makes the three barycentric tests pass
there (#166).

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:31:57 +01:00
98f485f492 Translator: read the high f16 half in v_interp_p1ll_f16 / v_interp_p2_f16 (high) 2026-11-22 13:57:08 +05:30
caad84c32b Translator: --mesh-compute runs mesh shaders without VK_EXT_mesh_shader
9,282 of the 26,503 shaders are mesh shaders, and a device without
VK_EXT_mesh_shader (NVIDIA Pascal, for one) can't run any of them. With
--mesh-compute each becomes a GLCompute module with the same workgroup size
and code; only the epilogue changes. After the same barrier, lane 0 writes
the vertex and primitive counts, lane i its vertex and its primitive, into
this workgroup's slot of an output buffer whose address is in push-constant
dwords 36-37 (152 bytes). The slot layout is mesh_compute_layout() and the
index records it as mesh_compute.

- tools/mesh_compute_vs.py: the vertex shader that draws the slots with a
  non-indexed draw of groups * max_primitives * 3 vertices; unused and
  culled primitives are clipped away, params keep their locations.
- vk_harness: VKH_MESH_COMPUTE (+ VKH_MESH_SLOT, VKH_MESH_PRIMS) dispatches
  the module, adds a compute->vertex barrier and draws.
- run_gpu_tests.py / check.py: LEONIDA_MESH_COMPUTE=1 (check.mesh_env).
- tests/test_mesh_compute.py; docs/design.md row "Mesh shaders as compute",
  docs/testing.md section.

GTX 1060 (Pascal) with LEONIDA_MESH_COMPUTE=1 LEONIDA_W64_EMULATE=1: all five
ms_* tests pass (SKIP before), zero validation messages. Mesh corpus: 9,282 of
9,282 translate and pass spirv-val with --mesh-compute --wave64-emulate, and
all 9,282 generated vertex shaders validate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
2026-11-22 00:21:36 -08:00
a0a6d2f07c Translator: --texel-offset-fallback for image_sample*_o without VK_KHR_maintenance8
A run-time texel Offset outside gather needs VK_KHR_maintenance8, which NVIDIA
Pascal lacks, so ps_texoff skips there and 4 PS (31 image_sample_o) can't run.
With --texel-offset-fallback the offset is folded into the coordinate:
coordinate + offset / size of the sampled level (0 for _lz/_c_lz, the LOD for
_l, OpImageQueryLod's for implicit samples, plus the bias for _b; floored and
clamped). An integer offset commutes with wrapping and clamping, so this is
exact at that level for every address mode; only a trilinear blend differs
(the coarser level moves by offset / 2). Implicit samples become Grad samples
with the unshifted coordinate's derivatives, so the LOD doesn't change with a
per-pixel offset. Gathers keep their Offset (shaderImageGatherExtended).

- LEONIDA_TEXOFF_FALLBACK=1 for build.py, check.py and run_gpu_tests.py;
  vk_texture_test then isn't asked for maintenance8, and texoff_problem also
  judges the +16/-32 sample.
- runtime/test/shaders/ps_texoff_implicit.asm: ps_texoff's per-pixel sample
  as image_sample_o, the corpus form.
- tests/test_texel_offsets.py: the fallback for every sample form, including
  spirv-val without --allow-offset-texture-operand.
- docs/design.md "Texel offsets", docs/testing.md.

GTX 1060: ps_texoff and ps_texoff_implicit 4096/4096 exact (SKIP before).
Corpus: the 4 PS translate and validate; needs_maintenance8 4 -> 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
2026-11-21 23:18:38 -08:00
d1d23d842d Merge pull request #804 from Jess-Doit 2026-11-22 01:37:54 -05:00
4030a386fb Translator: --bary-fallback for raw barycentrics without VK_KHR_fragment_shader_barycentric (SHADER-98)
The 321 pixel shaders that read the raw barycentric pair are translated to
BuiltIn BaryCoordKHR, so they can't run on a device without the extension
(NVIDIA Pascal, for one). With --bary-fallback the pair comes from an
ordinary vec3 input one location past the shader's attributes; the module
needs neither the capability nor the extension, and the index records the
location as bary_fallback_input. tools/bary_fallback_gs.py writes the
pass-through geometry shader that fills it: Position and the PS's inputs
copied unchanged, plus (1,0,0), (0,1,0), (0,0,1) at the three vertices,
whose perspective interpolation is the BaryCoordKHR value.

- LEONIDA_BARY_FALLBACK=1 for build.py, check.py and run_gpu_tests.py
  (like LEONIDA_W64_EMULATE): translate with the flag, build
  <name>.bary_gs.spv, draw those shaders through it.
- vk_harness: VKH_GS_HELPER=1 keeps VKH_SUBGROUP_SIZE on the fragment
  stage when the GS only feeds the pixel shader under test.
- tests/semantic/test_bary_fallback.py and the ps_bary fixture.
- docs/design.md contract row and index key, docs/testing.md section.

GTX 1060 (Pascal): ps_bary 4096/4096 exact, ps_uniform_branch and
ps_scc_mask32 pass with the fallback (SKIP without it). Pixel-shader corpus:
12,101/12,101 translate and pass spirv-val with and without the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SSJXX67xeoorUsLJ2f9zms
2026-11-21 22:28:25 -08:00
6d7bb1755a Tests: shader tools honor LEONIDA_VK_DEVICE
The GPU tools picked a device with the shared ranker but never applied the
name filter the D3D12 tests have used since #861. Filter candidates through
vulkan_device_wanted in vk_device_pick.h, report a filter that matches nothing
instead of dereferencing a null device, and cover the filter cases in the
picker test. docs/testing.md no longer says the tools ignore it.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 00:02:29 -06:00
6d6301c1b5 Merge pull request #919 from bobcatchris 2026-11-22 00:33:09 -05:00
7b51dbd9d8 Merge pull request #888 from enx 2026-11-22 00:33:00 -05:00