Repository navigation
CI: run the GPU tests on Mesa llvmpipe - #430
Conversation
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
VictorJulianiR
left a comment
There was a problem hiding this comment.
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):pushto main,pull_requestandworkflow_dispatchare unchanged. There is nopull_request_targetorworkflow_run, so fork PRs get a read-only token and no secrets. - Permissions (
:11-12):contents: read, unchanged. Nosecrets.*is used. - Pinned actions (
:38):actions/checkout@3d3c42e5...matches tag v7.0.1, which I checked withgh 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 arun:step. The new steps only use$RUNNER_TEMP(:59, :65). - Optional hardening:
persist-credentialsis 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: falsewould cost nothing, since the job never pushes.
Correctness:
- Skips count as passes.
scripts/run_gpu_tests.py:772returns 0 whenpassed + skipped == len(results). Thevulkaninfo | grep llvmpipeguard (: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 theN/M passedline for N >= 31 and N >= 33 in the emulated run. - LLVM version.
docs/testing.md:16,docs/design.md:292andruntime/test/shaders/build.py:5say 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 newerllvm-NNpackage 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.
|
Reviewed 19d4dbb: looks good
Ran: the merge onto current main is clean. Every workflow parses, and the action SHAs match their tags ( |
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-toolsjob; whichever lands second rebases, see #418 (comment))What and why
The
linux-gpu-toolsjob inruntime.ymlbuildsvk_harnessand 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 runsscripts/run_gpu_tests.pytwice:ps_bitmask_perm) and noVK_KHR_fragment_shader_barycentric(ps_bary,ps_uniform_branch).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 checksvulkaninfofor 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.mdgets 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
docs/design.md, with how it was confirmed. (Not applicable: no translator change.)🤖 Generated with Claude Code
https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy