Skip to content

ci: eliminate VS install from shader validation, add parallel hlslkit#2394

Draft
doodlum wants to merge 3 commits into
devfrom
claude/build-time-benchmarks-6UWqH
Draft

ci: eliminate VS install from shader validation, add parallel hlslkit#2394
doodlum wants to merge 3 commits into
devfrom
claude/build-time-benchmarks-6UWqH

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented May 22, 2026

Summary

Benchmarked and optimized the three CI legs that run on every HLSL/C++ PR. The dominant win is restructuring the shader-validation jobs to skip the VS Build Tools install and cmake configure entirely — they only needed those to copy shader files.


Measured baseline

Timings pulled from the last three real PRs that triggered shader validation (#2344, #2363, #2386):

Job PR #2344 PR #2363 PR #2386 Average
Validate shader compilation (VR) 30m 31s 28m 42s 29m 48s 29m 40s
Validate shader compilation (Flatrim) 26m 33s 31m 20s 29m 04s 28m 59s
Run Shader Unit Tests 12m 26s 13m 13s 11m 34s 12m 24s
Build plugin and addons (vs2026) 36m 01s 36m 01s

Where the shader-validation time goes (before)

Each of the two validation jobs (Flatrim, VR) ran this setup sequence before doing any actual validation:

Step Estimated cost
actions/checkout with submodules: recursive (79 MB extern/) ~2–3 min
VS 2026 Build Tools download + install ~8–12 min
vcpkg dependency resolution ~1–2 min
cmake configure (ALL preset) ~1–3 min
cmake build prepare_shaders target (just copies files) ~1 min
Python + pip install git+…hlslkit (no cache) ~1–2 min
hlslkit-compile (single-core, 212 permutations) ~10–13 min
Total ~24–36 min

Changes and expected improvement

1 — Remove VS install + cmake from shader-validation jobs (_shared-build.yaml, prepare-shaders/action.yml)

The prepare_shaders cmake target only copies HLSL files from package/Shaders/ and features/*/Shaders/ into build/ALL/aio/Shaders/. There is no C++ compilation. Replace with a direct robocopy step that runs in ~30 s and needs no toolchain at all.

  • Drop setup-build-environment (VS + vcpkg + cmake) from both validation jobs
  • Drop submodules: recursive; the extern/ C++ deps are irrelevant here
  • fxc.exe ships with the Windows SDK already on windows-2025 runners

Expected saving: ~12–17 min per validation job.

2 — Parallel shader compilation (_shared-build.yaml)

- hlslkit-compile … --max-warnings 0 --suppress-warnings X1519
+ hlslkit-compile … --max-warnings 0 --suppress-warnings X1519 --jobs $(nproc) --strip-debug-defines

windows-2025 runners have 4 logical cores. --jobs $(nproc) parallelises the 212-permutation fxc.exe invocations. --strip-debug-defines removes the per-shader /Zi debug-info overhead.

Expected saving: ~6–9 min (from ~12 min at 1 core to ~4–5 min at 4 cores).

3 — pip caching for hlslkit (prepare-shaders/action.yml, .github/configs/hlslkit-requirements.txt)

Previously: pip install git+https://github.com/alandtse/hlslkit.git on every run (fresh git clone + build, no cache).
Now: pin via hlslkit-requirements.txt, cache built wheel with setup-python@v6 cache: pip.

Expected saving: ~1–2 min on warm cache runs.

4 — CMake cache key: stop hashing 79 MB of extern/ (setup-build-environment/action.yaml)

- ${{ hashFiles('.gitmodules', 'extern/**', …) }}
+ ${{ hashFiles('.gitmodules', '.git/modules/CommonLibSSE-NG/HEAD', '.git/modules/FidelityFX-SDK/HEAD', '.git/modules/Streamline-DX12/HEAD', …) }}

Three 41-byte HEAD files instead of scanning the entire extern/ tree. Same correctness (detects any submodule SHA change), negligible I/O. Relevant for cpp-build and shader-unit-tests jobs.

5 — FastDev local build preset (CMakePresets.json, cmake/XSEPlugin.cmake)

New FastDev build preset: RelWithDebInfo config (keeps /O2) with LTO/LTCG disabled, no zip packaging. Linker is ~3–4× faster for rapid iteration:

BuildRelease.bat FastDev

XSEPlugin.cmake gains CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO OFF so cmake doesn't silently re-enable LTO for that config even with the global IPO flag set.

6 — BuildRelease.bat --build-only

Skip cmake reconfigure on repeat local builds when project files haven't changed:

BuildRelease.bat --build-only FastDev

7 — tools/benchmark-build.ps1

Measures configure / compile / package / shader-validation times individually so each phase can be compared before/after any future build-system change:

powershell.exe ./tools/benchmark-build.ps1 -Preset FastDev -SkipConfigure

After timings

To be filled in once this PR's CI completes. The table below will be updated with the measured times from this run.

Job Before (avg) After (measured) Delta
Validate shader compilation (VR) 29m 40s TBD TBD
Validate shader compilation (Flatrim) 28m 59s TBD TBD
Run Shader Unit Tests 12m 24s TBD TBD
Build plugin and addons (vs2026) 36m 01s TBD TBD

Test plan

  • CI green on this PR — both shader-validation jobs complete without VS toolchain
  • fxc.exe is found via the pre-installed Windows SDK on windows-2025
  • All 212 Flatrim + ~210 VR shader permutations compile with no new warnings
  • After timings recorded and table above updated
  • FastDev preset builds locally on Windows (manual, requires VS)

https://claude.ai/code/session_01SWzRWgwr9UexPxa9hLrpmq


Generated by Claude Code

…ompile

**Shader validation (~8-18 min saved per run)**

The shader-validation job previously ran setup-build-environment (VS
install, vcpkg, cmake configure) just to copy shader files into the AIO
layout. Replace the cmake-based prepare_shaders target with a direct
robocopy step that needs no C++ toolchain at all.

- prepare-shaders action now copies with robocopy instead of cmake
- shader-validation jobs skip submodule checkout (not needed for HLSL)
- shader-validation jobs drop the setup-build-environment step entirely
- fxc.exe is already in the Windows SDK on windows-2025 runners

**Parallel shader compilation (~30-50% faster validation)**

- Add --jobs $(nproc) --strip-debug-defines to hlslkit-compile so all
  available CPU cores are used and per-shader debug overhead is dropped

**hlslkit pip caching**

- Pin hlslkit via .github/configs/hlslkit-requirements.txt
- Cache pip wheels with setup-python@v6 so repeated runs skip the git
  clone + build of hlslkit

**CMake cache key: stop hashing 79 MB of extern/**

- Use .git/modules/*/HEAD refs (3 small files) instead of extern/**
  to detect submodule SHA changes; same correctness, negligible I/O

**FastDev build preset (local dev)**

- New ALL-FastDev configure preset: ZIP_TO_DIST=OFF, AIO_ZIP_TO_DIST=OFF,
  BUILD_SHADER_TESTS=OFF for a leaner configure step
- New FastDev build preset: RelWithDebInfo config → no LTO/LTCG, 3-4x
  faster link step while keeping /O2 optimisation
- XSEPlugin.cmake: add CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO=OFF
  so cmake does not apply LTO to RelWithDebInfo even with IPO globally ON

**BuildRelease.bat: add --build-only flag**

- Skip cmake configure on repeated local builds when project files have
  not changed: BuildRelease.bat --build-only [preset]

**tools/benchmark-build.ps1**

- New script that times configure / compile / package / shader validation
  separately so each phase can be measured and compared across presets

https://claude.ai/code/session_01SWzRWgwr9UexPxa9hLrpmq
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 30d47676-c8e0-437e-b5c2-464bb4236964

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/build-time-benchmarks-6UWqH

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

No actionable suggestions for changed features.

Allows testing workflow and action file changes on a feature branch
without merging to dev first.

workflow_dispatch resolves all files (including .github/actions/*)
from the selected ref, unlike pull_request_target which always uses
the base branch. Trigger via: Actions → Manual CI Test → Run workflow
→ select branch.
The comment said 'pinned by commit hash' but the actual URL had no
@<hash>. Without a pin, the pip wheel cache key never changes even
when hlslkit is updated upstream — cached runs silently use stale
wheels. Pin to current HEAD (d30266d).
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub changed the title perf(ci): eliminate VS install from shader validation, add parallel hlslkit ci: eliminate VS install from shader validation, add parallel hlslkit May 22, 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.

2 participants