<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-serialize-ir.h, 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-17T06:59:33+00:00</updated>
<entry>
<title>Perf improvements to IR serialization (#7751)</title>
<updated>2025-07-17T06:59:33+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2025-07-17T06:59:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=28758e0e427ceca196937dc90efe3ab1cb35bd70'/>
<id>urn:sha1:28758e0e427ceca196937dc90efe3ab1cb35bd70</id>
<content type='text'>
* option to use riff as serialization backend

* option to use riff as serialization backend

* perf

* shuffle code

* perf improvements to deserialization

* formatting

* remove bit_cast

* correct IR verification

* neaten serialized format

* fix peek module info

* formatting

* remove temporary profiling code

* cleanup

* fix wasm build

* more explicit sizes

* deserialize via fossil on 32 bit wasm

* Make serialized modules Int size agnostic

* reorder stable names to allow range based check for 64 bit constants

* format

* review comments

* fix build

* fix

* c++17 compat slang-common.h</content>
</entry>
<entry>
<title>Stable names and backwards compat for serialized IR modules (#7644)</title>
<updated>2025-07-09T06:41:19+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2025-07-09T06:41:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=00746bf09047cdf01c19dac513a532bcf3ed3ea3'/>
<id>urn:sha1:00746bf09047cdf01c19dac513a532bcf3ed3ea3</id>
<content type='text'>
* stable names

* tests, options and ci for stable names

* Add back compat design document

* fix warnings

* formatting

* comment

* neaten

* regenerate command line reference

* consolidate ci scripts

* faster ci

* remove libreadline

* Move new function to end of interface

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Use fossil for IR serialization (#7619)</title>
<updated>2025-07-08T02:36:52+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2025-07-08T02:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=69947dec841ea46e68ccdccae45a1080fcaea01c'/>
<id>urn:sha1:69947dec841ea46e68ccdccae45a1080fcaea01c</id>
<content type='text'>
* bottleneck ir module reading and writing

* compute/simple working

* more complex tests working

* neaten

* factor out SourceLoc serialization

* document changes

* Appease clang

* Correct name serialization

* remove unnecessary code

* neaten

* neaten</content>
</entry>
<entry>
<title>Remove some cruft/complexity from IR serialization (#7483)</title>
<updated>2025-07-01T01:20:33+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2025-07-01T01:20:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6231a6830880f650e444405b670ed7cc0987184b'/>
<id>urn:sha1:6231a6830880f650e444405b670ed7cc0987184b</id>
<content type='text'>
* Remove some cruft/complexity from IR serialization

This is a very simple cleanup to unnecessary code paths and remove some flexibility that isn't actually needed, to hopefully simplify the task of more completely overhauling the approach to IR serialization in a later change.

The concrete feature that gets removed here is a debug-only feature (which thus shouldn't be affecting any users of Slang) that was added long ago in the life of the compiler as we were working to truly separate the front- and back-ends.
At the time there was a lot of code in the compiler back-end that still made use of AST-level data structures, and thus got in the way of our goal to support separate compilation and linking (such that final code generation can only depend on the IR, and not the AST).
The option was used to cause the Slang IR to be serialized out and then read back in as part of compilation, to try and enforce that only the wanted constructs could pass through that bottleneck.

The idea was only ever half implemented, however, because it made use of a secondary implementation path in IR serialization that supported serializing the "raw" source locations (which are heavily dependent on AST-level information, even down to the number of bytes in source files).
This change removes the feature entirely, since it is no longer useful for its intended purpose, and its presence causes there to be entire second code path for source locations in IR serialization that would need to have test coverage if we wanted to be sure it kept working.

In addition, our pre-existing infrastructure for module serialization had various options that have either stopped being useful, or were not really useful at the time they were introduced.

For example: there are no places in the code today where we attempt to serialize out a module without including both the serialized AST and IR.
If that was a feature that we ever supported, the relevant code got removed at some preceding point without breaking any of our tests or (seemingly) upsetting users.

Similarly, the options being passed into writing of a serialized module included both a flag to control whether source locations should be serialized *and* a pointer to the `SourceManager` to use in that case... but it was only ever meaningful to set both, or neither.
The option has been changed to just be the `SourceManager` pointer, and the name has been updated to reflect its very narrow intended use case.

* format code

* fixup

* regenerate command line reference

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Cleanups related to RIFF support (#7041)</title>
<updated>2025-05-12T17:28:05+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2025-05-12T17:28:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=4c76b275907cf2d764f3fc51468d1c58635a10c1'/>
<id>urn:sha1:4c76b275907cf2d764f3fc51468d1c58635a10c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove support for ad hoc Slang IR compression (#6834)</title>
<updated>2025-04-16T19:28:39+00:00</updated>
<author>
<name>Theresa Foley</name>
<email>10618364+tangent-vector@users.noreply.github.com</email>
</author>
<published>2025-04-16T19:28:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=2b20e9e150225f8cb75f7be2061f5ec99cbb2f66'/>
<id>urn:sha1:2b20e9e150225f8cb75f7be2061f5ec99cbb2f66</id>
<content type='text'>
* Remove support for ad hoc Slang IR compression

This change is part of a larger effort to clean up the approach to
serialization in the Slang compiler. The overall goal is to simplify
and streamline all of the serialization-related logic, so that we are
left with code that is less "clever," and easier to understand for
contributors to the codebase.

Removing support for compression of serialized Slang IR has
benefits that include:

* Reduction in code complexity: consider things like the subtle way
  that the `FOURCC`s for compressed chunks were being computed from
  the uncompressed versions, and the mental overhead that goes into
  understanding that, for anybody who would dare to touch this code.

* Reduction in testing burden: there have been, de facto, two
  very different code paths for serialization of the Slang IR, and
  it is not clear that the existing test corpus for Slang has
  sufficient coverage for both options. By having only a single code
  path, every test that performs any amount of IR serialization helps
  with test coverage of that one path.

* Opportunity to explore alternatives. This is perhaps a reiteration
  of the first point, but once the code is stripped down to the
  simplest thing that could possibly work (I am not claiming it has
  reached that point yet), it becomes easier for contributors to
  understand, and it becomes more tractable for somebody to come along
  with an improved approach that performs better (in either
  compression ratio or performance) while still being maintainable.

In my own local setup, I found that removing support for Slang IR
compression led to the `slang-core-module-generated.h` file increasing
in size from 46.1MB to 47.4MB. This increase in the `.h` file size
for the core library binary only resulted in a release build of
`slang.dll` increasing from 20.0MB to 20.2MB. Removing the ad hoc
compression support has almost no impact on the size of actual binary
Slang modules *so long* as the additional LZ4 compression step is
being applied to them.

* format code

---------

Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>Use ankerl/unordered_dense as a hashmap implementation (#3036)</title>
<updated>2023-08-16T00:57:47+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2023-08-16T00:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=45d9961a6a86d184248ef84f6a07125b0c224f97'/>
<id>urn:sha1:45d9961a6a86d184248ef84f6a07125b0c224f97</id>
<content type='text'>
* Correct namespace for getClockFrequency

* missing const

* Add missing assignment operator

* Remove unused variables

* Return correct modified variable

* Use stable hash code for file system identity

* terse static_assert

* Structured binding for map iteration

* Make (==) and getHashCode const on many structs

* Add ConstIterator for LinkedList

* Replace uses of ItemProxy::getValue with Dictionary::at

* Extract list of loads from gradientsMap before updating it

* Const correctness in type layout

* Add unordered_dense hashmap submodule

* Use wyhash or getHashCode in slang-hash.h

* refactor slang-hash.h

* Use ankerl/unordered_dense as a hashmap implementation

Notable changes:
- The subscript operator returns a reference directly to the value,
  rather than a lazy ItemProxy (pair of dict pointer and key)

slang-profile time (95% over 10 runs):

- Before: 6.3913906 (±0.0746)
- After:  5.9276123 (±0.0964)

* 64 bit hash for strings

So they have the same hash as char buffers with the same contents

* Narrowing warnings for gcc to match msvc

* revert back to c++17

* Correct c++ version for msvc

* Use path to unordered_dense which keeps tests happy

* Do not assign to and read from map in same expression

* Remove redundant map operations in primal-hoist

* Split out stable hash functions into slang-stable-hash.h

* 64 bit hash by default

* regenerate vs projects

* Correct return type from HashSetBase::getCount()

* correct width for call to Dictionary::reserve

* Use stable hash for obfuscated module ids

* Signed int for reserve

* clearer variable naming

* Parameterize Dictionary on hash and equality functors

* Allow heterogenous lookup for Dictionary

* missing const

* Use set over operator[] in some places

* Remove unused function

* s/at/getValue</content>
</entry>
<entry>
<title>Serialization design doc first pass (#1587)</title>
<updated>2020-10-23T20:39:18+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2020-10-23T20:39:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e702b704e15a3f0dcbcac6ae82b7cb3c10a4ced2'/>
<id>urn:sha1:e702b704e15a3f0dcbcac6ae82b7cb3c10a4ced2</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP on serialization design doc.

* More docs on serialization design.

* Improve serialization documentation.
Remove unused function from IRSerialReader.

* Small fixes around naming. Remove long comment from slang-serialize.h - as covered in serialization.md

* Remove long comment in slang-serialize.h as covered in serialization.md

* More information about doing replacements on read for AST and problems surrounding.

* Typo fix.

* Spelling fixes.</content>
</entry>
<entry>
<title>Generalizing Serialization (#1563)</title>
<updated>2020-09-30T17:28:56+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2020-09-30T17:28:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=274c20a5eb133779a9d890ca79120815fb92b04e'/>
<id>urn:sha1:274c20a5eb133779a9d890ca79120815fb92b04e</id>
<content type='text'>
* First pass at generalizing serializer.

* Split out ReflectClassInfo

* Use the general ReflectClassInfo

* Fix some typos in debug generalized serialization.

* Add calculation of classIds.
Make distinct addCopy/add on SerialClasses.

* Write up of more generalized serialization

* WIP to transition from ASTSerialReader/Writer etc to generalized SerialReader/Writer and associated types.

* Improvements to SerialExtraObjects.
Keep RefObjects in scope in factory

* Compiles with Serial refactor - doesn't quite work yet.

* First pass serialization appears to work with refector.

* Split out type info for general slang types.

* Split out slang-serialize-misc-type-info.h

* DebugSerialData -&gt; SerialSourecLocData
DebugSerialReader -&gt; SerialSourceLocReader
DebugSerialWriter -&gt; SerialSourceLocWriter

* Remove unused template that only compiles on VS.

* Fix warning around unused function on non-VS.</content>
</entry>
</feed>
