Skip to content

CI: run the GPU tests on Mesa llvmpipe - #430

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
NRXM:ci/llvmpipe-gpu-tests
Nov 22, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
NRXM:ci/llvmpipe-gpu-tests

Conversation

@NRXM

@NRXM NRXM commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Marco · project thread

Claimed in #156 as: TEST-48 (claimed in #374: #374 (comment))

Depends on: #435 (conflicts in the same linux-gpu-tools job; whichever lands second rebases, see #418 (comment))

What and why

The linux-gpu-tools job in runtime.yml builds vk_harness and the other GPU test programs, but never runs them, so a translator or harness change that breaks a GPU test result only shows up when a tester with a GPU runs the suite. This installs Mesa's llvmpipe (software Vulkan), llvm-mc (llvm-18) and SPIRV-Tools on the Ubuntu runner and runs scripts/run_gpu_tests.py twice:

  1. natively: 31 of 60 pass, 29 skip. The skips are expected: llvmpipe has 8-wide subgroups (every wave64 test and ps_bitmask_perm) and no VK_KHR_fragment_shader_barycentric (ps_bary, ps_uniform_branch).
  2. with LEONIDA_W64_EMULATE=1, compute only (--filter cs_): 33 of 33 pass, so the wave64 emulation gets checked on every PR too.

The emulated mesh tests are left out of the second run: llvmpipe's own LLVM backend aborts compiling them (LLVM ERROR: Cannot emit physreg copy instruction). They pass on llvmpipe without emulation. A step that checks vulkaninfo for llvmpipe makes the job fail instead of passing with everything skipped if the driver is ever missing. Both runs together take a few seconds.

docs/testing.md gets a short "Without a GPU: Mesa llvmpipe" section with the same commands and the expected counts. llvmpipe catches regressions; it does not replace results from real GPUs in #166. Note the FUZZ-2 finding in #374 that llvmpipe and NVIDIA fold PackHalf2x16/UnpackHalf2x16 round trips differently (v_cvt_pkrtz 1 ulp off on llvmpipe): no current GPU test reaches that path, and a future test that does would fail here for the translator reason that finding describes.

Tested

Ubuntu 24.04 container, Mesa 25.2.8 llvmpipe (LLVM 20.1.2), Ubuntu's llvm-18 llvm-mc, Ninja build exactly as in the workflow: native run 31/60 passed, 29 skipped, exit 0; emulated compute run 33/33 passed, exit 0. With the emulated mesh tests included the runner exits 1, which is how I confirmed a failing test fails the step. On GitHub's ubuntu-24.04 runner (fork run: https://github.com/NRXM/Leonida/actions/runs/44963412163): same counts, 31/60 passed, 29 skipped, and 33/33; both runs together add a few seconds to the job.

AI-assisted (Claude Code).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy

NRXM and others added 2 commits November 21, 2026 23:39
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
AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
@NRXM NRXM changed the title CI: run the GPU tests on Mesa llvmpipeCI: run the GPU tests on Mesa llvmpipe CI: run the GPU tests on Mesa llvmpipe Nov 21, 2026

@VictorJulianiR VictorJulianiR left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security review of the workflow change. It was a code read only: I executed nothing. AI-assisted (Claude).

Verdict: safe to merge from a security standpoint. Two correctness notes follow.

Checked at head 19d4dbb, in .github/workflows/runtime.yml:

  • Triggers (:5-9): push to main, pull_request and workflow_dispatch are unchanged. There is no pull_request_target or workflow_run, so fork PRs get a read-only token and no secrets.
  • Permissions (:11-12): contents: read, unchanged. No secrets.* is used.
  • Pinned actions (:38): actions/checkout@3d3c42e5... matches tag v7.0.1, which I checked with gh api.
  • Packages (:42): everything comes from the runner's default Ubuntu archive (mesa-vulkan-drivers vulkan-tools spirv-tools llvm-18). There is no PPA, no third-party apt repo, no curl|sh and no unchecked download.
  • No caches, nothing writes to the repo, no ${{ github.event.* }} in a run: step. The new steps only use $RUNNER_TEMP (:59, :65).
  • Optional hardening: persist-credentials is still the default (true) in this job (:38). The new steps run PR-controlled Python with that read-only token in .git/config. with: persist-credentials: false would cost nothing, since the job never pushes.

Correctness:

  1. Skips count as passes. scripts/run_gpu_tests.py:772 returns 0 when passed + skipped == len(results). The vulkaninfo | grep llvmpipe guard (:58) catches a missing driver. It does not catch a Mesa update that drops a feature and turns more tests into SKIP: the job would stay green with fewer tests run. Asserting a minimum pass count in the step would close that gap, for example by grepping the N/M passed line for N >= 31 and N >= 33 in the emulated run.
  2. LLVM version. docs/testing.md:16, docs/design.md:292 and runtime/test/shaders/build.py:5 say llvm-mc must be LLVM 21+, but this job uses llvm-18 (:42, :59, :65). It works for today's hand-written .asm files, going by your fork run. A future test that uses syntax LLVM 18 lacks would fail with "llvm-mc failed" for a reason unrelated to the translator. Either note in the step comment that 18 is enough for assembling the tests, or move to a newer llvm-NN package from the Ubuntu archive if it has one.

Also, #435 edits the same job, so whichever PR lands second needs a rebase. The PR description already says this.

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Reviewed 19d4dbb: looks good

  • Merge note: this PR and CI: scope Runtime workflow by path, run Linux ctest, enable D3D12 shim test #435 conflict textually in .github/workflows/runtime.yml (git merge-tree), as you say. There is also a logic clash. CI: scope Runtime workflow by path, run Linux ctest, enable D3D12 shim test #435 limits Runtime to runtime/**, tools/gen_d3d12_stubs.py and the workflow file, so once both land, a PR that changes only tools/rdna2spirv.py (or tools/mc_command.py, or scripts/run_gpu_tests.py) no longer runs these llvmpipe tests. Whichever lands second should add those paths to the filter, or move this step to a workflow without one.
  • Not checked: the counts in docs/testing.md (31/60 and 33/33) were measured on d937b7f. Main has added GPU tests since then (cs_wqm_*, ps_wqm, ps_fma_literal, vs_clip variants), so the counts may need re-measuring after a rebase.

Ran: the merge onto current main is clean. Every workflow parses, and the action SHAs match their tags (gh api .../git/ref/tags). run_gpu_tests.py on main still takes --build/--llvm-mc/--work/--filter. Your fork run 44963412163 passed both llvmpipe steps. Upstream CI is waiting for approval. OS = Windows 11, Python 3.13.
Review was AI-assisted (Claude Code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants