Skip to content

runtime tests: vk_null_descriptor_test builds without glslangValidator (TEST-NULL-DESCRIPTOR-NO-GLSLANG) - #2055

Merged
Andretuta merged 1 commit into
ProjectLeonida:mainfrom
xel1uz:test/null-descriptor-no-glslang
Nov 27, 2026
Merged

Andretuta merged 1 commit into
ProjectLeonida:mainfrom
xel1uz:test/null-descriptor-no-glslang

Conversation

@xel1uz

@xel1uz xel1uz commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-NULL-DESCRIPTOR-NO-GLSLANG (#1608, #1608 (comment))

What and why

vk_null_descriptor_test came in with ba62682 (the post-story-load integration). Its GLSL shader is only built when CMake finds glslangValidator, and only then is LEONIDA_TEST_NULL_DESCRIPTORS_SPV defined (runtime/CMakeLists.txt, "without glslangValidator the test skips"). main() checks for the macro and returns 77, but run() in the anonymous namespace calls load_spirv(LEONIDA_TEST_NULL_DESCRIPTORS_SPV) without a check. So without glslang the file does not compile:

runtime/test/vk_null_descriptor_test.cpp:97:56: error: 'LEONIDA_TEST_NULL_DESCRIPTORS_SPV' was not declared in this scope
ninja: build stopped: subcommand failed.

The linux-gpu-tools job in .github/workflows/runtime.yml installs libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools and no glslang. Its cmake --build therefore fails, and none of its later steps run: CPU runtime tests, predicate shaders, the three llvmpipe GPU passes and the pipeline-checker checks. The Windows and macOS jobs install glslang, so they don't see this.

The fix compiles the namespace's helpers only when the macro is defined, the way main() already assumes. Without glslang the test reports itself unsupported (77, SKIP_RETURN_CODE), like the other GLSL-based runtime tests. With glslang nothing changes.

Tested

All runs are in Ubuntu 26.04 (Docker), with g++ 15.2, Mesa 26.0.8 llvmpipe, and Vulkan-Headers fetched at the pinned commit (-DLEONIDA_VULKAN_HEADERS_FETCH=ON). The configure is otherwise as in linux-gpu-tools: -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_REQUIRE_VULKAN=ON.

  • main without glslang (b9320a1, and 9f9a7c5 for this one target): the build stops with the error above.
  • This branch without glslang:
  • This branch with glslang (glslang-tools): vk_null_descriptor_test builds and passes on llvmpipe (vk_null_descriptor: ok, null descriptors and storage fallback images).
  • git diff --check and scripts/check_no_game_data.py are clean on the changed file.

GPUs tested: Mesa llvmpipe (LLVM 21.1.8), CPU only.

AI-assisted: Yes (Claude Code).

Checklist

  • Based on current main and merges cleanly.
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption.
  • A new translator rule in the contract table of docs/design.md - n/a.

🤖 Generated with Claude Code

ba62682 added the test with a guard in main only: without glslangValidator
CMake leaves LEONIDA_TEST_NULL_DESCRIPTORS_SPV undefined, but run() still
names it, so the file does not compile and the Linux runtime build, which
installs no glslang (runtime.yml linux-gpu-tools), stops there. Compile the
helpers only with the shader, as main already assumes, so the test reports
itself unsupported (77) like the other GLSL-based tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moffington

Copy link
Copy Markdown
Contributor

Independently verified this fix at HEAD b65ec46b7 (issue encountered while investigating the linux-gpu-tools build failure on #826):

  • Without glslangValidator (-DCMAKE_IGNORE_PATH="/usr/bin;/bin;/usr/sbin;/sbin"):
    • Merge-base 9f9a7c5f3: fails to compile at runtime/test/vk_null_descriptor_test.cpp:97 (‘LEONIDA_TEST_NULL_DESCRIPTORS_SPV’ was not declared in this scope).
    • PR HEAD b65ec46b7: builds cleanly; vk_null_descriptor_test prints unsupported: the test shader was not built (no glslangValidator) and exits 77, and ctest -R "^vk_null_descriptor$" reports ***Skipped (100% tests passed out of 1).
  • With glslangValidator (NVIDIA GeForce RTX 3060, Linux):
    • Compiles cs_null_descriptors.comp and vk_null_descriptor_test cleanly; vk_null_descriptor_test executes all null-descriptor and storage-fallback checks and passes (vk_null_descriptor: ok, ctest Passed in 0.45 s). No test coverage is lost when glslangValidator is available.
  • Mergeability: git merge-tree against main (7f3d0095a) is clean.

LGTM.

@qhukz13

qhukz13 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

I reproduced the linux-gpu-tools job: Ubuntu under WSL, g++-13, the job's pinned Vulkan-Headers (6802bb47, vulkan-sdk-1.4.363.0), libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools, the job's configure line. Results:

tree build (no glslang, as in CI) ctest
main 246791612 fails: vk_null_descriptor_test.cpp:97:56: 'LEONIDA_TEST_NULL_DESCRIPTORS_SPV' was not declared, the only error with -k 0 not reached
main + this PR builds 109/109 passed, vk_null_descriptor skipped (77)

So this is the whole build failure every PR head shows in that job. It is also why the job's later steps never ran on any PR: the CPU runtime tests, the predicate shaders, the llvmpipe GPU passes and the pipeline-checker checks. The maintainers' status lists it ("linux-gpu-tools fails at its build step on recent PR heads").

Suggestion, so the test does not stay skipped on Linux CI for good. With glslang-tools installed in the same environment, the test is built and runs on llvmpipe: vk_null_descriptor ... Passed 2.14 sec. Adding glslang-tools to the job's pkgs=(...) list in .github/workflows/runtime.yml would make the job actually exercise it. The guard here would stay for local Linux builds without glslang. That can be a one-line follow-up, or part of this PR if you prefer.

AI-assisted (Claude Code).

@kawaii-shakal kawaii-shakal 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.

Reviewed by Claude Code (AI-assisted) on my behalf. Approving.

Without glslangValidator, CMake leaves LEONIDA_TEST_NULL_DESCRIPTORS_SPV undefined, and run() names it at
line 97 outside main's #ifndef, so the file did not compile at all. That is what fails the linux-gpu-tools job
of Runtime on main today (vk_null_descriptor_test.cpp:97:56: error: 'LEONIDA_TEST_NULL_DESCRIPTORS_SPV' was not declared in this scope, the runner has no glslang). Guarding everything but main fixes it and keeps
-Wunused-function quiet for run, load_spirv and check_common.

Checked on b65ec46 merged into main c0201a8 (merges cleanly), Linux, g++ 13, Mesa lavapipe:

  • the build's own compile command with the define removed: main fails with exactly the CI error; this head
    compiles with -Wall -Wextra and no diagnostics in the file, and the binary prints the "unsupported" line and
    exits 77, which SKIP_RETURN_CODE 77 reports as skipped;
  • with glslangValidator the test builds the shader and passes as before.

Generated by Claude Code

@Andretuta
Andretuta merged commit e69104f into ProjectLeonida:main Nov 27, 2026
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.

5 participants