Repository navigation
Tags
Tags
Add tests for [Specialize] interface dynamic dispatch error: 52008 (s… …hader-slang#9930) ## Summary - Add two diagnostic tests that verify error 52008 is emitted when dynamic dispatch is required for `[Specialize]` interfaces - Tests are disabled pending the compiler fix in shader-slang#9929 ## Motivation The `[Specialize]` attribute marks interfaces for compile-time specialization only. Error 52008 (`dynamicDispatchOnSpecializeOnlyInterface`) is defined in `slang-diagnostic-defs.h` but never emitted -- the compiler silently generates dynamic dispatch code instead. These tests document the expected behavior so the fix for shader-slang#9929 can be validated. ## Technical Details Two patterns trigger dynamic dispatch through a `[Specialize]` interface: 1. **Factory returning existential** -- a function returns `IFoo` (interface-typed) and the caller invokes a method on it. The concrete type is unknown, requiring dynamic dispatch. 2. **Existential parameter** -- a function accepts `IFoo` as a parameter. When the concrete type is unknown at the call site, method dispatch cannot be specialized. Both tests use `filecheck` to verify error 52008 is reported at the correct source line. The existing positive test (`tests/bugs/specialize-existential-in-generic.slang`) confirms that `[Specialize]` interfaces work correctly when specialization succeeds. ## Test Added - `tests/language-feature/dynamic-dispatch/diagnose-specialize-only-interface.slang` (disabled) - `tests/language-feature/dynamic-dispatch/diagnose-specialize-only-interface-param.slang` (disabled)
neural slang: expose Layout as generic parameter (shader-slang#9915) Fixes shader-slang#9914 expose Layout as generic parameter in ILayer/FFLayer Fix bug where FFLayer hardcoded LinearLayout in eval() method, preventing use with WaveTangledVector and other memory layouts. Changes: - Add Layout : IStorageLayout as generic parameter to ILayer interface - Add Layout : IStorageLayout as generic parameter to FFLayer struct - Update linearTransform calls to use generic Layout instead of hardcoded LinearLayout - Update all existing FFLayer tests to include LinearLayout parameter - Add new test fflayer-wavetangled-vector-test.slang for WaveTangledVector
Don't rewrite entrypoint `in` to `borrow` during ir lowering. (shader… …-slang#9869) If the user compile a shader via `findAndCheckEntrypoint` API on a function that does not have a `[shader()]` attribute, we could be generating invalid spirv code. There is logic in lower-to-ir that silently changes the parameter passing convention of entrypoint in to borrow in, which is fundamentally conflicting with the compilation model. When we load a module, we compile every function down to IR. If we want to lower entrypoint differently, we must know some func is entrypoint during lower-to-ir of a module. But since this info is not provided at `loadModule` time, we fundamentally cannot do this kind of transform when lowering a module to IR. The right thing to do is to implement an IR pass that turns these in parameters into borrow in once we know a function is entrypoint. This PR deletes the special logic in lower-to-ir that does the problematic rewrite, and use a dedicated pass derived from the existing `transformParamsToConstRef` pass to do the rewrite after linking, where entrypoints are always specified. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Slang v2026.1.1 === Breaking changes === d480323 Enable back PR shader-slang#9230 for SER enabling which were reverted in shader-slang#9375 (shader-slang#9504) d310530 Retain switch/case fall-through structure (shader-slang#9411) === All changes for this release === 4923e88 Fix Optional none lowering for DifferentialPair (shader-slang#9562) f10d602 Use 64-bit stat on Windows for large files (shader-slang#9631) e21bc1b Fix temporarily unparented insts wrecking stuff in specializeFunctionCalls (shader-slang#9718) 812dc34 spv: assign default names to nameless struct members (shader-slang#9696) 237d05f Fixes for `reflection-parameter-block` example (shader-slang#9594) 5a296af Use CUDA 13.0.1 in Linux CI (shader-slang#9724) 7d9829a Fix RenderDoc F11 step-into failure for cross-module Slang functions (shader-slang#9650) 68c20f0 Add support for enums in reflection API (shader-slang#9615) ad4a20e Fix parameter pack bugs (shader-slang#9686) f468825 Update logic in `_replaceInstUsesWith` to ensure that insts that represent sets are always ordered correctly (shader-slang#9275) ac82d5c Guard system dependency aliases against existing targets (shader-slang#9720) 7e6105f Add support for casting DescriptorHandle <-> uint64_t on CUDA (shader-slang#9665) 0dfb54a Make firstbithigh, firstbitlow and reversebits work with a variety of integer sizes (shader-slang#9611) 013df68 Add a new example for running shaders on CPU via LLVM (shader-slang#9646) ff8d636 Remove unreachable IR after discard (shader-slang#9714) 777c038 Fix emission of SPIR-V DebugTypeMatrix matrix layout operand (shader-slang#9708) 9b4461c Fix MaterialX shader generation detection on Windows CI (shader-slang#9607) 94c09c5 Fix default->case fallthrough and add HLSL output tests (shader-slang#9677) b4046ee Fix#7070 Optimize OptiX ray payload access using direct register method (shader-slang#9284) efb3e5d Implement variadic rich diagnostics (shader-slang#9663) 4876270 Make UOI-NCSA license REUSE compatible (shader-slang#9642) 47e743d Re-enabled tests disabled due to the bug in SPIRV-Tools (shader-slang#9711) dee968d Rerun slangpy test sequentially (shader-slang#9706) e7fbdd4 Clone all submodules for repro-remix.sh (shader-slang#9712) d453988 Update Slack webhook for RTX remix (shader-slang#9701) c8ddf20 Update spirv-tools and spirv-headers to v2026.1.rc1 (shader-slang#9697) 3ad9f69 add __floatAsInt expression to support compile time bitcast operation (shader-slang#9687) 222bbdf Update SPIRV-Tools and SPIRV-Headers to latest versions (shader-slang#9617) 0bc91e3 Add comprehensive version logging to GPU test jobs (shader-slang#9689) 849a5d1 Misc CoopMat/lambda expr fixes. (shader-slang#9685) 144ff56 Enable SPIRV validation for slangpy CI tests (shader-slang#9645) bca7426 Enable sizeof/alignof for DescriptorHandle<T> with target-aware resol… (shader-slang#9671) 2611627 Fix coopvec test failures via glsl on Linux (shader-slang#9681) 7f02114 Update CI container to Vulkan SDK 1.4.321.1 to fix validation layer bug (shader-slang#9640) [BREAKING] d480323 Enable back PR shader-slang#9230 for SER enabling which were reverted in shader-slang#9375 (shader-slang#9504) 689b5fb Fix missing Aligned operand for PhysicalStorageBuffer stores (shader-slang#9644) 57640d5 Fix debug source file name emitting (shader-slang#9653) 84fee0b Enhance diagnostic description format to allow more terse descriptions (shader-slang#9662) 749a076 Fix crash in getSpecializedLinkageName due to implicit String construction (shader-slang#9633) 6534d83 Remove temporary cmake tar-ball during Copilot setup (shader-slang#9638) 9bfcb6a [LLM] Add LLM instruction for debugging slang issues with slangpy repro steps (shader-slang#9627) 569db87 Skip the URL document checking test of slangpy (shader-slang#9639) 5894ce5 Fix incorrect use of reinterpret_cast (shader-slang#9484) bc9e59f Fix u64 constant propagation (shader-slang#9441) 60518d6 Make min/max conform to IComparable interface (shader-slang#9593) 44c91c5 Fix SPIR-V emit crash for tess factors (shader-slang#9538) 7d1556c Fix issue with existentials in the presence of overloaded expressions. (shader-slang#9602) [BREAKING] d310530 Retain switch/case fall-through structure (shader-slang#9411) d80e15a Improve language reference manual for types (shader-slang#9560) bb40ae1 Implement different debug levels for spirv (shader-slang#9457) eff0c0e Fix crashes during parameter binding when entrypoint returns optional (shader-slang#9525) 4bf4c79 Fix preprocessor AtStartOfLine flag regression in macro (shader-slang#9573) d3938d2 Expose float default values in reflection (shader-slang#9582) a9d71b6 Fixed scoping for if-let variables (shader-slang#9561) b788541 Add script to reproduce RTX Remix shader compilation issues (shader-slang#9572) 55e7ed9 Fix lowering of nested optional types (shader-slang#9499) 380dfc5 Fix sizeof(DescriptorHandle<T>) returning 0 (shader-slang#9571) 8cac39f ci: Enable slangpy tests on Linux debug (shader-slang#9598) cc399ab Add MaterialX integration test workflow (shader-slang#9490) cfaccc6 Package static libraries for C++ WASM development (shader-slang#9556) 70db5bb Fix `ReadNone` func property propagation not checking all inst operands (shader-slang#9527) b000fc9 Don't emit OpCapability StorageImageMultisample for read-only multisampled textures (shader-slang#9587) 061b616 Add newline character after version output (shader-slang#9568) 16cf11f Fix corner case in `legalizeStructBlocks()` (shader-slang#9588) 32c05a7 Added reflection API support for stream output types (shader-slang#9579) 1b96be3 Add diagnostic for static function accessing non-static member via this (shader-slang#9586) f17cb47 Fix depth output mode being dropped when referencing shader parameters (shader-slang#9577) 26a818f Fix typo in BRDFParams variable declaration (shader-slang#9570) b1fc2d5 Fix crash when calling getEntrypointHash on a specialized entrypoint. (shader-slang#9566) 7be0f24 Fix SPIR-V invalid default init interface values (shader-slang#9522) 65afd68 Fix GLSL to HLSL/DXIL compilation by adding semantic decorations (shader-slang#6678) (shader-slang#9519) 0b7e934 Fix SPIR-V debug info source file references for #include and import (shader-slang#9520) 2685c7f Fix ambiguous overload resolution for CoopVec max() with integer argu… (shader-slang#9532) 5396035 remove temporary dev tests (shader-slang#9590) 081ad1c Update Linux GPU CI container to CUDA 12.5.1 (shader-slang#9524) 043899b Allow extern functions to not have a definition in Slang module (shader-slang#9492) 2764aab Add matrix-matrix, vector-matrix compound multiply-asignment operator for GLSL (shader-slang#9501)
Update spirv-tools and spirv-headers to v2026.1.rc1 (shader-slang#9697) ### Summary This PR updates the SPIRV-Tools and SPIRV-Headers submodules to version v2026.1.rc1 and re-enables the Aggressive Dead Code Elimination (ADCE) optimization pass that was previously disabled. ### Changes 1. **Update SPIRV-Tools and SPIRV-Headers** (ea0aed4) - Updated `external/spirv-tools` to v2026.1.rc1 - Updated `external/spirv-headers` to the corresponding version required by SPIRV-Tools - Regenerated all files in `external/spirv-tools-generated/` 2. **Re-enable ADCE Optimization Pass** (82d5c73) - Removed the workaround that conditionally disabled `CreateAggressiveDCEPass()` - The underlying issue in SPIRV-Tools (commit 1c26ea1c) that caused crashes in autodiff shaders has been fixed - ADCE is now unconditionally enabled for all optimization levels 3. **Add SPIRV Update Script** (1f761f9) - Added `extras/update-spirv-tools.sh` to automate future SPIRV-Tools updates - Script accepts an optional commit hash to pin to a specific version (defaults to `origin/main`) - Automatically updates SPIRV-Headers to match SPIRV-Tools' DEPS file - Generates a unique branch name based on the commit hash - Includes build and test instructions Fixes: shader-slang#9675 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Slang v2026.1 === Breaking changes === 0528cdf Refactor how pointer sizes work & make 32-bit pointers work (shader-slang#9493) === All changes for this release === e4215bc Allow passing LLVM downstream args to LLVMBuilder (shader-slang#9491) [BREAKING] 0528cdf Refactor how pointer sizes work & make 32-bit pointers work (shader-slang#9493) 186351f nix: dev-shell fixes (shader-slang#9437) 118a656 Work around hardcoded slangc path in slangpy tests (shader-slang#9563) b1da8b2 Remove CUDA installer when setting up Copilot (shader-slang#9557) 69795e3 Add X11 and Vulkan development libraries for Copilot (shader-slang#9554) 3766cb8 Fix CUDA permissions after installation for Copilot (shader-slang#9552) d7f9eb4 Add CUDA installation verification to Copilot setup (shader-slang#9550) 6774547 Export CUDA paths in each step for nvcc availability (shader-slang#9548) 1cb2ad7 Install CUDA 12.4.1 for Copilot (shader-slang#9546) 83b3959 Add CMake and build tools installation for larger runner (shader-slang#9544) c6dee40 Remove container from Copilot workflow (shader-slang#9542) e2d3070 Use GitHub larger runner for Copilot to avoid path issues (shader-slang#9540) c9c8cf6 Fix incorrect spelling for spirv target and profiles (shader-slang#9521) 18650ce Allow `findFieldIndexByName` to recognize fully qualified names. (shader-slang#9483) f450467 Fix potential null pointer dereference in enum type lowering (shader-slang#9518) 7350592 Improved diagnostics prototype (shader-slang#9503)
Slang v2025.24.3 97c5d06 Fix platform macros.. (shader-slang#9502) 09fe4ff Preprocessor bug (shader-slang#9495) 528ddf7 add matrix tranpose support on metal (shader-slang#9488) 671b391 Use the system-installed `slangc` compiler when building without dependencies (shader-slang#9480) 992ec72 Avoid infinite cycle when mangling struct defined inline at a parameter type location (shader-slang#9482) 7abf3a9 Activtely synthesize `AttributeDecl` for user defined attribute structs. (shader-slang#9481) 21296af Add `-report-dynamic-dispatch-sites` flag (shader-slang#9273) fe8bd58 move tests from bug directory to bugs (shader-slang#9463) 55d680e Preserve emtpy tuple elements in `createGLSLGlobalVaryings`. (shader-slang#9479) 794052b Fix mishandling of induction values in loop unrolling. (shader-slang#9476) 1027aa5 Reduce copying inside SourceFile::setContents; fix non-BOM UTF-16 offset and skip UTF-16 checks if file size is odd (shader-slang#9407) 2e66e60 Don't generate IR in `ComponentType::specialize` if spec arg is invalid. (shader-slang#9453) f1165f5 Fix Copilot path mapping - mount _work to work not _work (shader-slang#9473) 23424c8 Add /runner to /home/runner bind mount for Copilot compatibility (shader-slang#9470) 7ea1506 Emit a warning for a default-constructed interface variable and make it safer (shader-slang#9421) c969c4b Remove container specification from copilot-setup-steps (shader-slang#9468) 3fe13e7 Remove container specification from copilot-setup-steps (shader-slang#9466) 70df5d2 Fix scope of local variables from inlined functions (shader-slang#9418) 8312133 Fix incorrect use of reinterpret_cast and union (shader-slang#9458) 71a5fc1 Fix Git safe.directory configuration for container workflows (shader-slang#9461) 8968b4a Add packages:read permission for container image authentication (shader-slang#9464) 2db7bd6 Use Custom Linux CI container image (shader-slang#9460) 25c1c6e emit-spirv: handle IRVoidType in emitDebugTypeImpl (shader-slang#9414) d26153e Install curl before Copilot preparation step (shader-slang#9432) a9d10b8 Revert "Add workspace mounts to container options for Copilot compati… (shader-slang#9426) 262c3a6 Add workspace mounts to container options for Copilot compatibility (shader-slang#9424) dd4ba6e Skip slangpy-samples tests on macOS debug builds (shader-slang#9408) db9dd16 Configure Copilot Coding Agent for ARC self-hosted GPU runner (shader-slang#9415)
Slang v2025.24.2 === Breaking changes === No breaking changes === All changes for this release === ca70f00 Enable slangpy tests for Linux (shader-slang#9378) d116d48 LLVM IR target (shader-slang#8960) 5d775e2 Support for CUDA 13.0 paths (shader-slang#9239) 40ae503 Add missing DebugLines in two cases (shader-slang#9371) d00f869 Fix remaining UBSan errors reported during CPU-only Linux testing (shader-slang#9394) a19633e Enable slangpy and slang-rhi tests on macOS debug builds (shader-slang#9387) 0782413 Fix the usage of the SLANG_APPLE_FAMILY macro (shader-slang#9376) 6ca87a4 Fix UBSan errors: unaligned loads/stores in bytecode VM (shader-slang#9289) b6a575f Fix tests using `SLANG_CHECK` instead of `SLANG_CHECK_ABORT` (shader-slang#9358) 4a7e78f Fix negations of `INT64_MIN` when handling integer literals (shader-slang#9330) 8edde00 Add "release-asserts-only" option to SLANG_ASSERT environment variable (shader-slang#9363) 1150d2b Fix UBSan errors: RIFF unalignment (shader-slang#9254) 9122a7c Fix UBSan errors in `slang-memory-arena.h` (shader-slang#9286) d54ea11 ci: Use tags for slangpy-samples (shader-slang#9329) f8b0b93 Fix OptiX include path search on Linux (shader-slang#9391) 1d0111f Don't create a dependency on `slangc` when `SLANG_ENABLE_SLANGC` is disabled (shader-slang#9366) e1763e9 Add more Slang support for Shader subgroups (shader-slang#9319) 53eb858 Generate diagnostic structs from lua definitions for diagnostic prototype (shader-slang#9380) 706bc9d Fix coverage nightly workflow: Add retention policy integration (shader-slang#9392) 9ab7718 Enable Slack notifications for RTX Remix nightly CI (shader-slang#9377) a2ba47a Fix UBSan errors: member calls on null pointers (shader-slang#9355) 6955616 Emit SPIR-V OpTypeMatrix for uniform and storage buffers (shader-slang#9341) 0ea0914 Get target-specific layout for DescriptorHandle<T>, refactor Type-kind mapping in layout creation (shader-slang#8383) 6514add Fix various issues in `slang-glslang` (shader-slang#9305) 984e27e Remove unused byte encoding functions (shader-slang#9332) c28150e Fix incorrect use of `UIntSet::clear()` and rename it to `UIntSet::unsetAll()` (shader-slang#9292) 95f38ac Remove unused MD5 implementation (shader-slang#9333) 1717891 Fix Clang warning introduced by PR shader-slang#7968 (shader-slang#9311) e9e9817 Fix UBSan errors: invalid value for type `SlangLanguageVersion` (shader-slang#9288) dbfbe1a Remove OpenGL from targets in README (shader-slang#9337) fa75c84 Introduce lua description file for new diagnostics format (shader-slang#9379)
Fix fd leak (shader-slang#9362) Make sure we don't leak file descriptors when done with pipes. Addresses an issue seen while running slang-rhi-test for shader-slang#9335.
Diagnose if extension declares new interface requirements (shader-sla… …ng#9276) ## Summary This PR adds a diagnostic for missing symbol definitions during the IR linking phase. When `cloneGlobalValueWithLinkage` selects the "best value" for a symbol, it now validates that the value is actually usable—meaning it must either: - Have a function body (a concrete definition) - Be marked as a target intrinsic (via appropriate decoration) - Be marked as an imported symbol (e.g., `DLLImport` decoration) - Have SPIRV instruction or autodiff decorations If none of these conditions are met, the compiler now emits a linker error indicating the symbol lacks a definition, along with note diagnostics listing all candidate values that were considered. ## Background Previously, declaring a method signature in an extension without providing a body would silently proceed through compilation until hitting an internal error during code emission ("unexpected IR opcode"). This made it difficult to diagnose issues where users accidentally declared interface-like requirements in extensions—something that isn't semantically valid since extensions cannot add new requirements to existing types. ## Changes - **`source/slang/slang-ir-link.cpp`**: Added validation in `cloneGlobalValueWithLinkage` to check that the selected best value has a valid definition. Added helper function `isFunctionDefinedOrImported` to perform the check. Emits a clear diagnostic when a symbol is referenced but has no definition. - **`tests/diagnostics/extension-interface-requirement.slang`**: Added test case covering the scenario where an extension declares a method without a body. Closes shader-slang#9198
PreviousNext