<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools, 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-15T00:07:03+00:00</updated>
<entry>
<title>Retry file reads in slang-test to handle intermittent I/O errors (#8713)</title>
<updated>2025-10-15T00:07:03+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2025-10-15T00:07:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=05cae938cbe1ac8807f4913044d9bee46dc3a0e1'/>
<id>urn:sha1:05cae938cbe1ac8807f4913044d9bee46dc3a0e1</id>
<content type='text'>
Related #8705</content>
</entry>
<entry>
<title>Support tests outside tests directory (#7791) (#8666)</title>
<updated>2025-10-13T10:50:32+00:00</updated>
<author>
<name>Janne Kiviluoto (NVIDIA)</name>
<email>235827468+jkiviluoto-nv@users.noreply.github.com</email>
</author>
<published>2025-10-13T10:50:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f5a3a6dc6a98d22964154f809f9e0dcae30ab67f'/>
<id>urn:sha1:f5a3a6dc6a98d22964154f809f9e0dcae30ab67f</id>
<content type='text'>
As running slang-test in slang root is implicitly assumed (and mentioned
in CONTRIBUTING.md), no detailed path checks are done.</content>
</entry>
<entry>
<title>Add deterministic shuffling of tests in directory (#8622)</title>
<updated>2025-10-08T17:13:47+00:00</updated>
<author>
<name>Janne Kiviluoto (NVIDIA)</name>
<email>235827468+jkiviluoto-nv@users.noreply.github.com</email>
</author>
<published>2025-10-08T17:13:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e4d1200cb45260b2a114d6f4f8f8d0b389a7da56'/>
<id>urn:sha1:e4d1200cb45260b2a114d6f4f8f8d0b389a7da56</id>
<content type='text'>
Fixes #8621

Add command line options for enable shuffling as well as providing a
custom seed. Use Mersenne-Twister engine for a deterministic shuffle.</content>
</entry>
<entry>
<title>Use symbol alias instead of wrapper synthesis to implement link-time types. (#8603)</title>
<updated>2025-10-07T00:21:37+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-10-07T00:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6af3381f47e3c22e1657c0e0064fa466e8bde0f6'/>
<id>urn:sha1:6af3381f47e3c22e1657c0e0064fa466e8bde0f6</id>
<content type='text'>
This change achieves link-time type resolution with a different
mechanism.

For `extern struct Foo : IFoo = FooImpl;`,
instead of synthesizing a wrapper type `Foo` that has a `FooImpl inner`
field and dispatches all interface method calls to `inner.method()`,
this PR completely removes this synthesis step, and instead just lower
such `extern`/`export` types as `IRSymbolAlias` instructions that is
just a reference to the type being wrapped.

Then we extend the linker logic to clone the referenced symbol instead
of the SymbolAlias insts itself during linking.

By doing so, we greatly simply the logic need to support link-time
types, and achieves higher robustness by not having to deal with many
AST synthesis scenarios.

Closes #8554.

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Add check for NVRTC backend in unit test cudaCodeGenBug (#8611)</title>
<updated>2025-10-06T20:55:39+00:00</updated>
<author>
<name>Sami Kiminki (NVIDIA)</name>
<email>235843927+skiminki-nv@users.noreply.github.com</email>
</author>
<published>2025-10-06T20:55:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f4449d9376f0a5c32274fd812d135f3595159bae'/>
<id>urn:sha1:f4449d9376f0a5c32274fd812d135f3595159bae</id>
<content type='text'>
Test `slang-unit-test-tool/cudaCodeGenBug.internal` requires that the
CUDA toolkit is available. Add a check for the NVRTC backend to avoid a
failure when this is not the case.

Fixes #6636</content>
</entry>
<entry>
<title>Rewriting the lower-buffer-element-type pass to avoid unnecessary packing/unpacking. (#8526)</title>
<updated>2025-09-30T00:45:08+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-09-30T00:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a6deb5ed82cb8fc6b4f4c5c5fee264e09f97ff89'/>
<id>urn:sha1:a6deb5ed82cb8fc6b4f4c5c5fee264e09f97ff89</id>
<content type='text'>
Part of the effort to improve the performance of generated SPIRV code.

The existing lower-buffer-element-type pass works by loading the entire
buffer element content from memory, and translate it to logical type
stored in a local variable at the earliest reference of a buffer handle.
This means that is can generate inefficient code that reads more than
necessary.

Consider this example:
```
struct BigStruct { bool values[1024]; }
ConstantBuffer&lt;BigStruct&gt; cb;

void test(BigStruct v)
{
      if (v.values[0]) { printf("ok"); }
}

[numthreads(1,1,1)]
void computeMain()
{
    test(cb);
}
```

In IR, the `computeMain` function before lower-buffer-element-type pass
is something like following:
```
func test:
   %v = param : BigStruct
   %barr = fieldExtract(%v, "values")
   %element = elementExtract(%barr, 0)
    ... // uses %element 

func computeMain:
  %v = load(cb)
  call %test %v
```

The existing lower-buffer-element-type pass will rewrite the bool array
in `BigStruct` into `int` array so it is legal in SPIRV. However, it
does so by inserting the translation on the first `load` of the constant
buffer:

```
struct BigStruct_std430 {
    int values[1024];
}
var cb : ConstantBuffer&lt;BigStruct_std430&gt;;
func computeMain:
   %tmpVar : var&lt;BigStruct&gt;
    call %unpackStorage(%tmpVar, cb)
   %v : BigStruct = load %tmpVar
   call %test %v
```

This means that the entire array will be loaded and translated to int,
before calling `test`, which only uses one element. It turns out that
the downstream compiler isn't always able to optimize out this
inefficient translation/copy.

This PR completely rewrites the way buffer-element-type lowering is
handled to avoid producing this inefficient code. It works in two parts:
first we turn on the `transformParamsToConstRef` pass for SPIRV target
as well, so we will translate the `test` function to take the `v`
parameter as `constref`. The second part is a redesigned
buffer-element-type pass that defers the storage-type to logical-type
translation until a value is actually used by a `load` instruction.

In this example, after `transformParamsToConstRef`, the IR is:

```
func test:
   %v = param : ConstRef&lt;BigStruct&gt;
   %barr = fieldAddr(%v, "values")
   %elementPtr = elementAddr(%barr, 0)
   %element = load(%elementPtr)
    ... // uses %element 

func computeMain:
  call %test %cb
```

The new `buffer-element-type-lowering` pass will take this IR, and
insert translation at latest possible time across the entire call graph,
and translate the IR into:

```
func test:
   %v = param : ConstRef&lt;BigStruct_std430&gt;
   %barr = fieldAddr(%v, "values")
   %elementPtr : ptr&lt;int&gt; = elementAddr(%barr, 0)
   %element_int = load(%elementPtr)
    %element = cast(%element_int) : %bool
    ... // uses %element 

func computeMain:
  call %test %cb
```

In this new IR, there is no longer a load and conversion of the entire
array.

See new comment in `slang-ir-lower-buffer-element-type.cpp` for more
details of how the pass works.

This PR also address many other issues surfaced by turning on
`transformParamsToConstRef` pass on SPIRV backend.

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Adding slang-test option to ignore abort popup message (#8492)</title>
<updated>2025-09-24T06:46:31+00:00</updated>
<author>
<name>Jay Kwak</name>
<email>82421531+jkwak-work@users.noreply.github.com</email>
</author>
<published>2025-09-24T06:46:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=979e16a34ef9ff2806476b809e2dcba5a96c40d4'/>
<id>urn:sha1:979e16a34ef9ff2806476b809e2dcba5a96c40d4</id>
<content type='text'>
With the recent Windows runtime libraries, a new popup window started
appearing when `abort()` is called. This was observed when VVL prints a
message as a part of WGPU test.

Although it can be helpful when we want to debug it, it breaks the
behavior of CI scripts when the tests are expected to continue even when
they fail. When the test fail, CI script stops in the middle and wait
for a user to click on a button on the dialog window, which cannot
happen. As a result, when there is a VVL error message, CI run stops in
the middle and the testing stops prematurely.

This commit adds a new command-line argument, `-ignore-abort-msg`, that
ignores the abort message and it wouldn't show the dialog popup window.

From the implementation perspective, there are three places that are
related.
- slang-test itself should turn off the flag.
- render-test should turn off the flag after getting the argument from
slang-test
- test-server should turn off the flag after getting the argument from
slang-test

When test-server runs render-test, the arguments are already handled by
slang-test, so test-server needs to just pass through the arguments.</content>
</entry>
<entry>
<title>Add RHI Device Caching and Test Prefix Exclusion (#8448)</title>
<updated>2025-09-22T22:46:42+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-09-22T22:46:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ba8132345cbae5b749b4a01deda732ad6f8251a0'/>
<id>urn:sha1:ba8132345cbae5b749b4a01deda732ad6f8251a0</id>
<content type='text'>
# Add RHI Device Caching and Test Prefix Exclusion

## Summary

This PR introduces two key improvements to the Slang test
infrastructure:

1. **RHI Device Caching**: Implements device caching to significantly
speed up test execution by reusing graphics devices across tests, **RHI
Device Caching reduces slang-test execution time from ~15 minutes to ~5
minutes in Windows release builds**
2. **Test Prefix Exclusion**: Adds `-exclude-prefix` option to skip
tests matching specified path prefixes

## Changes

### RHI Device Caching
- **New `DeviceCache` class** (`slang-test-device-cache.h/cpp`):
Thread-safe device cache with LRU eviction (max 10 devices)
- **Cache control option**: `-cache-rhi-device` flag in both
`slang-test` and `render-test`
- Default: **enabled** in slang-test, **disabled** in render-test when
run standalone
  - Automatically skips caching for CUDA devices (due to driver issues)
- **Performance benefit**: Eliminates expensive device
creation/destruction cycles, especially beneficial for Vulkan on Tegra
platforms

### Test Prefix Exclusion
- **New `-exclude-prefix &lt;prefix&gt;` option** in slang-test
- Allows excluding entire test directories or patterns from execution
- Complements existing `-category` and individual test filtering options

### Usage Examples
```bash
# Enable device caching (default)
slang-test

# Disable device caching
slang-test -cache-rhi-device false

# Exclude tests from specific directories
slang-test -exclude-prefix tests/problematic/
slang-test -exclude-prefix tests/slow/ -exclude-prefix tests/experimental/
```

This change should significantly improve test execution performance,
particularly in CI environments with frequent device operations. This is
needed for running the GPU test in aarch64, where repeated device
creation/destroy is causing driver issues.

Needed by: https://github.com/shader-slang/slang/issues/8346

---------

Co-authored-by: slangbot &lt;ellieh+slangbot@nvidia.com&gt;
Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Fix crash when compiling specialized generic entrypoint containing a static const decl. (#8392)</title>
<updated>2025-09-10T18:50:30+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-09-10T18:50:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c5607e9d68e9082ada9441f1949937f6b16d5c7f'/>
<id>urn:sha1:c5607e9d68e9082ada9441f1949937f6b16d5c7f</id>
<content type='text'>
Closes #8184.

We fixed three issues with this regression test:
1. After generating IR for a `SpecializeComponentType`, we should also
strip the frontend
decorations from the IR so there is no HighLevelDeclDecoration that will
go into the backend.
2. When lowering a static const inside a generic function, we should not
give the static const
a linkage, because it won't such constant will not appear in global
scope. Trying to give it a
linkage decoration will lead to the parent generic (for the function) to
have two duplicate
Export/Import decorations with different mangle names, and confuses the
linker.
3. Make sure internal exceptions does not leak through
    `IComponentType::getEntryPointCode`/`getTargetCode`.</content>
</entry>
<entry>
<title>Use wide char version of Windows API (#8390)</title>
<updated>2025-09-08T17:24:05+00:00</updated>
<author>
<name>Gangzheng Tong</name>
<email>tonggangzheng@gmail.com</email>
</author>
<published>2025-09-08T17:24:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=3aff764c2b5d613f766538d27e0b9f448e7ed5ca'/>
<id>urn:sha1:3aff764c2b5d613f766538d27e0b9f448e7ed5ca</id>
<content type='text'>
This PR modernizes the Windows-specific code by replacing ANSI Windows
API functions with their Unicode (wide character) counterparts. This
change ensures proper handling of Unicode file paths and strings on
Windows systems.

### File Operations (`source/core/slang-io.cpp`)
- `DeleteFileA` → `DeleteFileW`
- `GetTempPathA` → `GetTempPathW` 
- `GetTempFileNameA` → `GetTempFileNameW`
- `RemoveDirectoryA` → `RemoveDirectoryW`
- `SHFileOperationA` → `SHFileOperationW`
- `GetModuleFileNameA` → `GetModuleFileNameW` with UTF-8 conversion

### Platform Operations (`source/core/slang-platform.cpp`)
- `GetModuleHandleExA` → `GetModuleHandleExW`
- `LoadLibraryExA` → `LoadLibraryExW`
- `LoadLibraryA` → `LoadLibraryW`
- `OutputDebugStringA` → `OutputDebugStringW`

### Runtime and Tools
- `MessageBoxA` → `MessageBoxW` in slang-rt
- `GetCurrentDirectoryA` → `GetCurrentDirectoryW` in slang-fiddle
- String literal conversion to wide strings in vk-pipeline-create

---------

Co-authored-by: github-actions[bot] &lt;41898282+github-actions[bot]@users.noreply.github.com&gt;
Co-authored-by: Gangzheng Tong &lt;gtong-nv@users.noreply.github.com&gt;
Co-authored-by: slangbot &lt;ellieh+slangbot@nvidia.com&gt;
Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
</feed>
