Skip to content

Conversation

@jvepsalainen-nv
Copy link
Contributor

Adds a nightly CI workflow to compile RTX Remix (dxvk-remix) shaders as a validation test for Slang compiler changes. This addresses issue #8655 by testing against a real-world, complex shader codebase (195 shader variants with raytracing, path tracing, and advanced material systems).

Implementation

Core Workflow

  1. Build Slang from source using the same approach as main CI:

    • Uses cmake --preset default with Ninja Multi-Config generator
    • Builds with cmake --workflow --preset release
    • LLVM disabled (not needed for shader compilation)
    • Takes ~24 minutes on GitHub-hosted runners
  2. Compile RTX Remix shaders using built Slang:

    • Adds built Slang to PATH before running build_shaders_only.ps1
    • This ensures dxvk-remix uses the current Slang code being tested
    • Not the pre-built version from packman
    • Takes ~3-4 minutes for shader compilation
  3. Verify results:

    • Checks that at least 100 shader files were generated
    • Verifies both .h headers and .spv SPIR-V binaries
    • Reports total compilation time and output size

When It Runs

  • Daily at 3 AM UTC (after coverage runs complete)
  • Manually triggerable via workflow_dispatch for testing
  • Non-blocking: Informational only, doesn't block PRs
  • Total runtime: ~30 minutes (24 min Slang build + 4 min shaders + overhead)

Optimizations

  • Caches Slang build artifacts - speeds up reruns if source unchanged
  • Caches Packman packages - reduces download time from 2-5 min to ~30 sec
  • Shallow clones for both repos to minimize checkout time

Error Handling

  • Explicit error checking after shader build script
  • Upload build logs on failure for debugging
  • Clear error messages with exit codes
  • Verification step catches incomplete builds

Testing

Successfully tested in multiple workflow runs:

Fixes #8655

Implements #8655 - adds nightly CI workflow to validate Slang
compiler changes against RTX Remix shaders.

1. Builds Slang from source (~24 min)
2. Compiles RTX Remix shaders using built Slang (~4 min)
3. Verifies 195 shader variants compile successfully
4. Runs nightly at 3 AM UTC, manually triggerable

- Uses Slang from checked-out source (not packman pre-built)
- Matches main CI build approach for reliability
- Caches Slang build and packman packages for speed
- Explicit error handling with clear messages
- Uploads logs on failure for debugging

Successfully compiles all 195 RTX Remix shader variants, catching
potential regressions in real-world production shader code.

Fixes #8655
Changes to address review comments:

1. Convert workflow from PowerShell to bash for consistency
   - Add Git bash to PATH on Windows
   - Replace all PowerShell commands with bash equivalents
   - Improves consistency with main CI

2. Replace issue creation with Slack notifications
   - Add Slack notification on failure (scheduled runs only)
   - Matches pattern used by vk-gl-cts-nightly workflow

3. Reduce log retention to minimize disk usage
   - Change retention-days from 7 to 2 days
   - Logs only uploaded on failure, small size (~100KB-1MB)
- Set bash as default shell for entire job (remove redundant declarations)
- Invoke PowerShell script correctly: powershell.exe -File script.ps1
- Fix whitespace handling in wc output (xargs trim)
- Add error handling for du command and numeric comparisons
Remove usr\bin from PATH to prevent GNU link.exe from conflicting
with MSVC link.exe. Bash.exe still works and has access to needed
tools through its internal environment.

Fixes Meson error: "Found GNU link.exe instead of MSVC link.exe"
Run shader build step with 'shell: pwsh' instead of invoking
PowerShell from bash. This prevents PowerShell from inheriting
bash's PATH with GNU link.exe that conflicts with MSVC.
Fixes two issues from CI run #27:

1. Fix Slang version detection (was showing timestamp instead of version)
   - Changed from shallow clone to full clone with tags
   - CMake needs tags to generate proper version via git-describe
   - Added validation to detect invalid timestamp-only versions

2. Fix error propagation from PowerShell script
   - Added explicit $LASTEXITCODE check after build_shaders_only.ps1
   - PowerShell scripts don't auto-propagate errors
   - Now throws immediately if shader build fails
The -zero-initialize option was listed in deprecatedOpts but lacked a
handler in the option processing switch statement, causing it to be
rejected as "unknown command-line option". This breaks compatibility
with external projects like RTX Remix that still use this flag.

Added a simple handler that sets the option flag for compatibility.
The option remains in the deprecated list as it has no functional
effect (zero-initialization is now enabled by default).
- Replace slang.dll with slang-compiler.dll in required files check
  (slang.dll is deprecated)
- Add verification step to list all copied Slang files
- Disable unnecessary CMake components (examples, replayer, slangd,
  slangrt, tests) to speed up build
- Keeping only what's needed for shader compilation
  (slangc + slang-glslang)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Additional codebase for CI testing

2 participants