<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/compute/spirv-array-texel-pointer-atomic.slang, 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-08-25T05:20:41+00:00</updated>
<entry>
<title>Fix#8084: Batch-8: Enable cuda tests (#8268)</title>
<updated>2025-08-25T05:20:41+00:00</updated>
<author>
<name>Harsh Aggarwal (NVIDIA)</name>
<email>haaggarwal@nvidia.com</email>
</author>
<published>2025-08-25T05:20:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1562f98c07954ae17f9e7ef186f6c8eb029740ab'/>
<id>urn:sha1:1562f98c07954ae17f9e7ef186f6c8eb029740ab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add warning for comma operators used outside for-loops and expand expressions in legacy mode (#7984)</title>
<updated>2025-08-07T08:01:02+00:00</updated>
<author>
<name>Copilot</name>
<email>198982749+Copilot@users.noreply.github.com</email>
</author>
<published>2025-08-07T08:01:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9ed7b5264676547855e1378d2b9c9d51c8ba7162'/>
<id>urn:sha1:9ed7b5264676547855e1378d2b9c9d51c8ba7162</id>
<content type='text'>
This PR implements a warning system to help users identify potentially
unintended comma operator usage in expressions. The comma operator can
be confusing when used in contexts like variable initialization where
users might have intended to use braces for initialization instead.

## Problem

The following code compiles without error but is likely not written as
intended:

```slang
float4 vColor = (0.f, 0.f, 0.f, 1.f);  // Uses comma operators, evaluates to 1.f
```

The intended code should use braces:

```slang
float4 vColor = {0.f, 0.f, 0.f, 1.f};  // Proper initialization
```

## Solution

Added a new warning diagnostic (`commaOperatorUsedInExpression`, ID:
41024) that warns when comma operators are used in expressions, with
exemptions for contexts where they are commonly intended:

- **For-loop side effects**: `for (int i = 0; i &lt; 10; i++, x++)` - no
warning
- **Expand expressions**: `expand(f(), g(each param))` - no warning  
- **Slang 2026+ mode**: `let m = (1,2,3)` creates tuples - no warning
- **All other expressions**: `float4 v = (a, b, c, d)` and `return a, b`
- warns for each comma

## Implementation Details

- Added context tracking in `SemanticsContext` with
`m_inForLoopSideEffect` flag
- Modified `visitForStmt` to use special context when checking side
effect expressions
- Added comma operator detection in `visitInvokeExpr` for `InfixExpr`
nodes
- Added language version check using `isSlang2026OrLater()` to disable
warnings in Slang 2026+ mode where parentheses create tuples
- Performance optimization: language version check is hoisted to avoid
unnecessary casting
- Warning can be suppressed using `-Wno-41024` command line flag

## Test Coverage

Added comprehensive test cases using filecheck format that verify:
- Warnings are generated for comma operators in variable initialization
(legacy mode only)
- Warnings are generated for comma operators in return statements
(legacy mode only)
- Warnings are generated for comma operators in general expressions
(legacy mode only)
- No warnings for comma operators in for-loop side effects
- No warnings in Slang 2026+ mode where parentheses create tuples
- Warning suppression works correctly

Example output (legacy mode):
```
warning 41024: comma operator used in expression (may be unintended)
    float4 vColor = (0.f, 0.f, 0.f, 1.f);
                        ^
warning 41024: comma operator used in expression (may be unintended)
    return a *= 2, a + 1;
                 ^
```

Fixes #6732.

&lt;!-- START COPILOT CODING AGENT TIPS --&gt;
---

💬 Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey.alchemer.com/s3/8343779/Copilot-Coding-agent) to
start the survey.

---------

Co-authored-by: copilot-swe-agent[bot] &lt;198982749+Copilot@users.noreply.github.com&gt;
Co-authored-by: aidanfnv &lt;198290069+aidanfnv@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;
Co-authored-by: aidanfnv &lt;aidanf@nvidia.com&gt;
Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Emit sample index when constructing a `OpImageTexelPointer` (#7563)</title>
<updated>2025-06-30T21:37:40+00:00</updated>
<author>
<name>ArielG-NV</name>
<email>159081215+ArielG-NV@users.noreply.github.com</email>
</author>
<published>2025-06-30T21:37:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=46d0d97222d34374f45720cbdac1f823e42a4f0d'/>
<id>urn:sha1:46d0d97222d34374f45720cbdac1f823e42a4f0d</id>
<content type='text'>
* fix #7554

* format code

* test ms and non ms texture

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
</feed>
