CorrelatedValuePropagation generates illegal i10 integer width in DXIL
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The narrowing happens in the CorrelatedValuePropagation pass, so start with its implementation in the LLVM 3.7-based optimizer code under lib/Transforms, and compare it with the upstream fix referenced in the issue. The reproduction needs the modulo call from SobolSampling.hlsl (ModuloPreserveWidth with maxDim = 1024) compiled as a lib_6_3 ray generation shader with optimizations on. Done means that compile produces valid DXIL with no i10 types, and a regression test covers the narrowing case.
索引モデルが issue の本文から書いたものです。
説明
Description
DXC's CorrelatedValuePropagation optimization narrows integer types based on inferred value ranges, producing illegal DXIL types like i10.
We've been trying to add a workaround on our side but we really need this to be fixed properly. We are basically adding a dead branch returning 0xFFFFFFFF to prevent type narrowing - the compiler can't prove the branch is never taken, so the return type must remain i32.
This class of bug was fixed for LLVM's new DirectX backend in llvm PR#225233, but that fix doesn't apply to DXC's LLVM 3.7 fork.
Steps to Reproduce
Unity's SRP ray tracing shaders on Windows DX12:
- Shader:
DynamicGISkyOcclusion, entry pointMainRayGenShader - Public source: SobolSampling.hlsl
- Specifically, the
ModuloPreserveWidth(dim, maxDim)call wheremaxDim = 1024triggers the narrowing when compiled as a ray generation shader (lib_6_3 or higher) with optimizations enabled.
Actual Behavior
Shader compilation fails with DXIL validation error:
Int type 'i10' has an invalid width. at kernel MainRayGenShader (on dx12)
The optimizer's CorrelatedValuePropagation pass narrows dim % 1024 to 'i10' because the result range (0-1023) fits in 10 bits. DXIL only supports i1/i16/i32/i64, so validation rejects the i10.
Environment
- DXC version : 1.9.2609 (built from the main branch on September 21, 2026)
- Host Operating System : Windows, DX12
- 主要言語
- C++
- スター
- 3.7k
- フォーク
- 926
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 45
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/DirectXShaderCompiler のほかの issue
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/DirectXShaderCompiler#9173 ·
メンテナーはふだん 2 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
microsoft/DirectXShaderCompiler#9155 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/DirectXShaderCompiler#9135 ·
メンテナーはふだん 2 日以内に返信
-
DXC emits DW_LANG_C_plus_plus instead of DW_LANG_HLSL for HLSL対応中かも @rj123-nv が 18 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9087 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9086 ·
メンテナーはふだん 2 日以内に返信
microsoft/DirectXShaderCompiler の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
feature:config kind:docs os:windows toolchain:cmake triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
arch-based bug niri
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
noctalia-dev/noctalia#5552 ·
メンテナーはふだん 1 日以内に返信