<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2025-10-17T01:22:39+00:00</updated>
<entry>
<title>Fix infinite loop in SPIRVLegalizationContext::processWorkList (#8712)</title>
<updated>2025-10-17T01:22:39+00:00</updated>
<author>
<name>davli-nv</name>
<email>davli@nvidia.com</email>
</author>
<published>2025-10-17T01:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ff064b9a0f1316007f46710432f854777a520fdf'/>
<id>urn:sha1:ff064b9a0f1316007f46710432f854777a520fdf</id>
<content type='text'>
When slangc is invoked with -g, a source shader that has static infinite
loop can generate IR that have branch to a block that contains a branch
to the first block that contains the first branch, resulting in infinite
loop.

Change SPIRVLegalizationContext::processWorkList to only add branch
target to work list via its parent, this avoids the infinite loop above.

Also change addToWorkList to stop addUsersToWorkList, users should be
added explicitly by logic for specific insts.

Add regression test as tests/spirv/infinite-loop.slang

Fixes #8669</content>
</entry>
<entry>
<title>Inline global constants for shader style CPU targets (#8686)</title>
<updated>2025-10-16T18:53:10+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-10-16T18:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=537697d3aa21b418c348b1017005603668b6a4cb'/>
<id>urn:sha1:537697d3aa21b418c348b1017005603668b6a4cb</id>
<content type='text'>
On the shader-host-callable target, test `gh-4874.slang` generates IR
that contains global constants referencing global params. These need to
get inlined into functions, as otherwise
`introduceExplicitGlobalContext()` will fail with "no outer func at use
site for global", making the test crash the compiler.</content>
</entry>
<entry>
<title>Fix wrong diagnostic when checking identical casting expr. (#8727)</title>
<updated>2025-10-16T18:52:38+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-16T18:52:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0257cb001b6f5c31e4ac0435d546fe638a17c48a'/>
<id>urn:sha1:0257cb001b6f5c31e4ac0435d546fe638a17c48a</id>
<content type='text'>
`SemanticsVisitor::CheckInvokeExprWithCheckedOperands` made several
references to `expr` parameter in its `inout` parameter l-value-ness
validation logic to access arguments, which is wrong because `expr` is
not necessarily the same as `result`/`invoke` (the result of calling
`ResolveInvoke()` in the first line of the function. Changing it to
`invoke` for consistency.

Also add a special case logic to return early in case the resolved
invoke expr is `argument[0]` when the original invoke expr is
`T(funcThatReturnsT())`.

Closes #8659.</content>
</entry>
<entry>
<title>Fix use of variadic generics with [Differentiable]. (#8736)</title>
<updated>2025-10-16T18:23:13+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-16T18:23:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bedc3421c9e1e0837fa69e30396a27a60f0fee53'/>
<id>urn:sha1:bedc3421c9e1e0837fa69e30396a27a60f0fee53</id>
<content type='text'>
There was a bug that causes the compiler failing to treat a `no_diff
TypePack` as a type pack, and thus diagnose an error when resolving the
following call.

The fix is to unwrap any ModifiedType wrappers in `IsTypePack()` check.</content>
</entry>
<entry>
<title>Fix WGSL bitshift test typo (#8720)</title>
<updated>2025-10-16T10:42:57+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-10-16T10:42:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7e35123bae1cd3b032fdffcafd600aa78394bf2d'/>
<id>urn:sha1:7e35123bae1cd3b032fdffcafd600aa78394bf2d</id>
<content type='text'>
Random drive-by test fix, this was reading past the end of the buffer
but usually succeeded because the expected result is 0.</content>
</entry>
<entry>
<title>Immutable access qualifier for pointers and use `__ldg` on cuda. (#8710)</title>
<updated>2025-10-16T03:59:47+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-16T03:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=01510f2c922af8629c7a730ef92a31fa83bd9f49'/>
<id>urn:sha1:01510f2c922af8629c7a730ef92a31fa83bd9f49</id>
<content type='text'>
This PR implements `Access.Immutable` to allow pointers to immutable
data.

The new type `ImmutablePtr&lt;T&gt;` is defined as an alias of `Ptr&lt;T,
Address.Immutable&gt;`.
By forming a immutable pointer, the programmer is conveying to the
compiler that the data at the pointer address will never change during
the execution of the current program. Therefore loads from immutable
pointers can be deduplicated by the compiler, and will translate to
`__ldg` when generating code for CUDA.

The SPIRV backend is not changed in this PR, since the current SPIRV
spec makes it very difficult to specify loads from immutable address
without generating tons of wrappers and boilerplate type declarations.
We would like to see the spec evolved a bit to around its support of
`NonWritable` physical storage pointers or immutable loads before we
attempt to express such immutability in SPIRV. For now we simply emit
ordinary pointers and loads when generating spirv.

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Fix segfault on arrays of structs containing parameter blocks (#8555)</title>
<updated>2025-10-13T14:14:45+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2025-10-13T14:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=96df31a9fa53e3d897a2b7c4eef021f37f421c91'/>
<id>urn:sha1:96df31a9fa53e3d897a2b7c4eef021f37f421c91</id>
<content type='text'>
Closes https://github.com/shader-slang/slang/issues/8154 However there
is further design work to do on implementing the "NonAddressableType"
suggestion</content>
</entry>
<entry>
<title>Add diagnostic for cyclic #include. (#8679)</title>
<updated>2025-10-11T00:31:01+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-11T00:31:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=fb34bafd37e3509d51686ee2a5392d2d8e29d7c5'/>
<id>urn:sha1:fb34bafd37e3509d51686ee2a5392d2d8e29d7c5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Allow entry points with missing numthreads on CPU targets (#8678)</title>
<updated>2025-10-10T23:01:51+00:00</updated>
<author>
<name>Julius Ikkala</name>
<email>julius.ikkala@gmail.com</email>
</author>
<published>2025-10-10T23:01:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c99addbf2e8a0210b97dad2827045dad95765d08'/>
<id>urn:sha1:c99addbf2e8a0210b97dad2827045dad95765d08</id>
<content type='text'>
Several tests have compute entry points without a `[numthreads(x,y,z)]`
decoration. Currently, none of these tests run on the CPU target, as
they crash the compiler. I took a look at the SPIR-V emitter, which
falls back to a workgroup size of (1,1,1):


https://github.com/shader-slang/slang/blob/1e0908bd7107dfbdac912b693c3ab9bd6e1dc8b3/source/slang/slang-ir-spirv-legalize.cpp#L1635-L1643

To match this behaviour, this PR implements a fallback solution that
makes `emitCalcGroupExtents()` emit (1,1,1).

This PR is both a question and a suggestion; I'm not sure the approach
here is at all reasonable. Personally, I'd just like to explicitly add
`[numthreads(1,1,1)]` to all such tests, but I don't know if it's
actually legal and supported to not have a `numthreads`. So the
implementation here is a bit conservative.

I ran across these when I went through tests for the upcoming LLVM
target. These were the final blockers to get all autodiff and
language-features tests passing (not counting the ones using things like
wave intrinsics and barriers etc.)</content>
</entry>
<entry>
<title>Fix `specializeRTTIObject` to use non-zero RTTI value to work with `Optional&lt;T&gt;`. (#8677)</title>
<updated>2025-10-10T21:34:56+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-10T21:34:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=462ea4e66569efa978e4057ea2d041c69d4a729b'/>
<id>urn:sha1:462ea4e66569efa978e4057ea2d041c69d4a729b</id>
<content type='text'>
Closes #8673.

The issue is that we use the RTTI field of an existential to check if it
is null. We have the logic to help the user to fill in a non-zero value
for the RTTI field when such an object is filled from the host. However,
when there is slang code creating an existential value, we still have
old logic in the compiler that just fills in 0 for the RTTI field,
causing an `Optional&lt;IFoo&gt;.hasValue` to always return false in such
cases.</content>
</entry>
</feed>
