Skip to content

Add nightly CI for Sascha Willems Vulkan Slang shaders#10474

Merged
jvepsalainen-nv merged 11 commits intoshader-slang:masterfrom
jvepsalainen-nv:ci-add-sascha-willems
Mar 11, 2026
Merged

Add nightly CI for Sascha Willems Vulkan Slang shaders#10474
jvepsalainen-nv merged 11 commits intoshader-slang:masterfrom
jvepsalainen-nv:ci-add-sascha-willems

Conversation

@jvepsalainen-nv
Copy link
Contributor

Add a nightly workflow that compiles all Slang shaders from SaschaWillems/Vulkan to catch regressions. Uses sparse checkout to fetch only shaders/slang/ (~10MB vs 260MB full repo).

Includes a standalone script (extras/compile-sascha-willems-shaders.sh) for local reproduction. The script parses [shader("...")] attributes, compiles each stage to SPIR-V, and reports results with an explicit skip list for known failures (3 shaders using SV_PointSize as fragment input).

Closes #7318

Add a nightly workflow that compiles all Slang shaders from
SaschaWillems/Vulkan to catch regressions. Uses sparse checkout
to fetch only shaders/slang/ (~10MB vs 260MB full repo).

Includes a standalone script (extras/compile-sascha-willems-shaders.sh)
for local reproduction. The script parses [shader("...")] attributes,
compiles each stage to SPIR-V, and reports results with an explicit
skip list for known failures (3 shaders using SV_PointSize as
fragment input).

Closes shader-slang#7318
@jvepsalainen-nv jvepsalainen-nv self-assigned this Mar 10, 2026
@jvepsalainen-nv jvepsalainen-nv requested a review from a team as a code owner March 10, 2026 10:05
@jvepsalainen-nv jvepsalainen-nv requested review from bmillsNV and removed request for a team March 10, 2026 10:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a nightly GitHub Actions workflow plus a Bash script to sparse-clone SaschaWillems/Vulkan shaders, locate .slang files, compile per shader-stage to SPIR‑V using slangc (optional validation), track known failures, and report results including scheduled Slack notifications.

Changes

Cohort / File(s) Summary
Workflow
​.github/workflows/compile-sascha-willems-shaders-nightly.yml
New GitHub Actions workflow (manual + daily 04:00 UTC). Prepares Windows environment (Git Bash, MSVC), builds Slang via CMake presets, sparse-checkouts SaschaWillems/Vulkan shaders/slang, runs the extras compile script, collects results, and sends conditional Slack notifications for scheduled runs.
Compilation script
extras/compile-sascha-willems-shaders.sh
New Bash script to find/validate slangc, clone or reuse a sparse SaschaWillems/Vulkan checkout, scan shaders/slang for .slang files, infer stages from [shader("<stage>")] markers, compile per-stage to SPIR‑V (optional SPIR‑V validation), skip known failures, aggregate metrics, and exit non-zero on unexpected failures.

Sequence Diagram

sequenceDiagram
    participant GA as "GitHub Actions"
    participant Env as "Windows Env (Git Bash / MSVC)"
    participant Build as "Slang Build (CMake)"
    participant Repo as "SaschaWillems/Vulkan (sparse)"
    participant Script as "compile-sascha-willems-shaders.sh"
    participant Compiler as "slangc"
    participant Slack as "Slack Webhook"

    GA->>Env: prepare PATH, add Git Bash, setup MSVC
    Env->>Build: configure & build Slang (CMake presets)
    GA->>Repo: sparse-clone `shaders/slang`
    GA->>Script: invoke with flags (slangc path, repo, spirv-val)
    Script->>Repo: scan for `.slang` files
    loop per file and detected stage
        Script->>Compiler: run `slangc` (-profile spirv_1_4 -target spirv -entry -stage)
        Compiler-->>Script: success or error (optionally run spirv-val)
        Script->>Script: record pass/fail/skip/known-failure
    end
    Script-->>GA: exit status & summary
    GA->>Slack: post scheduled pass/fail notification
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hop through shaders in the night,
I build each stage by pale moonlight,
SPIR‑V crumbs fall from my paws,
I mark the skips and note the flaws,
A cheerful rabbit guards the CI.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add nightly CI for Sascha Willems Vulkan Slang shaders' clearly and concisely summarizes the primary change: adding a nightly CI workflow for these specific shaders.
Description check ✅ Passed The description is directly related to the changeset, explaining the nightly workflow, sparse checkout optimization, the standalone script, and known failure handling.
Linked Issues check ✅ Passed The PR fully addresses issue #7318 by implementing the requested CI integration for Sascha Willems's Slang shaders with a nightly workflow and standalone script for local reproduction.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the nightly CI workflow and supporting script for Sascha Willems shader compilation, with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
extras/compile-sascha-willems-shaders.sh (1)

166-183: Add default case and fix formatting.

The function lacks a default case - if an unknown stage is passed, it silently returns an empty string, which could lead to confusing output filenames. Additionally, the pipeline failure indicates formatting issues in this block that should be addressed.

♻️ Proposed fix with default case and consistent formatting
 get_output_ext() {
   case "$1" in
-    vertex) echo ".vert" ;;
-    fragment) echo ".frag" ;;
-    compute) echo ".comp" ;;
-    raygeneration) echo ".rgen" ;;
-    miss) echo ".rmiss" ;;
-    closesthit) echo ".rchit" ;;
-    callable) echo ".rcall" ;;
-    intersection) echo ".rint" ;;
-    anyhit) echo ".rahit" ;;
-    mesh) echo ".mesh" ;;
-    amplification) echo ".task" ;;
-    geometry) echo ".geom" ;;
-    hull) echo ".tesc" ;;
-    domain) echo ".tese" ;;
+    vertex)        echo ".vert" ;;
+    fragment)      echo ".frag" ;;
+    compute)       echo ".comp" ;;
+    raygeneration) echo ".rgen" ;;
+    miss)          echo ".rmiss" ;;
+    closesthit)    echo ".rchit" ;;
+    callable)      echo ".rcall" ;;
+    intersection)  echo ".rint" ;;
+    anyhit)        echo ".rahit" ;;
+    mesh)          echo ".mesh" ;;
+    amplification) echo ".task" ;;
+    geometry)      echo ".geom" ;;
+    hull)          echo ".tesc" ;;
+    domain)        echo ".tese" ;;
+    *)             echo ".spv" ;;
   esac
 }
.github/workflows/compile-sascha-willems-shaders-nightly.yml (3)

75-86: Consider adding error handling for cd command.

While the git clone failure would cause the step to fail, adding explicit error handling for cd makes the failure mode clearer.

♻️ Proposed fix
         git clone --depth 1 --filter=blob:none --sparse \
           https://github.com/SaschaWillems/Vulkan.git SaschaWillems-Vulkan
-        cd SaschaWillems-Vulkan
+        cd SaschaWillems-Vulkan || exit 1
         git sparse-checkout set shaders/slang

117-139: Consider updating Slack GitHub Action version.

The workflow uses slackapi/slack-github-action@v1.26.0, but "ongoing development is now happening on version @v2 and @v1 is no longer planning to receive significant updates." "We recommend using the latest version of this Action for the most recent updates and fixes."

Options:

  • Minimal update: Bump to v1.27.0 (last v1.x release, no breaking changes)
  • Full migration: Upgrade to v2.x (breaking changes - requires adding webhook-type: incoming-webhook)
♻️ Option 1: Minimal update to v1.27.0
-        uses: slackapi/slack-github-action@v1.26.0
+        uses: slackapi/slack-github-action@v1.27.0
♻️ Option 2: Migrate to v2.x (recommended long-term)
       - name: Success notification
         id: slack-notify-success
         if: ${{ github.event_name == 'schedule' && success() }}
-        uses: slackapi/slack-github-action@v1.26.0
+        uses: slackapi/slack-github-action@v2.1.0
         with:
+          webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
+          webhook-type: incoming-webhook
           payload: |
-            {
-              "Sascha-Willems-Nightly": ":green-check-mark: Sascha Willems shader nightly status: ${{ job.status }}"
-            }
-        env:
-          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
+            text: ":green-check-mark: Sascha Willems shader nightly status: ${{ job.status }}"

88-98: Minor redundancy: Environment variable and flag both set.

The SLANG_RUN_SPIRV_VALIDATION environment variable is set here (line 90), but the --spirv-val flag also exports this variable in the script (line 138). One can be removed.

♻️ Proposed simplification
       - name: Compile Slang shaders
-        env:
-          SLANG_RUN_SPIRV_VALIDATION: 1
         run: |
           echo "Compiling Sascha Willems Vulkan Slang shaders..."
-          echo "SPIRV validation enabled via SLANG_RUN_SPIRV_VALIDATION=1"
 
           ./extras/compile-sascha-willems-shaders.sh \
             --slangc build/Release/bin/slangc.exe \
             --repo SaschaWillems-Vulkan \
             --spirv-val

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bceaea3d-e5be-4c68-97f1-6f2a94396461

📥 Commits

Reviewing files that changed from the base of the PR and between b389635 and ecc279a.

📒 Files selected for processing (2)
  • .github/workflows/compile-sascha-willems-shaders-nightly.yml
  • extras/compile-sascha-willems-shaders.sh

@jvepsalainen-nv
Copy link
Contributor Author

/format

@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

jvepsalainen-nv added a commit to jvepsalainen-nv/slang that referenced this pull request Mar 10, 2026
@jvepsalainen-nv jvepsalainen-nv added the CI CI pipeline and automation label Mar 10, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb5b9ead-262f-4a70-b60b-e9b19677ba07

📥 Commits

Reviewing files that changed from the base of the PR and between ecc279a and e8a9209.

📒 Files selected for processing (1)
  • extras/compile-sascha-willems-shaders.sh

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (4)
extras/compile-sascha-willems-shaders.sh (4)

82-84: ⚠️ Potential issue | 🟡 Minor

Fail fast if repo-root resolution fails.

If any of these cd steps miss, the script keeps running from the caller's working directory and later reports a misleading root error.

Suggested fix
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-SLANG_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
-cd "$SLANG_ROOT"
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit 1
+SLANG_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" || exit 1
+cd "$SLANG_ROOT" || exit 1

105-111: ⚠️ Potential issue | 🟠 Major

Reject non-executable slangc paths up front.

-f accepts plain files, and the unchecked -version probe turns a bad --slangc path into a flood of per-shader failures instead of one setup error.

Suggested fix
-if [ -z "$SLANGC" ] || [ ! -f "$SLANGC" ]; then
-  log_error "slangc not found. Build Slang first or pass --slangc PATH"
+if [ -z "$SLANGC" ] || [ ! -x "$SLANGC" ]; then
+  log_error "slangc not found or not executable. Build Slang first or pass --slangc PATH"
   exit 1
 fi
 
 log_info "Using slangc: $SLANGC"
-"$SLANGC" -version
+if ! "$SLANGC" -version; then
+  log_error "Failed to execute slangc at $SLANGC"
+  exit 1
+fi

123-126: ⚠️ Potential issue | 🟠 Major

Only report clone success after git clone succeeds.

A checkout failure still falls through to [OK], so the actionable error is hidden behind the later missing-directory check.

Suggested fix
 if [ ! -d "$REPO_DIR" ]; then
   log_info "Cloning SaschaWillems/Vulkan (shallow)..."
-  git clone --depth 1 https://github.com/SaschaWillems/Vulkan.git "$REPO_DIR"
+  if ! git clone --depth 1 https://github.com/SaschaWillems/Vulkan.git "$REPO_DIR"; then
+    log_error "Failed to clone SaschaWillems/Vulkan into $REPO_DIR"
+    exit 1
+  fi
   log_success "Cloned to $REPO_DIR"
 else

272-281: ⚠️ Potential issue | 🟠 Major

Treat “compiled zero shaders” as a failed run.

This script is the nightly gate from .github/workflows/compile-sascha-willems-shaders-nightly.yml:88-99; exiting 0 when everything is skipped or no .slang files are found silently turns that job green with no coverage.

Suggested fix
-if [ $success -eq 0 ] && [ $fail -gt 0 ]; then
-  log_error "All shader compilations failed!"
+if [ "$success" -eq 0 ]; then
+  if [ "$total" -eq 0 ]; then
+    log_error "No .slang files were found under $SHADER_DIR"
+  else
+    log_error "No shaders compiled successfully"
+  fi
   exit 1
 fi

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 78341424-8508-4e1e-85ea-5355ec4348e6

📥 Commits

Reviewing files that changed from the base of the PR and between e8a9209 and 9ce8512.

📒 Files selected for processing (1)
  • extras/compile-sascha-willems-shaders.sh

- Validate --slangc/--repo have values before accessing $2
- Use -x instead of -f to check slangc is executable
- Check slangc -version return code
- Guard cd with || exit 1
- Handle git clone failure explicitly
- Fail if zero shaders compiled (catches upstream breakage)

Made-with: Cursor
@jvepsalainen-nv
Copy link
Contributor Author

/format

@jvepsalainen-nv jvepsalainen-nv removed the request for review from bmillsNV March 10, 2026 10:47
@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

@jvepsalainen-nv jvepsalainen-nv added the pr: non-breaking PRs without breaking changes label Mar 10, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 620fa2bc-db04-4014-9e9f-dbda44bce3e6

📥 Commits

Reviewing files that changed from the base of the PR and between 9ce8512 and 5f22413.

📒 Files selected for processing (2)
  • .github/workflows/compile-sascha-willems-shaders-nightly.yml
  • extras/compile-sascha-willems-shaders.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • extras/compile-sascha-willems-shaders.sh


jobs:
sascha-willems-shader-test:
runs-on: windows-2022
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it enough to run these in Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we run also RTX remix and Vulkan CTS on Windows only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do we need a GPU? If so, maybe use same pattern as Windows CI testing to use dynamically scaled VMs with pre-existing tooling to build. Would make debugging easier too because consistent env.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If needed we can also enable other OSes later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No GPU needed -- this workflow only compiles shaders to SPIR-V (slangc compiler-only), it does not execute them. A standard GitHub-hosted windows-2022 runner is sufficient.

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Build Slang
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cannot we use an existing build artifact, there are many available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated -- the workflow now downloads slangc from the latest successful merge queue CI run (slang-build-windows-x86_64-cl-release artifact) instead of building from source. This removes the MSVC setup and ~10 min build step.

Download slangc from the latest successful merge queue CI run
instead of building Slang from source. This removes the MSVC setup
and ~10 min build step, significantly speeding up the nightly workflow.
Copy link
Contributor

@jkiviluoto-nv jkiviluoto-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - let's merge and do a manual dispatch to see how it rides.

@jvepsalainen-nv jvepsalainen-nv added this pull request to the merge queue Mar 11, 2026
Merged via the queue into shader-slang:master with commit e4d533d Mar 11, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI CI pipeline and automation pr: non-breaking PRs without breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include Sascha Willems's shaders into our CI

3 participants