Repository navigation
The GL tests hold Mesa's llvmpipe to AVX2: LLVM 21's Zen 4 code puts NaN in the probe test - #566
Merged
Merged
Conversation
llvmpipe compiles the shaders for the host's CPU. On an AMD Zen 4 (znver4) host, LLVM 21's AVX-512 code for reflectionprobe_gl's one-pass probe shader leaves a NaN in the green of the screen-space reflection, on about a tenth of the opaque marches through sampleReflectionProbes and sampleReflectionProbesWater. That was the Linux test job's intermittent failure: Ubuntu 26.04's Mesa 26.0.8 on LLVM 21.1.8, reproduced bit for bit under Intel SDE with a Zen 4 CPUID. The same code built for AVX2 on that CPU, for Zen 3, or for Intel's AVX-512 CPUs does not, nor does it without LLVM's IR passes. al_add_test_binary runs every GL binary with GALLIUM_OVERRIDE_CPU_CAPS=avx, which clears AVX-512 from what Mesa sees of the CPU, so every runner's llvmpipe compiles the same AVX2 code. A GPU's driver draws nothing differently for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
reflectionprobe_gl_testfailed once on the Linux x64 test job (#554's first attempt) and passed on the re-run, on the same commit, image and Mesa. It failed only in the screen-space reflection and hero probe case, with the classic sky off, throughsampleReflectionProbes(2,136 pixels) andsampleReflectionProbesWater(2,840). The one-pass build's gloss had a NaN green where red and blue matched the list build exactly, e.g. at 23,0:0.670816, -nan, 0.530254against0.670816, 0.700022, 0.530254.Cause
llvmpipe compiles the shaders for the CPU it runs on, and the runners are not all the same CPU. On an AMD Zen 4 host (
-mcpu=znver4), Ubuntu 26.04's Mesa 26.0.8 with LLVM 21.1.8 compiles the one-pass probe shader to AVX-512 code that leaves a NaN in the green of the screen-space reflection. It hits about a tenth of the opaque marches. The failing attempt ran in Azure eastus and the passing re-run in centralus.The failure reproduces exactly: the Linux test binary at the failing commit (996d100), on Ubuntu 26.04's own Mesa in WSL, under Intel SDE with a Zen 4 CPUID. It gives the same 2,136 and 2,840 pixels and the same values as CI. These all pass:
znver4).GALLIVM_PERF=nopt), or with 128-bit vectors.The shader is not at fault. Its NIR has no undefined float values, and red, green and blue go through the same code. Giving
traceScreenRay'sout hitDeptha variable of its own, rather thandepth, changes nothing.Change
al_add_test_binaryruns every GL binary withGALLIUM_OVERRIDE_CPU_CAPS=avx, Mesa's documented llvmpipe override. It clears AVX-512 from what Mesa sees of the CPU, so every runner's llvmpipe compiles the same AVX2 code. The variable reaches every entry, combined and per-case runs included, in both the build and sanitizer workflows and in a localctest. A GPU's driver draws nothing differently for it.doc/TESTING.md's GL bullet says so, for a binary run by hand.Develop does not trip it today. With #553's change to the probe shader, develop's whole
alrender_gl_testssuite passes under the Zen 4 profile without the override. The shader's new code happens to dodge the bad code. This holds it off for the next edit to the probe or reflection shaders.Testing
Under SDE with a Zen 4 CPUID, on Ubuntu 26.04's Mesa:
alrender_gl_testssuite: without the override, only this case fails (52 cases); with it, all 52 pass.ctest's entry forreflectionprobe_gl_testcarriesGALLIUM_OVERRIDE_CPU_CAPS=avxand passes.🤖 Generated with Claude Code