Commit Graph

31 Commits

Author SHA1 Message Date
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
a030e18ef6 Docs: note the Dozen device order and LEONIDA_VK_DEVICE
The Compatibility Pack lists Mesa's D3D12 layer as a second discrete GPU. The
harnesses now prefer a native ICD (#915), and LEONIDA_VK_DEVICE selects one
explicitly, so record both next to the other known problems.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-21 23:11:58 -06:00
enx
943e5f8048 Build the Windows runtime on Linux with clang-cl and xwin
runtime/cmake/clang-cl-xwin.cmake cross-compiles gta6rt, its shims and
tests with clang-cl and lld-link (LLVM 19+) against an MSVC CRT and
Windows SDK laid out by xwin, and makes ctest run them through Wine (or
Proton's wine). llvm-ml64 stands in for ml64, so the register-
preservation check in unimplemented_policy_test runs too.

Changes that let a cross build work without a Developer Prompt:
- gen_d3d12_stubs.py gets the d3d12.h CMake finds (--header) instead of
  relying on INCLUDE; without one the COM targets are skipped.
- d3d12_trace names the interpreter by path, so ctest doesn't prepend the
  emulator to Python, and check_d3d12_trace.py starts the fixture through
  the emulator (--runner).

docs/testing.md describes the build and the Wine and Proton runs.
2026-11-21 21:09:12 -07:00
77f42e09c0 Runtime tests: LEONIDA_VK_DEVICE picks the Vulkan GPU by name
Two GPUs of one vendor share one driver, so the loader's driver filters
cannot tell them apart, and the D3D12 tests always took the last discrete
GPU (an RTX 3060 next to an RTX 5070 Ti). LEONIDA_VK_DEVICE is part of the
device name, compared without case, read by vk_test_device.h and by the
layer's standalone device. A value that matches no device fails the run
instead of testing another GPU, as LEONIDA_HOST_ADAPTER does. The shader GPU
tools (vk_compute_test, vk_harness, ...) keep their own pickers for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:56:45 +01:00
b5d15862fc docs: valu_fuzz --family f16 needs llvm-mc 21+; 18 runs the rest
docs/testing.md asks for LLVM 21+, but says a distribution's llvm-mc is
enough on Linux, and the fuzzer does not say what it needs. Measured with
Ubuntu 24.04's llvm-18 (18.1.3): valu_fuzz --family mem and lds_fuzz
assemble and run, but every --family f16 program fails, because 18
rejects op_sel on the 16-bit integer VOP3 forms; 23.1.6 assembles them.
Both places now say so.
2026-11-22 02:22:21 +00:00
9ccadeaeaf Merge pull request #622 from SirAmong 2026-11-21 21:08:33 -05:00
a518a2bbf2 docs: testing.md image_load row describes this runtime's real mechanism (PROC-16 review)
Second review of #622: the runtime never reads an image's size out of a T#.
A T# that was not registered (hand-built or zeroed) misses the descriptor
hash table, gets index 0, and index 0 is a 1x1 image of zeros, so even
pixel (0,0) reads 0 here. The "(0,0) only" pattern is from the reporter's own
layer and is now labelled as a report, not reproduced.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 21:00:03 -05:00
2b7c576eb6 docs: testing.md image_load row names the right mechanism (PROC-16 review)
The row said the shader bounds-checks image_load against the T# size. The
translator lowers image_load to OpImageFetch/OpImageRead and never compares
coordinates with the T# width/height; it is the runtime that takes the image
size from the T# (stored as size - 1), so a zeroed descriptor is a 1x1 image.
Wording from rafaelpssz's review of #622.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 20:42:36 -05:00
23020c40cb Merge pull request #622 from SirAmong 2026-11-21 20:38:59 -05:00
99960989cb docs: re-measure the llvmpipe counts in testing.md
Measured on GitHub's ubuntu-24.04 runner (llvmpipe, LLVM 20.1.2) on
main c432cdc, which already carries the wave32 lane-mask skip: 52/88
with 36 skipped, and 37/39 with 2 skipped under LEONIDA_W64_EMULATE=1.
Lists the new skips (ps_scc_mask32, ps_texoff, cs_wqm_w32,
cs_w32_lane_wrap).

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-22 01:30:40 +00:00
78b8239761 docs: G-buffer targets stay 8-bit UNORM; image_load tests need a real T# size (PROC-16)
Two silent failures reported in #603 by @Silliana, written down as reports
(not reproduced here):
- d3d12_vulkan.md section 4.2: the material shaders pack normal/ID data into
  bytes and the lighting shaders unpack them with * 255 and a truncate, so the
  G-buffer targets must keep the game's 8-bit UNORM format.
- testing.md, Known problems: a hand-built descriptor with no real width and
  height makes image_load return zero except at pixel (0,0).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 20:17:48 -05:00
cfc314d233 Docs and CMake: the runtime needs the Windows SDK 10.0.26100 or newer
The runtime uses version 1.2 root signatures (D3D12_ROOT_SIGNATURE_DESC2),
which older SDKs such as 10.0.22621 don't declare, so the build failed
halfway through with a compiler error. The prerequisites now name the SDK,
docs/testing.md has a Known problems row for the error, and CMake checks
for it at configure time and stops with the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:03:14 -05:00
bd15303dc4 Merge pull request #430 from NRXM 2026-11-21 19:14:03 -05:00
49f4958a4b CI: run the GPU tests on Mesa llvmpipe
The linux-gpu-tools job built the GPU test programs but never ran them.
It now installs llvmpipe (software Vulkan), llvm-mc and SPIRV-Tools and
runs scripts/run_gpu_tests.py twice: natively (31 pass, 29 expected
skips: 8-wide subgroups, no fragment barycentrics) and the compute tests
with LEONIDA_W64_EMULATE=1 (33 pass). The emulated mesh tests are left
out because llvmpipe's compiler aborts on them. docs/testing.md gets a
section on running the suite without a GPU.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-21 23:39:29 +00:00
e0d68c8bb2 Docs: link the coordination issue by its title, not its number
The coordination issue (#156) will move to a successor when its thread
gets long. CONTRIBUTING.md, AGENTS.md, the PR template and the testing
guide now find it as the open issue titled "Coordinating who works on
what" (a search link, and a gh command for agents), so they stay right
without an edit each time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 00:11:59 +01:00
307d5e4c1a Docs: a guide to running the GPU tests
Collects what testers in #166 needed to find out themselves: llvm-mc
with the AMDGPU target per OS, building the test programs, the two ways
to run the suite, wave64 emulation on 32-wide GPUs (set
LEONIDA_W64_EMULATE for build.py too), choosing a GPU, and the problems
reported so far with their fixes. Linked from CONTRIBUTING.md and the
docs index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 23:50:59 +01:00