Skip to content

CI: share runtime CMakePresets across local/CI builds and upgrade Runtime Linux job to LLVM 21 - #802

Open
sombraSoft wants to merge 1 commit into
ItsNotRexed:mainfrom
sombraSoft:ci/runtime-presets-and-llvm21
Open

sombraSoft wants to merge 1 commit into
ItsNotRexed:mainfrom
sombraSoft:ci/runtime-presets-and-llvm21

Conversation

@sombraSoft

@sombraSoft sombraSoft commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part 3 of #799. Standalone PR directly on main (decoupled from #801 — touches no Dependabot files; conflict-free with #801 in either merge order).

Aligns local and CI C++ runtime builds via shared CMake presets and upgrades the Linux Runtime job to LLVM 21:

  • runtime/CMakePresets.json: add version 3 presets (compatible with cmake_minimum_required(VERSION 3.24)) for windows-ninja (RelWithDebInfo, LEONIDA_D3D12_SHIM_TESTS=ON) and linux-ninja (RelWithDebInfo) across configure, build, and test presets. CI-only flags (sccache, MSVC -Z7) stay on the CI CLI so local developers do not need sccache.
  • scripts/build_runtime.ps1: use cmake --preset windows-ninja and cmake --build --preset windows-ninja when VS CMake + Ninja are installed (preserving -FetchSdl3), and add a -Test switch to run ctest --preset windows-ninja after building (preserving the non-CMake fallback).
  • .github/workflows/runtime.yml:

No new GitHub Actions added; existing action SHA pins are unchanged.

Tested

  • Local on 960f3e3 (rebased onto 43d4703, Windows 11, VS BuildTools CMake 4.2.3-msvc3 + Ninja + MSVC 19.51):
  • Live fork CI (earlier commit 6cb2254):
    • Runtime: https://github.com/sombraSoft/Leonida/actions/runs/44978656572 — 100% pass:
      • windows: 1m06s, 30/30 ctest pass (1.82s), sccache 100% hit rate.
      • linux-gpu-tools: 58s, Ubuntu LLVM 21.1.8 verified, 10/10 Linux ctest pass (0.08s), all llvmpipe GPU tests + vk_pipeline_check + wave64 compute emulation pass, sccache 100% hit rate.

Notes

  • No game data included.
  • AI-assisted (OpenCode).

@sombraSoft

Copy link
Copy Markdown
Contributor Author

Rebased onto 43d4703 (960f3e3) preserving #894's Windows glslang steps and decoupled from #801 (no Dependabot changes; git merge-tree with #801 is clean in either merge order).

Note: Runtime / linux-gpu-tools (LLVM 21 + linux-ninja preset) passed on upstream CI; any failure in Runtime / windows on Verify the descriptor test shader (cs_sample.spv) is the pre-existing main issue tracked in #1029.

@ItsJaved

Copy link
Copy Markdown
Contributor

Tested 960f3e3 on Windows 11 with VS 18 BuildTools (MSVC 19.51.36247.0, without Visual Studio's bundled C++ CMake tools component) and standalone cmake, ctest, and ninja on PATH:

  • scripts/build_runtime.ps1 -Test fails immediately with: Running -Test requires Visual Studio's C++ CMake tools (cmake.exe and ninja.exe).
  • Note that when configuring directly via cmake -S runtime -B runtime/build -G Ninja ... under vcvars64.bat, the full 198-target runtime and CTest suite build and run cleanly on this setup.

When rebasing onto current main, falling back to Get-Command cmake / ctest / ninja on PATH (as scripts/build_llvm_mc.ps1 does) would let build_runtime.ps1 and -Test work on BuildTools + system CMake/Ninja installs too. No game files. AI-assisted.

@sombraSoft
sombraSoft force-pushed the ci/runtime-presets-and-llvm21 branch from 960f3e3 to 64553f8 Compare November 22, 2026 06:51
@sombraSoft

Copy link
Copy Markdown
Contributor Author

Thanks for testing BuildTools + standalone CMake/Ninja on Windows, @ItsJaved!

Rebased onto current \main\ (\48ad23f, picking up #1029's descriptor-shader check) in \64553f8\ and updated \scripts/build_runtime.ps1\ to fall back to \Get-Command cmake\ / \ctest\ /
inja\ on \PATH\ (matching \scripts/build_llvm_mc.ps1) when VS's bundled C++ CMake tools component isn't installed, plus a clear error if -Test\ is passed without \ctest.

Verified locally on Windows 11 + MSVC 19.51 + Ninja: .\scripts\build_runtime.ps1 -Test\ built 126/126 targets and passed 30/30 CTests (including \d3d12_xs_root_signature), and \jactionlint --profile default .github/workflows/runtime.yml\ exited 0. AI-assisted.

@quackottu quackottu 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.

Tested 64553f8 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • Build ok. ctest: 50/50 (gameinput disabled, no SDL3).
  • Built with this PR's scripts/build_runtime.ps1 + CMakePresets.json (Ninja, RelWithDebInfo) on Windows. The Linux CI job isn't covered here.
  • 44 test programs exit 0 with 0 validation messages.
  • Same on main, not from this PR: d3d12_clear_test (NVIDIA 0.5 tie rounding, #521), vk_binary_occlusion_test (needs an input file), and the 3 VUID-vkCreateDevice-ppEnabledExtensionNames-01387 in d3d12_fence_timing_test/d3d12_vulkan_device_test (#1027).

@undeadhuman37

Copy link
Copy Markdown
Contributor

Tested 64553f8 on NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 Home 25H2 (26200.9974), VS 2022 Build Tools, Vulkan SDK 1.4.363.1: pass

  • scripts\build_runtime.ps1 (now through the windows-ninja preset): 0 warnings, reusing an existing runtime\build configured without presets.
  • ctest: 100% passed, 0 failed out of 51.
  • The new -Test switch: builds and runs ctest --preset windows-ninja, 51/51 passed.
  • Not exercised here: the workflow changes and the linux-ninja preset.

AI-assisted. No game files.

@S1m0ne1997

Copy link
Copy Markdown
Contributor

Tested ce850576 on RTX 4090 (NVIDIA 621.24, Vulkan 1.4.357), Windows 11 Home 26300, MSVC 14.44 (VS 2022 Build Tools), Vulkan SDK 1.4.363.0, llvm-mc 23.1.5 (MSYS2): pass

  • runtime build clean; ctest: everything passes except gameinput (disabled, counted as not run) and d3d12_multithread, which failed once with 8 builds running in parallel and passes when rerun alone (same on main bb2e1842).
  • d3d12_vulkan_device_test with LEONIDA_VK_VALIDATION=1: OK, no validation errors.
  • build.py / check.py 93 of 124 pass, 31 skipped; run_gpu_tests.py 105/133 passed, 28 skipped, no failures.
  • pytest: only test_tile_probe fails (needs numpy, not installed here; same on main); semantic tests OK.

No game files involved.

AI-assisted (Claude Code).

@requiemsnkrp

Copy link
Copy Markdown

Tested ce85057 on NVIDIA GeForce RTX 3060 (driver 32.0.16.1714), Windows 11, MSVC 19.51, Windows SDK 10.0.26100: pass.

Built runtime/ (RelWithDebInfo) and ran ctest -E "present|swapchain|frame_pacer": 66/66 passed. The window tests (d3d12_present, xbox_present, dxgi_swapchain, frame_pacer) were not run for this PR. No Vulkan validation layers on this machine. No game files.

AI-assisted (Claude).

@ray3242

ray3242 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

This PR now also fixes a main regression. Since d78546f, ps_sdwa_f16_const.asm:30 (v_cvt_f16_u16_sdwa v5, 1.0 ...) fails to assemble with llvm-18, and run_gpu_tests.py aborts in linux-gpu-tools on main. Locally llvm-mc 19, 20 and 21 all assemble it, and with each of them the fixture passes on llvmpipe. Details: #3047 (finding just posted). When you rebase, please make sure the --filter cs_ wave64 step (runtime.yml:296) also moves off /usr/lib/llvm-18. AI-assisted (Devin).

@slint6614-dev slint6614-dev 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 the current workflow and preset changes. Both the native and wave64-emulation GPU test commands now use /usr/lib/llvm-21/bin/llvm-mc, addressing the LLVM 18 assembly failure in BUILD-923. The PR reports a passing Linux run on an earlier revision and Windows build/test checks; I found no blocking issue in the diff. I did not run tests locally.

@Koro4e

Koro4e commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Critical CI fix - this PR resolves BUILD-923 (finding by @ray3242: #3047 (comment)).

On main (16282101), Runtime / linux-gpu-tools pins LLVM 18's llvm-mc in three places in .github/workflows/runtime.yml: the install check and both run_gpu_tests.py --llvm-mc calls. LLVM 18 rejects the new ps_sdwa_f16_const fixture (v_cvt_f16_u16_sdwa v5, 1.0), so the suite aborts before producing any result on every queued PR.

I checked the diff here: all three pins are replaced with /usr/lib/llvm-21/bin/llvm-mc, the job adds apt.llvm.org's LLVM 21 repo, and a --version self-check asserts both LLVM version 21. and amdgcn before the run. That matches the coordinator's note "or merge #802"; a separate workflow patch would duplicate this.

No game files, no GPU needed for the change itself. Mergeable against current main.

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.

9 participants