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>
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.
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
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.
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".
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>
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>
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>
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.
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.
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>
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).
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>
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>
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.
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>
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>