Repository navigation
Conversation
The hierarchical update-time scan only followed #include lines, so an entry point compiled with Slang was not rebuilt when a module it imports changed. Projects worked around it with "#if 0 / #include "Module.slang" / #endif" blocks in the entry-point files. For Slang sources (--slang, or .slang/.slangh files) the scan now also follows "import Foo;", "__exported import Foo;", "import Foo.Bar;" (Foo/Bar.slang), "import \"Foo.slang\";" and "__include Foo;", resolved like #include: relative to the including file, then through the -I directories, recursively. A module that is not a file on those paths is provided by the compiler itself (or fails there with a proper diagnostic), so it is skipped with a note in --verbose mode instead of the hard error #include gets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The hierarchical update-time scan only follows
#includelines. An entry point compiled with Slang is therefore not rebuilt when a module itimports changes, and projects end up working around it with blocks likein their entry-point files.
Change
For Slang sources (
--slang, or.slang/.slanghfiles) the scan also followsimport Foo;and__exported import Foo;import Foo.Bar;(resolved asFoo/Bar.slang)import "Foo.slang";__include Foo;/__include "Foo.slang";resolved like
#include: relative to the including file, then through the-Idirectories, recursively. A module that is not a file on those paths is provided by the compiler itself (or fails there with a proper diagnostic), so it is skipped, with a note in--verbosemode, instead of the hard error#includegets. Non-Slang sources are unaffected; the Metal toolchain-header exception still applies to#includeonly.Testing
Linux, Slang 2026.20, SPIR-V, in the RTX Neural Shading SDK (entry points importing module chains three levels deep):
importinside a#ifand through an imported module that itself imports the touched one#if 0 #includeworkarounds could be removed from the SDK shaders🤖 Generated with Claude Code