<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/autodiff/matrix-row-major-dedup.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-07-16T15:57:54+00:00</updated>
<entry>
<title>Fix duplicate DiffPair struct generation for row_major matrices in autodiff (#7728)</title>
<updated>2025-07-16T15:57:54+00:00</updated>
<author>
<name>Copilot</name>
<email>198982749+Copilot@users.noreply.github.com</email>
</author>
<published>2025-07-16T15:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=73f9aeb838bfaeaeae2c46d94000a4f98da47cea'/>
<id>urn:sha1:73f9aeb838bfaeaeae2c46d94000a4f98da47cea</id>
<content type='text'>
* Initial plan

* Fix duplicate DiffPair struct generation for row_major matrices in autodiff

Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;

* Fix matrix layout conversion to use BuiltinCastExpr

Address root cause in slang-check-conversion.cpp by creating proper cast
expressions for matrix layout conversions instead of reusing expressions.
This ensures autodiff sees proper type conversions and generates consistent
DiffPair structs.

Reverted the band-aid fix in autodiff system and implemented the proper
front-end fix as suggested in code review.

Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;

* Fix test to prevent dead code elimination and make it executable on CPU

Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;

* Fix spirv emit of matrix layout cast insts.

* Update test.

* cleanup test.

* Improve test with meaningful values that verify correct gradient computation

Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;

---------

Co-authored-by: copilot-swe-agent[bot] &lt;198982749+Copilot@users.noreply.github.com&gt;
Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
</feed>
